Get TID of picked-up inventory item?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
AlexMax
Forum Regular
Posts: 244
Joined: Tue May 29, 2012 10:14 pm
Contact:

Get TID of picked-up inventory item?

#1

Post by AlexMax » Fri Feb 13, 2015 3:49 am

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?
Last edited by AlexMax on Fri Feb 13, 2015 3:51 am, edited 1 time in total.
The only limit to my freedom is the inevitable closure of the
universe, as inevitable as your own last breath. And yet,
there remains time to create, to create, and escape.

Escape will make me God.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Get TID of picked-up inventory item?

#2

Post by Ivan » Fri Feb 13, 2015 10:12 am

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.
Last edited by Ivan on Fri Feb 13, 2015 10:12 am, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: Get TID of picked-up inventory item?

#3

Post by CloudFlash » Fri Feb 13, 2015 4:27 pm

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]
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: Get TID of picked-up inventory item?

#4

Post by Ænima » Fri Feb 13, 2015 8:25 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

RE: Get TID of picked-up inventory item?

#5

Post by ZzZombo » Sat Feb 14, 2015 5:42 am

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
    }
}
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Post Reply