Page 42 of 42

Posted: Mon Jun 13, 2005 2:20 am
by Graf Zahl
I'll take a look. It worked when I tested the code after writing it.

Posted: Sun Nov 27, 2005 4:15 pm
by DoomRater
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:

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
	}
}
and the item will stay.
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.

By the way cool inventory item concept.

Posted: Mon Nov 28, 2005 5:13 am
by TheDarkArchon
From experience, it cancels.