A Christmas present for ZDoom

Moderator: GZDoom Developers

User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Post by The Ultimate DooMer »

Killo Zapit wrote:Yay! Although I have to say, I am surprised about the addition of a PickUp state. I thought you could just make items use themselves automatically on pickup anyway.
Does that mean we have custom inventory items (Hexen style) now Graf?
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 »

Yes. You can do anything you can do with code pointers or action specials.

Here's one completely useless test item:

Code: Select all

ACTOR TestItemX : Inventory
{
	Inventory.PickupMessage "Picked up some crap!"
	+INVBAR
	Inventory.Icon MEDIA0
	States
	{
	Spawn:
		MEDI A -1
		Stop
	
	Use:
		TNT1 A 0 A_JumpIfInventory("RedCard", 1, 3)
		TNT1 A 0 A_GiveInventory("InvulnerabilitySphere")
		TNT1 A 0 A_FireCustomMissile("Rocket", 0, 0)
		TNT1 A 0 A_GiveInventory("BlueArmor")
		Stop
	Pickup:
		TNT1 A 0 A_GiveInventory("Megasphere")
		TNT1 A 0 Door_Open(3, 150)
		TNT1 A 0 A_SelectWeapon("Fist")
		Stop
	}
}
User avatar
Daniel
Posts: 811
Joined: Sun Jul 04, 2004 3:21 pm
Contact:

Post by Daniel »

Graf Zahl wrote:Yes. You can do anything you can do with code pointers or action specials.


Is it available on the ZDoom version linked in ZDoom Wiki?
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 »

No. You'd have to recompile it again. I could do that but I simply can't host the file anywhere.
User avatar
deathz0r
Posts: 353
Joined: Tue Jul 15, 2003 4:09 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Land with them kangaroo
Contact:

Post by deathz0r »

Graf Zahl wrote:No. You'd have to recompile it again. I could do that but I simply can't host the file anywhere.
Email me (deathz0r at zdaemon.org) and I'll host it in no time (from when I read my email box)!
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Post by David Ferstat »

I'll happily mirror it, also.
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Post by DoomRater »

And then we can have some extreme items that- well, ideas were already presented around the board on that... So how about items that don't use themselves up in DECORATE inventory? I wanna make a CD player for example, and you use the CD's in your inventory to change the music.
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 »

DoomRater wrote:I wanna make a CD player for example, and you use the CD's in your inventory to change the music.

That shouldn't be a problem. The CD player would just be an item with no function. These can't be used and just stay in the inventory as inert items. For the CD's you'd probably need some ACS scripting to do it properly but it is doable.

But before I recompile the new version I'll re-add some code that has been submitted elsewhere and is already in the .97 code base. I think Thursday evening I can send it to those who want to host it. Sorry but tomorrow I won't have any time to do it.


EDIT:

I'll delay this until the weekend. I just tried playing around with Kaiser's dialog compiler for Strife and there is one thing I'd like to add to make it more useful: Special items that perform some actions when dropped by monsters. This is one of the features Strife uses and some DECORATE support for it might be nice.
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Post by DoomRater »

ACS scripting I figured would be necessary but then again that's not a problem as long as it's for a TC. And what would be better than a Maniac Mansion TC? (random idea for the day)

Oh, that extra feature is making me drool. I don't know quite what to do with it yet... but unlike DS's extra features, these are more likely to be used.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

If you still haven't got it compiled, grab it here.
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 »

Thanks. Although I'll still add the feature mentioned above.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

You're welcome ;). Of course add the feature, I'll compile it again.
User avatar
Killo Zapit
Posts: 292
Joined: Wed Jul 16, 2003 9:26 pm
Location: Most likely sleeping.

Post by Killo Zapit »

Graf Zahl wrote:
DoomRater wrote:I wanna make a CD player for example, and you use the CD's in your inventory to change the music.

That shouldn't be a problem. The CD player would just be an item with no function. These can't be used and just stay in the inventory as inert items. For the CD's you'd probably need some ACS scripting to do it properly but it is doable.
I think what he wants is an inventory item that can be used but dosn't go away. The only way I know of to do that is like this:

Code: Select all

ACTOR MagicThingy : Inventory
{
+INVBAR
Inventory.MaxAmount 2
states
	{
	Spawn:
		RKEY A 4
		BKEY A 4
		YKEY A 4
		loop
	Use:
		RKEY A 1 A_GiveInventory("MagicThingy")
		RKEY A 1 A_JumpIfInventory("Mana1", 10, 2)
		RKEY A 1 A_PlaySound("*usefail")
		Stop
		RKEY A 1 A_TakeInventory("Mana1", 10)
		RKEY A 1 HealThing(5)
		Stop
	}
}
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 »

Yes, that would be a simple solution but there is one problem with it. The GiveInventory call will fail when the user has the maximum amount of items of this kind. I think I need to add a mechanism to notify failure. The simplest thing would be a 'Fail' instead of 'Stop' at the end of the state sequence.


EDIT: done

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.
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

Graf Zahl wrote:Yes. You can do anything you can do with code pointers or action specials.

Here's one completely useless test item:

Code: Select all

ACTOR TestItemX : Inventory
{
	Inventory.PickupMessage "Picked up some crap!"
	+INVBAR
	Inventory.Icon MEDIA0
	States
	{
	Spawn:
		MEDI A -1
		Stop
	
	Use:
		TNT1 A 0 A_JumpIfInventory("RedCard", 1, 3)
		TNT1 A 0 A_GiveInventory("InvulnerabilitySphere")
		TNT1 A 0 A_FireCustomMissile("Rocket", 0, 0)
		TNT1 A 0 A_GiveInventory("BlueArmor")
		Stop
	Pickup:
		TNT1 A 0 A_GiveInventory("Megasphere")
		TNT1 A 0 Door_Open(3, 150)
		TNT1 A 0 A_SelectWeapon("Fist")
		Stop
	}
}
But this wouldn't give the player those items, and instead would give them to the TestItemX, right? Is there a way to make it give the item to the player?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”