SetWeaponState

Moderator: GZDoom Developers

Post Reply
User avatar
Ral22
Posts: 531
Joined: Sun Sep 05, 2010 12:09 pm
Preferred Pronouns: He/Him
Location: The Fortress of Dr. Radiaki
Contact:

SetWeaponState

Post 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.
Last edited by Ral22 on Sun Jun 10, 2012 10:15 am, edited 2 times in total.
User avatar
ChronoSeth
Posts: 1631
Joined: Mon Jul 05, 2010 2:04 pm
Location: British Columbia

Re: SetWeaponState

Post 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.
User avatar
Ral22
Posts: 531
Joined: Sun Sep 05, 2010 12:09 pm
Preferred Pronouns: He/Him
Location: The Fortress of Dr. Radiaki
Contact:

Re: SetWeaponState

Post 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SetWeaponState

Post by Graf Zahl »

Sorry. but this can so easily screw up the player state that I wouldn't bother.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”