Weapon destroys after trying of change state duration

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Weapon destroys after trying of change state duration

Re: Weapon destroys after trying of change state duration

by Graf Zahl » Mon Feb 04, 2019 11:23 am

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.

Re: Weapon destroys after trying of change state duration

by Rachael » Mon Feb 04, 2019 11:08 am

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.

Re: Weapon destroys after trying of change state duration

by Arctangent » Mon Feb 04, 2019 11:04 am

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.
Is this intentional behavior, or more just an aftereffect that might get unintentionally changed later on?

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

by Graf Zahl » Mon Feb 04, 2019 6:16 am

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.

Weapon destroys after trying of change state duration

by Apeirogon » Mon Feb 04, 2019 6:07 am

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.
Attachments
set tick bug.wad
(718 Bytes) Downloaded 28 times

Top