Page 36 of 42
Posted: Mon May 23, 2005 5:06 pm
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?
Posted: Mon May 23, 2005 5:30 pm
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
}
}
Posted: Mon May 23, 2005 5:44 pm
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?
Posted: Mon May 23, 2005 5:54 pm
by Graf Zahl
No. You'd have to recompile it again. I could do that but I simply can't host the file anywhere.
Posted: Tue May 24, 2005 2:43 am
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)!
Posted: Tue May 24, 2005 7:30 am
by David Ferstat
I'll happily mirror it, also.
Posted: Tue May 24, 2005 8:37 am
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.
Posted: Tue May 24, 2005 9:14 am
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.
Posted: Tue May 24, 2005 11:35 am
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.
Posted: Tue May 24, 2005 12:11 pm
by Grubber
If you still haven't got it compiled, grab it
here.
Posted: Tue May 24, 2005 12:18 pm
by Graf Zahl
Thanks. Although I'll still add the feature mentioned above.
Posted: Tue May 24, 2005 12:47 pm
by Grubber
You're welcome

. Of course add the feature, I'll compile it again.
Posted: Wed May 25, 2005 9:19 pm
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
}
}
Posted: Thu May 26, 2005 2:52 am
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.
Posted: Thu May 26, 2005 11:16 pm
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?