[r4025] CustomInventory Behavior

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [r4025] CustomInventory Behavior

Re: [r4025] CustomInventory Behavior

by Graf Zahl » Wed Jan 16, 2013 11:40 am

No, if an item successfully executes the drop state it should not spawn. That'd make this state useless.

Re: [r4025] CustomInventory Behavior

by Fishytza » Wed Jan 16, 2013 7:57 am

Well, if this is intended behavior then by all means mark this as [Not a bug] and update the wiki. I have already found a solution similar to what you suggested, Blzut3, but thanks anyway.

Guess I don't have to feel bad about my 'hacky' solution being hacky, eh? EDIT: Nevermind.

Re: [r4025] CustomInventory Behavior

by Blzut3 » Wed Jan 16, 2013 7:11 am

I can't comment on what the actual intended behavior is supposed to be, but I don't see any reason why the Drop state should prevent the item from being spawned.

One thing to keep in mind is that all actors have a Spawn state [wiki=Classes:Actor]by default[/wiki]. You could try using 'Spawn: stop' or if necessary 'Spawn: TNT1 A 0 stop' to make the item disappear after being spawned.

[r4025] CustomInventory Behavior

by Fishytza » Mon Jan 14, 2013 5:55 pm

Today I've discovered something odd. According to the wiki:
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.
The part in italic is a lie. The item will be spawned in addition to running the 'Drop' state.
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"
}
Spawn 'TestImp', kill it and player1 (you) will get a shotgun and a megasphere, but the item will still spawn and you can even pick it up for another shotgun.

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?

Top