Page 1 of 1
Forcing A Costume Onto The Player At The Start
Posted: Mon May 11, 2020 8:49 am
by Alby
I'm making a game centered around Toadette as the main character. I wanted her to be able to use the swimming animation, so I'm using SpoonyBardOL's costume for her. What I want to know is if there's a way to start the player using the costume by default instead of having to use the Spade Block to cycle through them as Toad. Can anyone share if there's a way? :3
Re: Forcing A Costume Onto The Player At The Start
Posted: Mon May 11, 2020 8:59 am
by Emral
https://docs.google.com/document/d/1uOd ... a90y9ieh5u
In this code section right here is a setCostume function for the player. The name is the name of the folder in the costumes folder.
Of course if you never switch away from Toadette and don't wanna put it into the costume folder you can just overwrite the default toad sprites for your episode by placing the contents of the costume folder in your episode folder. If there's a costume.lua, you might wanna call its onInit, too.
Re: Forcing A Costume Onto The Player At The Start
Posted: Mon May 11, 2020 9:23 am
by Alby
Thank you so much, it worked perfectly! :3
Added in 4 hours 15 minutes 59 seconds:
Alby wrote: ↑Mon May 11, 2020 9:23 am
Thank you so much, it worked perfectly! :3
A correction. Since I opened the project back up, the game still forces the player into Toad first. Is there something I'm missing with the script?

Re: Forcing A Costume Onto The Player At The Start
Posted: Mon May 11, 2020 2:11 pm
by Emral
strings need to be in "quotation marks" to be recognized as such by the program
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 12:02 am
by Alby
I'm still just not... understanding, I guess? I've put it in quotation marks in every way I could, and it still starts me as Toad instead of Toadette. :/
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 12:51 am
by Emral
Is the costume in the data/costumes/toad folder? If it's in your episode folder, try one of my other suggestions, such as just dumping the contents of the costume into your episode folder.
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 7:06 am
by Alby
Yeah, I'm just gonna dump it into the episode folder. It does have a Costume.lua file, though. Could you tell me how I call on the onlnit?
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 7:22 am
by Emral
Alby wrote: ↑Tue May 12, 2020 7:06 am
Yeah, I'm just gonna dump it into the episode folder. It does have a Costume.lua file, though. Could you tell me how I call on the onlnit?
This post should answer what you're looking for. Make sure to use CHARACTER_TOAD instead of CHARACTER_MARIO, and you should be good to go!
viewtopic.php?p=371055#p371055
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 8:09 am
by Alby
Okay, so I followed the directions, I think? And I got this as a result... D:

Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 8:16 am
by Emral
If you used a program different to notepad for scripting it would show you the issue more clearly. -- in lua means a comment, so the line is not interpreted as code. Remove the -- before loading the costume file in the line above onStart.
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 8:26 am
by Alby
Yeah, I probably should get a different program... Now I'm getting this message, though. TT_TT

Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 8:38 am
by Emral
Alby wrote: ↑Tue May 12, 2020 8:26 am
Yeah, I probably should get a different program... Now I'm getting this message, though. TT_TT
This reads that it couldn't find a lua file called "Toadette"... You could either rename costume.lua to Toadette.lua, or return the line to what it said previously (requiring a file called "costume").
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 8:49 am
by Alby
Ooooooh... Dang, that was my bad. I'm sorry for all this. Everything seems to work fine now, except for this when I close the test window.

Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 9:09 am
by Emral
This means you have multiple onStarts. There can only be one. Merge them if you need both.
Re: Forcing A Costume Onto The Player At The Start
Posted: Tue May 12, 2020 9:12 am
by Alby
Okay! Everything is perfect now! Thank you so much for putting up with my constant questions. I really appreciate it.