Is there a way to get someone's killer and assign it an inventory?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

Is there a way to get someone's killer and assign it an inventory?

#1

Post by FranckyFox2468 » Fri Dec 01, 2017 7:26 pm

Cause i was having the idea of having class specific voicelines when a character kills a specific monster or player class, but im not exactly sure if, in ACS or Decorate, there is a way to get someone's killer.

Usually zdoom's forums just go "Meh, just get the monster's target and give it an inventory" but the problem with this logic is that in zdoom, there is only one player to care about. In zandronum, the player that the monster will be engaging is not necessarily the one that will be killing it. And it does not exactly solve the problem on a PVP situation.

So basically i am wondering if there is a way to give a character's killer a certain inventory, including in pvp, that could make a certain character trigger a sound or something.

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

Re: Is there a way to get someone's killer and assign it an inventory?

#2

Post by Ivan » Fri Dec 01, 2017 8:15 pm

There are DEATH scripts for players. There are also KILL scripts for monsters. Monsters have to have "USEKILLSCRIPTS" flag on them for the script to run for them. You can do any kind of inventory check there.
=== 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
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

Re: Is there a way to get someone's killer and assign it an inventory?

#3

Post by FranckyFox2468 » Fri Dec 01, 2017 8:33 pm

Ivan wrote:
Fri Dec 01, 2017 8:15 pm
There are DEATH scripts for players. There are also KILL scripts for monsters. Monsters have to have "USEKILLSCRIPTS" flag on them for the script to run for them. You can do any kind of inventory check there.
Okay but how to you get who's the killer? Cause said script still appears to take in account their last target and not the killer, and thus does not solve the problem i have mentionned above.
Last edited by FranckyFox2468 on Fri Dec 01, 2017 8:38 pm, edited 1 time in total.

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

Re: Is there a way to get someone's killer and assign it an inventory?

#4

Post by Ivan » Fri Dec 01, 2017 8:38 pm

Uh, the target is the killer in both cases.
=== 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
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

Re: Is there a way to get someone's killer and assign it an inventory?

#5

Post by FranckyFox2468 » Fri Dec 01, 2017 8:39 pm

Ivan wrote:
Fri Dec 01, 2017 8:38 pm
Uh, the target is the killer in both cases.
Wait really? Cause i did some testing involving target-based trigger on death at somepoint and the item was given to the player it was last attacking/facing rather than the killer.
Are you sure there isn't something more to it?

EDIT:

Oh wait... SetActivatorToTarget... nevermind. Thanks for the help.

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

Re: Is there a way to get someone's killer and assign it an inventory?

#6

Post by Ivan » Fri Dec 01, 2017 8:59 pm

FranckyFox2468 wrote:
Fri Dec 01, 2017 8:39 pm
Ivan wrote:
Fri Dec 01, 2017 8:38 pm
Uh, the target is the killer in both cases.
Wait really? Cause i did some testing involving target-based trigger on death at somepoint and the item was given to the player it was last attacking/facing rather than the killer.
Are you sure there isn't something more to it?

EDIT:

Oh wait... SetActivatorToTarget... nevermind. Thanks for the help.
Yes, you can use that or GetActorProperty(0, APROP_TARGETTID), which should do the same thing if your actors have unique TIDs. I'd use the latter as the former can cause problems when you want to revert back to the activator and if you don't have unique TIDs distributed.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Post Reply