Page 1 of 1
Get TID of picked-up inventory item?
Posted: Fri Feb 13, 2015 3:49 am
by AlexMax
Is it possible to get the tid of an item being picked up from an ACS script called from DECORATE? Seems like the obvious way to do this is ACS_Execute(0, tid) through a DECORATE expression in the Pickup: state of a CustomInventory, but that always seems to return 0 for me. ActivatorTID() returns 0 as well, so I presume that it considers the player the "activator" of the script.
Am I just doing it wrong, or is this not implemented in Zandronum?
RE: Get TID of picked-up inventory item?
Posted: Fri Feb 13, 2015 10:12 am
by Ivan
That was a problem I had faced a long time ago while trying to port RoTT TC. It will always return 0 because the inventory is assumed to be gone at that point and the player is the one who activates that script, or that's what I remember. AFAIK there's no way of knowing it.
RE: Get TID of picked-up inventory item?
Posted: Fri Feb 13, 2015 4:27 pm
by CloudFlash
You could have a 'tid announcer' actor hidden under the 'pickup' actor, one that would activate the script when player steps close enough to the 'pickup' actor to pick it up. Instead of the cheeseburger calling the script, you make the plate call the script.[/size]
RE: Get TID of picked-up inventory item?
Posted: Fri Feb 13, 2015 8:25 pm
by Ænima
CloudFlash wrote:
You could have a 'tid announcer' actor hidden under the 'pickup' actor, one that would activate the script when player steps close enough to the 'pickup' actor to pick it up. Instead of the cheeseburger calling the script, you make the plate call the script.[/size]
And then maybe make the "plate" give an amount of checker inventory items based on the TID? (Assuming you can plug in TID for A_GiveInventory's "amount" field.) So like you get 1,342 of the inventory item named "TIDCounter" if the TID was 1342.
Again that's assuming that you can even pass TID to that argument.
RE: Get TID of picked-up inventory item?
Posted: Sat Feb 14, 2015 5:42 am
by ZzZombo
You simply can't, unless you are a hacker.
Spoiler: For not hackers (Open)Code: Select all
actor Item:CustomInventory
{
<your code>
States
{
Held:
TNT1 A -1 ACS_ExecuteWithResult(<script number>,TID)
stop
}
}