Page 1 of 1

Weapon and changing its state from DoEffect

PostPosted: Thu Jan 13, 2022 7:18 am
by Kzer-Za
Is it possible to change a weapon state from DoEffect? I have a weapon that has a countdown function, so I wanted to decrement a variable in DoEffect and when it reaches 0, change the weapon state, but neither SetStateLabel, nor ResolveState have any effect.

Re: Weapon and changing its state from DoEffect

PostPosted: Thu Jan 13, 2022 11:44 am
by Jarewill
Use Player.SetPSprite for that:
Code: Select allExpand view
owner.Player.SetPSprite(PSP_WEAPON,FindState("State")); 

This code will set the weapon's owner (the player) current HUD state to the state found with FindState.
This was taken straight from the DoEffect override in my mod, so it should work.

Re: Weapon and changing its state from DoEffect

PostPosted: Thu Jan 13, 2022 12:46 pm
by Kzer-Za
Thanks!