Page 1 of 1

SetWeaponState

Posted: Sun Jun 10, 2012 10:04 am
by Ral22
SetWeaponState(who, str statename[, bool exact], interrupt);

- who: Set to 1 to affect all players, 0 for just the one who activated the special.
- interrupt: Decides whether to allow interrupting. Set to 1 to always interrupt the current state, no matter what state it is in. 0 will only change states if in a Ready state.

Forces player(s) weapons to enter a specified state, as defined in Decorate. The "exact" parameter is the same as SetActorState's "exact".

Helpful for creating dynamic effects with weapons, such as; level specific weapon effects, scripted first person scenes and gestures (Seen in games like Condemned and Battlefield 3), and easier set-up for returns from hitting an enemy. Example of how it is currently done: In Brutal Doom, the player hits an enemy, the enemy goes to a special pain state and give the player an item, the weapon checks if it has the item then A_Jumps the the correct state; I.e: fatalities and stealth kills in B.D. How it could be done: The player hits an enemy, the enemy goes to a special pain state which activates the script and sets the weapon state automatically.

Re: SetWeaponState

Posted: Sun Jun 10, 2012 10:12 am
by ChronoSeth
What would happen if the weapon is in the middle of a state sequence? Might be a good idea to add an argument which decides whether or not to interrupt the current sequence.

Re: SetWeaponState

Posted: Sun Jun 10, 2012 10:15 am
by Ral22
ChronoSeth wrote:What would happen if the weapon is in the middle of a state sequence? Might be a good idea to add an argument which decides whether or not to interrupt the current sequence.
Good idea, Chrono Seth. Added.

Re: SetWeaponState

Posted: Sun Jun 10, 2012 11:41 am
by Graf Zahl
Sorry. but this can so easily screw up the player state that I wouldn't bother.