[Not a bug] activator tid of 0 credited to player

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

activator tid of 0 credited to player

Postby skadoomer » Sat Dec 15, 2007 1:44 pm

I have a script tagged to my monster (monster A) that activates on a monsters death that gives a token to its killer using the activatortid function. Within the monsters decorate (monster A that is), it checks for the same token in the players inventory to see if that token then exisits to give credit to them as the killer. It works, but not if the killer has a tid of 0. Even though i have changed the players tid, any monster that kills another with a tid of 0 gives this token to the player instead of the monsters killer (meaning any other monster that has killed that monster).

Shouldn't this give that token to the activator's inventory, even if their tid is 0? I've never fully understood how activatortid works with multiple monsters with the same tid (of 0 in this case), but this seems incorrect to me to reference the player.
skadoomer
 
Joined: 05 Sep 2003

Re: activator tid of 0 credited to player

Postby randi » Mon Dec 17, 2007 8:59 pm

A TID of 0 is generally used to specify some special behavior when passed to functions. In this case, when you pass a TID of 0 to GiveActorInventory or TakeActorInventory, it indicates that the action should apply to every player on the map (which may be more than one). You should modify your scripts to check for a TID of 0 and do nothing in that case.
User avatar
randi
Site Admin
 
Joined: 10 Jul 2003

Re: activator tid of 0 credited to player

Postby Graf Zahl » Tue Dec 18, 2007 2:25 am

randy wrote:You should modify your scripts to check for a TID of 0 and do nothing in that case.



... or call GiveInventory instead.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: activator tid of 0 credited to player

Postby randi » Tue Dec 18, 2007 5:02 pm

Yes, I don't know why I didn't think of that last night. GiveInventory, CheckInventory, and TakeInventory are all designed to work on the script activator and will work whether it has a unique TID or not.
User avatar
randi
Site Admin
 
Joined: 10 Jul 2003


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests