Mari0Maker wrote:How can I make music loop from a certain point? For example, a song has a intro. This way, the song can loop properly.
A good example of this would be Mario Kart Wii.
if introsound:isStopped() then
--Well, what now? Play the damn song!
loopsound:setLooping(true)
love.audio.play(loopsound)
end
Then on the next gamestate, call love.audio.stop(loopsound)
Re: Mari0 Modding Help Thread
Posted: 06 Nov 2013, 00:41
by Mari0Maker
How am I supposed to do that with, for example, the overworld theme?
Also, if I have a song that plays when you pause the game, how can I make the song stop when I press "Resume"?
Re: Mari0 Modding Help Thread
Posted: 23 Nov 2013, 15:50
by Vyper
How can you change how fast the timer ticks down?
Re: Mari0 Modding Help Thread
Posted: 23 Nov 2013, 16:38
by alesan99
Vyper wrote:How can you change how fast the timer ticks down?
mariotime = mariotime - 2.5*dt
if mariotime > 0 and mariotime + 2.5*dt >= 99 and mariotime < 99 then
love.audio.stop()
playsound(lowtime)
end
if mariotime > 0 and mariotime + 2.5*dt >= 99-7.5 and mariotime < 99-7.5 then
All you have to do is change 2.5 to whatever speed you want. The bigger the number the faster.
Re: Mari0 Modding Help Thread
Posted: 12 Dec 2013, 18:47
by HugoBDesigner
Old post:
I have a problem trying to get a value from an object.
In my mod (Mari0 +Portal if you don't know, but you probably do), i'm trying to make a loading system for Triggers where they'll load what objects triggers them. It works like this:
"player+box.id=2&box.gelid=1+goomba+gel.id=3"
It's detected like this: all entities that can activate the Trigger are separated by "+", but some entities (like "box" and "gel", in this example) have specified values to allow triggers to activate. It means that boxes will only activate the Trigger if they have the id "2" and the gel id "1".
The problem is: I made it to check in objects variables if each parameter is true. The "." represents the objects ".", so "box.id" will check the objects["box"][n].id. But, to do this, I need to use _G (which would convert the string into a variable). But I just can't do it. I tried everything, but it just doesn't works!
if check3 then
local args = params[2]:split("=")
local value = args[2]
if args[2] == "true" then
value = true
elseif args[2] == "false" then
value = false
elseif tonumber(args[2]) then
value = tonumber(args[2])
end
if v._G[args[1]] == value then
--Nothing, 'can' is already true
print("passed = YES")
else
can = false
print("passed = NO")
end
end
Where v is the object itself (for j, v in pairs(objects[obj])), args are the two parts of the parameter (for "box.id=2", args would be {"id", "2"}) and params are the parameters divided (for "box.id=2", params would be {"box", "id=2"}).
Thanks for the help (if you help me) :)
EDIT: Nevermind. I realized that all I needed to do was this:
if check3 then
local args = params[2]:split("=")
local value = args[2]
if args[2] == "true" then
value = true
elseif args[2] == "false" then
value = false
elseif tonumber(args[2]) then
value = tonumber(args[2])
end
for m, n in pairs(v) do
if tostring(m) == args[1] then
if v.m == value then
--Nothing, 'can' is already true
print("passed = YES")
else
can = false
print("passed = NO")
end
end
end
end
Anyway, thanks!
Re: Mari0 Modding Help Thread
Posted: 18 Dec 2013, 07:35
by TripleXero
I've been trying to get the set keys for a controller to work through menus in Mari0 for a while now, and I've gotten the buttons to work, but I've been trying so many things to gets the directional pad or sticks to work but cannot figure them out at all. Can I get some help?
Re: Mari0 Modding Help Thread
Posted: 06 May 2014, 16:50
by OrbitalBlueprint
Silly question: Where can the code for the tile properties be found?
Re: Mari0 Modding Help Thread
Posted: 06 May 2014, 16:54
by HugoBDesigner
In quad.lua. What they do must be edited in game.lua, at random places...