A Christmas present for ZDoom

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

I'll take a look. It worked when I tested the code after writing it.
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Post 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.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

From experience, it cancels.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”