Load example, type in console give boom_stick, choose it at number one, shot several times, release fire button, weapon disappear without any message.
Comment line 25 to prevent this to happening.
Weapon destroys after trying of change state duration
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Weapon destroys after trying of change state duration
- Attachments
-
- set tick bug.wad
- (718 Bytes) Downloaded 28 times
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Weapon destroys after trying of change state duration
You are setting the duration of the item itself, not the HUD sprite!
As long as an inventory item is owned it is displaying the 'held' state which has infinite duration. This state still gets ticked, though, and if its duration expires without a follow-up state the item will vanish.
As long as an inventory item is owned it is displaying the 'held' state which has infinite duration. This state still gets ticked, though, and if its duration expires without a follow-up state the item will vanish.
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: Weapon destroys after trying of change state duration
Is this intentional behavior, or more just an aftereffect that might get unintentionally changed later on?Graf Zahl wrote:As long as an inventory item is owned it is displaying the 'held' state which has infinite duration. This state still gets ticked, though, and if its duration expires without a follow-up state the item will vanish.
Could be a simple way to do time-limited weapons or such if it is reliable, which is an interesting thought.
Re: Weapon destroys after trying of change state duration
The problem is, it leaves the player with a null weapon, which historically hasn't always proven stable in the game. But maybe I am wrong - maybe it's intentional to allow that.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Weapon destroys after trying of change state duration
The main issue here is that what he did qualifies as 'Don't do that'. There are legitimate reasons to allow owned weapons to run through their normal states, but mucking around with their duration is something the code cannot deal with.
I far more suspect a case of user error here, i.e. he wanted to alter the PSprite's duration - and for that it was just dead wrong.
I far more suspect a case of user error here, i.e. he wanted to alter the PSprite's duration - and for that it was just dead wrong.