activator tid of 0 credited to player

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
skadoomer
Posts: 1026
Joined: Fri Sep 05, 2003 12:49 pm

activator tid of 0 credited to player

Post by skadoomer »

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.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: activator tid of 0 credited to player

Post by randi »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: activator tid of 0 credited to player

Post by Graf Zahl »

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
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: activator tid of 0 credited to player

Post by randi »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”