Page 1 of 1

I'm having trouble with a costume

Posted: Thu Mar 31, 2022 11:21 am
by Mal8rk
Hello everyone

See, I made a level with the character starting as Klonoa's Yoshi costume, but whenever I grab an enemy, this happens:

Image

Could anyone help me with this?

Re: I'm having trouble with a costume

Posted: Thu Mar 31, 2022 4:52 pm
by deice
this bug seems to only be present if you call playermanager.setCostume() before you change the player's character to klonoa. performing these two actions in reverse order seems not to cause it to happen, so just switch the order of operations around in your code and you should be good.

Re: I'm having trouble with a costume

Posted: Thu Mar 31, 2022 8:03 pm
by Mal8rk
deice wrote:
Thu Mar 31, 2022 4:52 pm
this bug seems to only be present if you call playermanager.setCostume() before you change the player's character to klonoa. performing these two actions in reverse order seems not to cause it to happen, so just switch the order of operations around in your code and you should be good.
So let me get this straight, I have to reverse the order of the code like this?:

Code: Select all

local klonoa = API.load("characters/klonoa")

function onStart()
	player.character = CHARACTER_KLONOA;
end

Player.setCostume(CHARACTER_KLONOA, "SMW2-Yoshi")
Is this correct or is there something wrong?

Re: I'm having trouble with a costume

Posted: Thu Mar 31, 2022 8:14 pm
by Hoeloe
Move the call to setCostume inside onStart.