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.
Mari0Maker
User avatar
Posts: 1347
Joined: 07 Apr 2012, 17:10
Reputation: 39
Contact:

Post » 28 Sep 2013, 23:37

If you need help with modding Mari0, just post here!

You can also ask one of these users for help by posting here or PM'ing them. You can ask if you'd like to be on this list too.

Problems solved so far
In order of appearance. This does not count for problems solved via PM.

    ●Adding more music
    ●Changing single player portal colors
    ●Fixing title screen Mario when changing a character (without the Character Loader mod)
    ●Changing the title of the game (the title bar)
    ●intermission.ogg lagging the game (replace "static" with "stream")
    ●Changing single player Mario colors
    ●Changing default Portal colors
Last edited by Mari0Maker on 03 Nov 2013, 01:21, edited 14 times in total.

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 29 Sep 2013, 00:20

I think the colors are predefined in rgblist.lua, if I remember correctly.
To add more music to the editor, go to editor.lua and change this line:

Code: Select all

   guielements["musicdropdown"] = guielement:new("dropdown", 17, 110, 11, changemusic, musici, "none", "overworld", "underground", "castle", "underwater", "star", "custom")


And add to the list the musics you want AFTER "custom" (it's better add after "custom" so you don't have to do a giant work trying to change the custom music settings).
Add the musics you want to the "sounds" folder, and add it's name (without .ogg) to this list (on musicloader.lua):

Code: Select all

music:load{
   "overworld",
   "overworld-fast",
   "underground",
   "underground-fast",
   "castle",
   "castle-fast",
   "underwater",
   "underwater-fast",
   "starmusic",
   "starmusic-fast",
   "princessmusic",
}


Not sure if it'll work, but just in case (since custom musics are loaded as the 8th item of this list, even not being there), change it to this:

Code: Select all

music:load{
   "overworld",
   "overworld-fast",
   "underground",
   "underground-fast",
   "castle",
   "castle-fast",
   "underwater",
   "underwater-fast",
   "starmusic",
   "starmusic-fast",
   "princessmusic",
   "",
   "SOME OTHER(S) MUSIC(S) YOU WANT"
}

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

Post » 29 Sep 2013, 00:27

Thanks, I'll test it out! :)
Another thing I'd like to fix: how can I remove the delay from the coinblock (? Block)?

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 29 Sep 2013, 00:53

Mari0Maker wrote:Thanks, I'll test it out! :)
Another thing I'd like to fix: how can I remove the delay from the coinblock (? Block)?

Variables.lua

Code: Select all

coinblocktime = 0.3
coinblockdelay = 0.5/30

I think you need to change this.

Fire Colors

Main.lua

Code: Select all

   starcolors[1] = {{  0,   0,   0}, {200,  76,  12}, {252, 188, 176}}
   starcolors[2] = {{  0, 168,   0}, {252, 152,  56}, {252, 252, 252}}
   starcolors[3] = {{252, 216, 168}, {216,  40,   0}, {252, 152,  56}}
   starcolors[4] = {{216,  40,   0}, {252, 152,  56}, {252, 252, 252}}
   
   flowercolor = {{252, 216, 168}, {216,  40,   0}, {252, 152,  56}}

Just change starcolors[3].

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

Post » 29 Sep 2013, 00:59

alesan99 wrote:
Mari0Maker wrote:Thanks, I'll test it out! :)
Another thing I'd like to fix: how can I remove the delay from the coinblock (? Block)?

Variables.lua

Code: Select all

coinblocktime = 0.3
coinblockdelay = 0.5/30

I think you need to change this.

Made both "coinblockdelay" values 0, didn't change anything.

QwertymanO07
User avatar
Posts: 1317
Joined: 05 Oct 2012, 07:58
Reputation: 377
Contact:

Post » 29 Sep 2013, 01:00

Does anybody know how to change the single player portal colors?

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 29 Sep 2013, 01:02

Mari0Maker wrote:Made both "coinblockdelay" values 0, didn't change anything.

Maybe the variables are unused :/.

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 29 Sep 2013, 01:05

QwertymanO07 wrote:Does anybody know how to change the single player portal colors?

Easy

mario.lua lines 111-117
Change

Code: Select all

   if players == 1 then
      self.portal1color = {60, 188, 252}
      self.portal2color = {232, 130, 30}
   else
      self.portal1color = portalcolor[self.playernumber][1]
      self.portal2color = portalcolor[self.playernumber][2]
   end

to

Code: Select all

   if players == 1 then
      self.portal1color = portalcolor[self.playernumber][1]
      self.portal2color = portalcolor[self.playernumber][2]
   else
      self.portal1color = portalcolor[self.playernumber][1]
      self.portal2color = portalcolor[self.playernumber][2]
   end


If you meant changing the default colors then just change the RBG numbers.

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

Post » 29 Sep 2013, 01:40

alesan99 wrote:
Mari0Maker wrote:Made both "coinblockdelay" values 0, didn't change anything.

Maybe the variables are unused :/.

Actually, I found out that it changes the speed of the coin popping out. :P

Also, how can I fix this bug? I changed my character (without the character loading mod), and this happens on the title screen:
Image
Anyone know how to fix this?

EDIT: How can I add title screen music?

EDIT 2: How can I add an entity from another mod?

EDIT 3 (D:): How can I change the name of the game (the title bar)?

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 29 Sep 2013, 01:58

Mari0Maker wrote:EDIT 3 (D:): How can I change the name of the game (the title bar)?

conf.lua

Code: Select all

function love.conf(t)
   t.author = "Maurice"
   t.identity = "mari0"
   t.console = false
   --t.screen = false
   t.modules.physics = false
   t.version = "0.8.0"
end

Change t.identity

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

Post » 29 Sep 2013, 02:02

alesan99 wrote:
Mari0Maker wrote:EDIT 3 (D:): How can I change the name of the game (the title bar)?

conf.lua

Code: Select all

function love.conf(t)
   t.author = "Maurice"
   t.identity = "mari0"
   t.console = false
   --t.screen = false
   t.modules.physics = false
   t.version = "0.8.0"
end

Change t.identity

That just creates a new folder in "appdata" titled whatever you put in there.

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 29 Sep 2013, 02:13

Mari0Maker wrote:That just creates a new folder in "appdata" titled whatever you put in there.

Oops. change

main.lua line 42

Code: Select all

   love.graphics.setCaption( "Mari0" )

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

Post » 29 Sep 2013, 02:16

alesan99 wrote:
Mari0Maker wrote:That just creates a new folder in "appdata" titled whatever you put in there.

Oops. change

main.lua line 42

Code: Select all

   love.graphics.setCaption( "Mari0" )

Thank you so much! :D
Now to get my other million problems solved...

Qcode
User avatar
Posts: 1466
Joined: 05 Feb 2012, 18:00
Reputation: 72
Contact:

Post » 29 Sep 2013, 03:29

I also think a good addition to this would have a list of people (similar to the criticism and question mega threads in Twatter) who would be comfortable with answering modding questions. Like if someone wanted some one on one help, or if they wanted to ask a modder how they achieved a certain effect in their mod, they can be asked here.
I'd be willing to be added to the list if you were to create it.

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 29 Sep 2013, 05:43

Qcode wrote:I also think a good addition to this would have a list of people (similar to the criticism and question mega threads in Twatter) who would be comfortable with answering modding questions. Like if someone wanted some one on one help, or if they wanted to ask a modder how they achieved a certain effect in their mod, they can be asked here.
I'd be willing to be added to the list if you were to create it.

I'm not as good as Qcode with lua, but I've already made a mod with customizable stuff and new entities and a game from scratch, so I think I'd be qualified to this list too :)

Automatik
User avatar
Posts: 1076
Joined: 20 Jul 2012, 17:54
Reputation: 8
Contact:

Post » 29 Sep 2013, 09:26

alesan99 wrote:

Code: Select all

   if players == 1 then
      self.portal1color = portalcolor[self.playernumber][1]
      self.portal2color = portalcolor[self.playernumber][2]
   else
      self.portal1color = portalcolor[self.playernumber][1]
      self.portal2color = portalcolor[self.playernumber][2]
   end

Shorter:

Code: Select all

   self.portal1color = portalcolor[self.playernumber][1]
   self.portal2color = portalcolor[self.playernumber][2]

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

Post » 29 Sep 2013, 19:29

@Qcode and HugoBDesginer

I'll make a list.
If anyone else is willing to be on the list, then just post here or PM me.

In that case, I'll ask Qcode this.
Mari0Maker wrote:Also, how can I fix this bug? I changed my character (without the character loading mod), and this happens on the title screen:
Image
Anyone know how to fix this?

How can I add an entity from another mod?
How can I remove the delay from the Coin Block (? Block)?

Qcode
User avatar
Posts: 1466
Joined: 05 Feb 2012, 18:00
Reputation: 72
Contact:

Post » 29 Sep 2013, 19:56

You didn't specify what the problem was with the character, so I'll just assume it's the hat being above the character.
All of mario's quads are placed two pixels from the bottom. The graphics you'll need to change are in graphics/SMB/options, change the incorrect skin or secondskin.png.
There's no easy way to add an entity from another mod, however a method that should work most of the time is searching for the entity name throughout game.lua, main.lua, entity.lua and copying across any piece of code which is found. Also copy across "entityname".lua and make sure to copy across any graphics that may be added.
No idea what delay you're talking about for the last one.

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

Post » 29 Sep 2013, 20:02

The first problem is that I changed the character from Mario, to Luigi (without the Character Loading mod), and the sprite stays as Mario, with the hat above his head, and an invisible space in the center of his body.
The delay problem is this: I'm adding the NSMB Coin Block as the texture, and it looks weird with the delay. There is a delay on the main sprite of the Coin Block (the first texture from the left of the coinblock).

And I'll try the entity trick. :)

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

Post » 29 Sep 2013, 22:08

New problem. If I change the music for "intermission.ogg", the game doesn't boot up. The intermission music I chose is a lot longer than the original.

Qcode
User avatar
Posts: 1466
Joined: 05 Feb 2012, 18:00
Reputation: 72
Contact:

Post » 29 Sep 2013, 22:33

Well like I said edit the graphics in graphics/SMB/options to be luigi instead of mario.
To edit the coin block delay it takes a bit because the blocks and the coin run on the same frame so it's harder to separate them.
First go to levelscreen.lua. On line 64 there should be the line

Code: Select all

coinframe = 1

Under that add

Code: Select all

coinblockframe = 1

Then go to game.lua.
Around line 1924 there should be the comment "--MISC VARS". Under that add

Code: Select all

coinblockquadanimation = 1
.
Then around line 165 there should be the comment "--SCROLLING SCORES". Above that paste in the following chunk of code.

Code: Select all

   coinblockquadanimation = coinblockquadanimation + dt*6.75
   while coinblockquadanimation > 5 do
      coinblockquadanimation = coinblockquadanimation - 4
   end   
   
   if math.floor(coinblockquadanimation) == 1  then
      coinblockframe = 1
   elseif math.floor(coinblockquadanimation) == 2 or math.floor(coinblockquadanimation) == 4 then
      coinblockframe = 2
   else
      coinblockframe = 3
   end

Now head to line 984, there should be a line that starts with this:

Code: Select all

love.graphics.drawq(coinblockimage, coinblockquads[spriteset][coinframe]

Make sure that the first argument is coinblockimage and not coinimage.
Now you see there where it says coinframe? Change that to coinblockframe. Then it should be finished.

I can't reproduce your intermission.ogg problem. I changed it to the underworld music and it still booted up. It would help if you posted a .love file.

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

Post » 29 Sep 2013, 22:36

Qcode wrote:I can't reproduce your intermission.ogg problem. I changed it to the underworld music and it still booted up. It would help if you posted a .love file.

Try it with this file:
*link removed*
Last edited by Mari0Maker on 29 Sep 2013, 23:08, edited 1 time in total.

Qcode
User avatar
Posts: 1466
Joined: 05 Feb 2012, 18:00
Reputation: 72
Contact:

Post » 29 Sep 2013, 23:01

Still runs fine for me.
It would help if you posted a .love file.

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

Post » 29 Sep 2013, 23:12

Here ya go.
*link removed*
Last edited by Mari0Maker on 29 Sep 2013, 23:30, edited 1 time in total.

Qcode
User avatar
Posts: 1466
Joined: 05 Feb 2012, 18:00
Reputation: 72
Contact:

Post » 29 Sep 2013, 23:28

Lagged a bit for me on start, then settled out fine.
Try using this compressed version https://dl.dropboxusercontent.com/u/80409786/intermission.ogg

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

Post » 29 Sep 2013, 23:31

Qcode wrote:Lagged a bit for me on start, then settled out fine.
Try using this compressed version https://dl.dropboxusercontent.com/u/80409786/intermission.ogg

Lagged for me at the start for about 20secs, but then booted up.
I think that'll be fine. Thanks!

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

Post » 30 Sep 2013, 03:31

How can I make this feature: when you enter the Konami Code, it has the possibility of playing one song, or another, or another different one.
And I don't want to use songs already included in Mari0, I want it to use new ones I add to the game.

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 30 Sep 2013, 03:56

Mari0Maker wrote:How can I make this feature: when you enter the Konami Code, it has the possibility of playing one song, or another, or another different one.
And I don't want to use songs already included in Mari0, I want it to use new ones I add to the game.

Like playing a random sound? Easy (I think).

First of all: put the sounds you want in the "sounds" folder.

Go to main.lua, to the function love.load.
Add to the music lists the musics you want. If you call them with something like konami1sound, konami2sound, konami3sound and so on, they'll be easier to be loaded in the future.
They are loaded like this:

Code: Select all

   konamisound = love.audio.newSource("sounds/konami.ogg", "static");konamisound:setVolume(0);konamisound:play();konamisound:stop();konamisound:setVolume(1)


So add the file name of your sounds there.

Later, add them to the sound list:

Code: Select all

   soundlist = {jumpsound, jumpbigsound, stompsound, shotsound, blockhitsound, blockbreaksound, coinsound, pipesound, boomsound, mushroomappearsound, mushroomeatsound, shrinksound, deathsound, gameoversound,
            fireballsound, oneupsound, levelendsound, castleendsound, scoreringsound, intermissionsound, firesound, bridgebreaksound, bowserfallsound, vinesound, swimsound, rainboomsoud,
            portal1opensound, portal2opensound, portalentersound, portalfizzlesound, lowtime, konamisound, pausesound, stabsound, bulletbillsound}


On the love.keypressed function, change this:

Code: Select all

      if key == konami[konamii] then
         konamii = konamii + 1
         if konamii == #konami+1 then
            if konamisound:isStopped() then
               playsound(konamisound)
            end
            gamefinished = true
            saveconfig()
            konamii = 1
         end
      else
         konamii = 1
      end


To this:

Code: Select all

      if key == konami[konamii] then
         konamii = konamii + 1
         if konamii == #konami+1 then
            if konamisound:isStopped() then
               local randomsound = math.random(THE NUMBER OF SOUNDS YOU HAVE FOR THIS)
               playsound(_G["konami" .. tostring(randomsound) .. "sound"])
            end
            gamefinished = true
            saveconfig()
            konamii = 1
         end
      else
         konamii = 1
      end


In this example, you'd have 3 sounds, so it'd be like this:

Code: Select all

      if key == konami[konamii] then
         konamii = konamii + 1
         if konamii == #konami+1 then
            if konamisound:isStopped() then
               local randomsound = math.random(3)
               playsound(_G["konami" .. tostring(randomsound) .. "sound"])
            end
            gamefinished = true
            saveconfig()
            konamii = 1
         end
      else
         konamii = 1
      end


I hope that's what you want, and I hope it works :)

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

Post » 30 Sep 2013, 22:41

HugoBDesigner wrote:
Mari0Maker wrote:How can I make this feature: when you enter the Konami Code, it has the possibility of playing one song, or another, or another different one.
And I don't want to use songs already included in Mari0, I want it to use new ones I add to the game.

Like playing a random sound? Easy (I think).
*code_oh_goodness_please_help*

Yep, I think that is what I want. I'll try it out, and say if it worked or not.

EDIT: Does anyone know the bitrate (kbps) of the sounds in Mari0?

Maurice
Stabyourself.net
Posts: 2142
Joined: 01 Feb 2012, 20:19
Reputation: 103

Post » 02 Oct 2013, 09:51

All sounds went through audacity at default quality, which is roughly 160 kbps. http://wiki.audacityteam.org/wiki/OGG

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

Post » 03 Oct 2013, 03:32

Maurice wrote:All sounds went through audacity at default quality, which is roughly 160 kbps. http://wiki.audacityteam.org/wiki/OGG

Thanks Maurice!

EDIT: For adding the multiple Konami code sounds, I got this:
http://i.imgur.com/YdFAfVO.png
Image


The name of my other konami sound is "konami2", and for the value of the random sounds, I put "2".
This is what I mean by the value of the random sound:

Code: Select all

local randomsound = math.random(2)


I also added "love.audio.Stop()" after this line for title screen music purposes:

Code: Select all

playsound(_G["konami" .. tostring(randomsound) .. "sound"])

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 03 Oct 2013, 04:38

Mari0Maker wrote:EDIT: For adding the multiple Konami code sounds, I got this:
http://i.imgur.com/YdFAfVO.png
Image


The name of my other konami sound is "konami2", and for the value of the random sounds, I put "2".
This is what I mean by the value of the random sound:

Code: Select all

local randomsound = math.random(2)


I also added "love.audio.Stop()" after this line for title screen music purposes:

Code: Select all

playsound(_G["konami" .. tostring(randomsound) .. "sound"])


This is what you made wrong:

Code: Select all

playsound(_G["konami" .. tostring(randomsound) .. "sound"])


Suppose it got the number 2 on the randomizer.
Translating the code above: Play the sound named "konami2sound";

It cannot find this sound because:
Mari0Maker wrote:The name of my other konami sound is "konami2" [...]


You can either rename the "konami2" to "konami2sound" or change this:

Code: Select all

playsound(_G["konami" .. tostring(randomsound) .. "sound"])


...to this:

Code: Select all

playsound(_G["konami" .. tostring(randomsound)])


Also, have you added/changed the already existing konami sound to be "konami1sound"? Because if not then the game might crash again...

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

Post » 03 Oct 2013, 04:41

I need help doing something based on time, and I can not figure out how to do it at all. Not os.date things, like doing something after a certain amount of time passes

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 03 Oct 2013, 05:08

TripleXero wrote:I need help doing something based on time, and I can not figure out how to do it at all. Not os.date things, like doing something after a certain amount of time passes

Why not use love.update(dt) then?
Dt adds 1 to a certain value on each second, so, to get the amount of time passed, just add to love.update(dt):
timepassed = timepassed + dt

But don't forget to add timepassed = 0 to love.load(). I'm not sure if it is necessary, but it is better if you add:
dt = math.min(.1/6, dt)

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

Post » 03 Oct 2013, 05:55

Thank you, I couldn't figure out how dt even worked before. One more thing, is there a way to cut off decimals without rounding it up? Like 132.9432552 to 132

Camewel
Posts: 2996
Joined: 02 Feb 2012, 21:32
Reputation: 35

Post » 03 Oct 2013, 06:13

math.floor
it's like you're not even trying

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

Post » 03 Oct 2013, 06:24

The time thing I honestly had no clue, with math.floor, I did try that and thought it wasn't working, but it had been because of something I changed earlier and didn't realize would affect it

Maurice
Stabyourself.net
Posts: 2142
Joined: 01 Feb 2012, 20:19
Reputation: 103

Post » 04 Oct 2013, 11:35

Then you should learn how to debug.
ie throw print()'s all over your code. It's what I do at least.

Camewel
Posts: 2996
Joined: 02 Feb 2012, 21:32
Reputation: 35

Post » 04 Oct 2013, 12:51

or use love.graphics.print if you're on some awful OS that doesn't allow the console

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 04 Oct 2013, 23:25

How to make 2 walking frames for the goomba. This isn't answering a question asked here but it is asked in some other places.

SHOW TUTORIAL
1.Make the Image (Or use the one below)
Image
Put in Mari0 (Duh)

2. Change Main.lua
You have to change it so LOVE can detect the image's new width and number of frames.
Main.lua Line 362

Code: Select all

   goombaimage = love.graphics.newImage("graphics/" .. graphicspack .. "/goomba.png")
   goombaquad = {}
   
   for y = 1, 4 do
      goombaquad[y] = {}
      for x = 1, 2 do
         goombaquad[y][x] = love.graphics.newQuad((x-1)*16, (y-1)*16, 16, 16, 32, 64)
      end
   end

Change "for x = 1, 2" to "for x = 1, 3" because that's the amount of frames there are horizontally.
Then change "((x-1)*16, (y-1)*16, 16, 16, 32, 64)" to "((x-1)*16, (y-1)*16, 16, 16, 48, 64)" because that's the amount of pixels horizontally.
It should end up like this:

Code: Select all

   goombaimage = love.graphics.newImage("graphics/" .. graphicspack .. "/goomba.png")
   goombaquad = {}
   
   for y = 1, 4 do
      goombaquad[y] = {}
      for x = 1, 3 do
         goombaquad[y][x] = love.graphics.newQuad((x-1)*16, (y-1)*16, 16, 16, 48, 64)
      end
   end


3.Change goomba.lua.
Goomba.lua Line 111

Code: Select all

         if self.t == "goomba" then
            if self.animationdirection == "left" then
               self.animationdirection = "right"
            else
               self.animationdirection = "left"
            end

change that to

Code: Select all

         if self.t == "goomba" then
            if self.quad = goombaquad[spriteset][1] then
               self.quad = goombaquad[spriteset][2]
            else
               self.quad = goombaquad[spriteset][1]
            end


Then Change
Goomba.lua Line 171

Code: Select all

function goomba:stomp()--hehe goomba stomp
   self.dead = true
   self.active = false
   self.quad = goombaquad[spriteset][2]
end


to

Code: Select all

function goomba:stomp()--hehe goomba stomp
   self.dead = true
   self.active = false
   self.quad = goombaquad[spriteset][3]
end


YOU ARE DONE BUT IF YOU WANT IT TO FLIP WHEN IT TOUCHES A WALL THEN...
Change
Goomba.Lua Line 198

Code: Select all

   if self.t == "spikey" then
      self.animationdirection = "left"
   end

and
Goomba.Lua Line 212

Code: Select all

   if self.t == "spikey" then
      self.animationdirection = "right"
   end


to

Code: Select all

   self.animationdirection = "left"

and

Code: Select all

   self.animationdirection = "right"

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

Post » 05 Oct 2013, 18:09

How do I change the default Mario colors?

alesan99
User avatar
Posts: 1663
Joined: 30 May 2013, 21:42
Reputation: 302
Contact:

Post » 05 Oct 2013, 18:15

Mari0Maker wrote:How do I change the default Mario colors?

Main.lua Line 1103

Code: Select all

   mariocolors[1] = {{224,  32,   0}, {136, 112,   0}, {252, 152,  56}}
   mariocolors[2] = {{255, 255, 255}, {  0, 160,   0}, {252, 152,  56}}
   mariocolors[3] = {{  0,   0,   0}, {200,  76,  12}, {252, 188, 176}}
   mariocolors[4] = {{ 32,  56, 236}, {  0, 128, 136}, {252, 152,  56}}

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

Post » 05 Oct 2013, 18:28

alesan99 wrote:
Mari0Maker wrote:How do I change the default Mario colors?

Main.lua Line 1103

Code: Select all

   mariocolors[1] = {{224,  32,   0}, {136, 112,   0}, {252, 152,  56}}
   mariocolors[2] = {{255, 255, 255}, {  0, 160,   0}, {252, 152,  56}}
   mariocolors[3] = {{  0,   0,   0}, {200,  76,  12}, {252, 188, 176}}
   mariocolors[4] = {{ 32,  56, 236}, {  0, 128, 136}, {252, 152,  56}}

Thanks!

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

Post » 25 Oct 2013, 04:55

Is it possible to change the default colors of the Portal colors? Like for example, set Player 1's portals to Blue and Green, Player 2's to Orange and Yellow, etc.

Automatik
User avatar
Posts: 1076
Joined: 20 Jul 2012, 17:54
Reputation: 8
Contact:

Post » 25 Oct 2013, 10:01

Yes it's possible:
Go to about Line 1099 in main.lua
You have this:

Code: Select all

   -------------------
   -- PORTAL COLORS --
   -------------------
   
   portalhues = {}
   portalcolor = {}
   for i = 1, 4 do
      local players = 4
      portalhues[i] = {(i-1)*(1/players), (i-1)*(1/players)+0.5/players}
      portalcolor[i] = {getrainbowcolor(portalhues[i][1]), getrainbowcolor(portalhues[i][2])}
   end

You have to modify the assignment of portalhues[i], given that it must be a value between 0 and 1 and:
0: red
0.125: orange
0.175: orange
0.25: light green
0.375: green
0.5: cyan
0.675: blue
0.75: purple
0.875: pink
(You can try in-between value, these are just examples)
So for example:

Code: Select all

   -------------------
   -- PORTAL COLORS --
   -------------------
   
   portalhues = {}
   portalcolor = {}
   for i = 1, 4 do
      local players = 4
      portalhues[i] = {(i-1)*(1/players), (i-1)*(1/players)+0.5/players}
      if i==1 then portalhues[i]={0.675,0.375} end -- Player 1 blue & green
      if i==2 then portalhues[i]={0.125,0.175} end -- Player 2 orange & yellow
      portalcolor[i] = {getrainbowcolor(portalhues[i][1]), getrainbowcolor(portalhues[i][2])}
   end

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

Post » 27 Oct 2013, 21:22

Thank you, Auto!

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

Post » 03 Nov 2013, 02:36

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.

BobTheLawyer
User avatar
Posts: 2240
Joined: 01 May 2012, 21:00
Reputation: 55

Post » 03 Nov 2013, 15:30

Mari0Maker, I'd make it into two music clips. Where the intro would start repeating, instead, go to the new clip, which then repeats.
I can't give you the code atm.
Are you looking at Bowser's Castle? We might be looking at the same music.

HugoBDesigner
User avatar
Posts: 2121
Joined: 19 Sep 2012, 02:23
Reputation: 673
Contact:

Post » 03 Nov 2013, 20:48

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 :)

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

Post » 03 Nov 2013, 21:30

I'm glad that question was asked, I might need it, too


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests

cron