Costume Help

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
ANueUtsuho
Spiny
Spiny
Posts: 25
Joined: Sun May 04, 2014 1:13 am

Costume Help

Postby ANueUtsuho » Thu May 07, 2020 8:34 pm

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?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Costume Help

Postby Enjl » 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.

ANueUtsuho
Spiny
Spiny
Posts: 25
Joined: Sun May 04, 2014 1:13 am

Re: Costume Help

Postby ANueUtsuho » Fri May 08, 2020 2:10 am

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.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Costume Help

Postby Enjl » Fri May 08, 2020 2:16 am

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


Return to “LunaLua Help”

Who is online

Users browsing this forum: cato and 2 guests