I have no idea how to check which state the weapon is using. I want to check what state the weapon is using but I can't.
Is it possible?
How to check which state the weapon is using?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 419
- Joined: Fri Dec 22, 2017 1:53 am
- Graphics Processor: ATI/AMD (Modern GZDoom)
- Contact:
- m8f
-
- Posts: 1445
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
- Contact:
Re: How to check which state the weapon is using?
This is possible with ZScript.
First way (easy, but not all states) - through PlayerInfo.WeaponState:
Other states can be found here (or in gzdoom.pk3).
Second way: through Actor.InStateSequence method.
First way (easy, but not all states) - through PlayerInfo.WeaponState:
Code: Select all
bool isReady = (player.WeaponState & WF_WEAPONREADY)
|| (player.WeaponState & WF_WEAPONREADYALT);
Code: Select all
bool isDeselectable = player.WeaponState & WF_WEAPONSWITCHOK;
Second way: through Actor.InStateSequence method.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How to check which state the weapon is using?
Second way: Does not work for weapons. It checks the actor's states, i.e. the player.