Page 1 of 1

Costume Help

Posted: Thu May 07, 2020 8:34 pm
by ANueUtsuho
This is my current luna.lua file after I copied and pasted the code from these SMW Mario & Luigi costumes viewtopic.php?f=31&t=25660


Image

However, when I tested it out, I got this error message:


Image

So, what'd I do wrong?

Re: Costume Help

Posted: Fri May 08, 2020 12:39 am
by Emral
Dont copy the code. I recall MrDoubleA's notes in the download said how to handle the costume when choosing not to import it into basegame:
require("costume")

If you did put it into the costumes folder in basegame, do this instead:
local playermanager = require("playermanager")
playermanager.setCostume(CHARACTER_MARIO, "literalnameofthecostumefolder")

As for the error message: that's a warning. Read the bit in red. You have two onStarts in your file, which is invalid.

Apologies if I got any code wrong here, difficult to double check on mobile.

Re: Costume Help

Posted: Fri May 08, 2020 2:10 am
by ANueUtsuho
Enjl wrote:
Fri May 08, 2020 12:39 am
Dont copy the code. I recall MrDoubleA's notes in the download said how to handle the costume when choosing not to import it into basegame:
require("costume")

If you did put it into the costumes folder in basegame, do this instead:
local playermanager = require("playermanager")
playermanager.setCostume(CHARACTER_MARIO, "literalnameofthecostumefolder")

As for the error message: that's a warning. Read the bit in red. You have two onStarts in your file, which is invalid.

Apologies if I got any code wrong here, difficult to double check on mobile.
Thanks, I fixed it by removing the duplicate function onStart.

Re: Costume Help

Posted: Fri May 08, 2020 2:16 am
by Emral
Okay. Now that I'm no longer on mobile I'll quickly link the handbook section that talks about how costumes should be set (for posterity):
https://docs.google.com/document/d/1uOd ... a90y9ieh5u
Player.setCostume, right here. I forgot that this shorthand existed in my previous post.
And the section from MrDoubleA's notes file:
Image