Posted: Mon Jun 13, 2005 2:20 am
I'll take a look. It worked when I tested the code after writing it.
To continue the Doom experience, play the Shores of Hell and its amazing sequel, Inferno!
https://forum.zdoom.org/
Sorry to bump the topic but I think I need clarification. You said the Fail state basically calls itself? Does that mean that when it hits the Fail State it just waits there until the condition is met? Or does it actually cancel? I'm guessing it exits the loop without removing the item, similar to stop.Graf Zahl wrote:I needed some handling for states which jump to themselves anyway so I just used that to signal failure. And to make it more intuitive I added 'FAIL' as a synonym for 'WAIT'.
Now you can do:
and the item will stay.Code: Select all
ACTOR MagicThingy : Inventory { +INVBAR Inventory.MaxAmount 1 states { Spawn: RKEY A 4 BKEY A 4 YKEY A 4 loop Use: RKEY A 1 A_JumpIfInventory("Mana1", 10, 2) RKEY A 1 A_PlaySound("*usefail") Fail RKEY A 1 A_TakeInventory("Mana1", 10) RKEY A 1 HealThing(5) Fail } }