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.
SetWeaponState
Moderator: GZDoom Developers
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
SetWeaponState
Last edited by Ral22 on Sun Jun 10, 2012 10:15 am, edited 2 times in total.
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: SetWeaponState
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.
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
Re: SetWeaponState
Good idea, Chrono Seth. Added.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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: SetWeaponState
Sorry. but this can so easily screw up the player state that I wouldn't bother.