Streaming game development: https://www.twitch.tv/stabyourself Image

Mari0 Modding Help Thread

Mods, guides how to use and install mods go right in here.
Turtle95
User avatar
Posts: 1275
Joined: 21 Mar 2012, 21:48
Reputation: 122
Contact:

Post » 04 Nov 2013, 00:10

HugoBDesigner wrote:
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.


Make 2 sound sources:

Code: Select all

introsound = love.audio.newSource("[sound].ogg")
loopsound = love.audio.newSource("[sound 2].ogg")
introplaying = false

(introplaying is to check when the looping sound should be playing)

When you wanna play it:

Code: Select all

love.audio.play(introsound)
introplaying = true


and later, to check when intro music is finished (put it in love.update):

Code: Select all

if introsound:isStopped() and introplaying then
    introplaying = false
    loopsound:setLooping(true)
    love.audio.play(loopsound)
end


This should work, but if it doesn't, then try putting the loopsound:setLooping(true) under the love.audio.play(loopsound).

To stop the looping music just put a love.audio.stop(loopsound) where you want it to stop :)


While Hugo is correct, there is another way:

Unless the sound only happens more than once (love.update, love.draw, loops, etc), you could do:

Code: Select all

love.audio.play(introsound)


which is only going to happen once, then do

Code: Select all

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)

Mari0Maker
User avatar
Posts: 1347
Joined: 07 Apr 2012, 17:10
Reputation: 39
Contact:

Post » 06 Nov 2013, 00:41

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"?

Vyper
User avatar
Posts: 164
Joined: 16 Jan 2013, 23:18
Reputation: 2
Contact:

Post » 23 Nov 2013, 15:50

How can you change how fast the timer ticks down?

alesan99
User avatar
Posts: 1652
Joined: 30 May 2013, 21:42
Reputation: 278
Contact:

Post » 23 Nov 2013, 16:38

Vyper wrote:How can you change how fast the timer ticks down?

Game.lua line 197

Code: Select all

         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.

HugoBDesigner
User avatar
Posts: 2116
Joined: 19 Sep 2012, 02:23
Reputation: 668
Contact:

Post » 12 Dec 2013, 18:47

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!

The code, if you guys need it:

Code: Select all

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:

Code: Select all

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!

TripleXero
User avatar
Posts: 892
Joined: 08 Aug 2012, 00:23
Reputation: 27
Contact:

Post » 18 Dec 2013, 07:35

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?

OrbitalBlueprint
User avatar
Posts: 600
Joined: 08 Sep 2013, 20:11
Reputation: 309
Contact:

Post » 06 May 2014, 16:50

Silly question: Where can the code for the tile properties be found?

HugoBDesigner
User avatar
Posts: 2116
Joined: 19 Sep 2012, 02:23
Reputation: 668
Contact:

Post » 06 May 2014, 16:54

In quad.lua. What they do must be edited in game.lua, at random places...

Jurassican
User avatar
Posts: 2
Joined: 13 Aug 2015, 00:39
Reputation: 0
Contact:

Post » 13 Aug 2015, 00:43

How do you add custom music in Mari0?

Jurassican
User avatar
Posts: 2
Joined: 13 Aug 2015, 00:39
Reputation: 0
Contact:

Post » 13 Aug 2015, 01:02

How do you add Minecraft block skins in mari0?

Technochips
User avatar
Posts: 695
Joined: 12 Mar 2015, 16:05
Reputation: 194
Contact:

Post » 13 Aug 2015, 01:13


Squidish
User avatar
Posts: 806
Joined: 05 Apr 2014, 04:04
Reputation: 211
Contact:

Post » 13 Aug 2015, 03:23

Julien12150 wrote:this

That's only for se. 1.6 has different tile properties and music.

zorua7551
User avatar
Posts: 194
Joined: 10 Jul 2013, 04:23
Reputation: 5

Post » 13 Aug 2015, 03:46

He didn't define which Mari0 version though.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron