The part in italic is a lie. The item will be spawned in addition to running the 'Drop' state.ZDoom wiki wrote:"Classes:CustomInventory" article
....
If the item is being dropped by a monster the Drop state sequence will be executed and the item will never be spawned. This is mostly there for special actions that can be taken by Strife conversation scripts. For regular monster death actions there are better and more flexible way to achieve the same.
Here's an example:
Code: Select all
Actor TestPickup : CustomInventory
{
Inventory.PickupMessage "Is this really supposed to happen?"
States
{
Drop:
TNT1 A 0 A_GiveInventory("Shotgun", 1, AAPTR_PLAYER1)
TNT1 A 0 A_GiveInventory("Megasphere", 1, AAPTR_PLAYER1)
Stop
Pickup:
TNT1 A 0 A_GiveInventory("Shotgun", 1)
Stop
Spawn:
SHOT A -1
Stop
}
}
Actor TestImp : DoomImp
{
DropItem "TestPickup"
}
Actor TestPickup2 : CustomInventory
{
States
{
Drop:
TNT1 A 0 A_GiveInventory("Shotgun", 1, AAPTR_PLAYER1)
TNT1 A 0 A_GiveInventory("Megasphere", 1, AAPTR_PLAYER1)
Stop
}
}
Actor TestImp2 : DoomImp
{
DropItem "TestPickup2"
}
Now spawn and kill 'TestImp2' then aim your crosshair around the dead imp (usually the legs), drop the console and type 'info'. It may take a couple of tries but eventually it will say that 'TestPickup2' is there. You can't pick it up.
You may be asking "Why the heck would you define a 'Spawn', 'Pickup' and/or a 'Use' state if you're using 'Drop' for some special effects and whatnot?". Well, I can't exactly justify why, but I have to ask why keep the actor around if it has 'Drop' defined but not the other states?