[ZScript] [ACS] Play dialogue when monster killed

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Laskow
Posts: 100
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him

[ZScript] [ACS] Play dialogue when monster killed

Post by Laskow »

Like Duke Nukem, Caleb and Lo Wang, I'd like to make the player taunts when he kills monsters by the specified damage type.

There are no warnings or errors, but it doesn't work.

I've found a few topics similar to my topic here. Well, they use DECORATE. That is not a bad method though, it takes time to set it to each monster.
Does anyone know why?


Thanks in advance!
Last edited by Laskow on Fri Dec 13, 2024 5:54 am, edited 1 time in total.
Laskow
Posts: 100
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him

Re: [ZScript] [ACS] Play dialogue when monster killed

Post by Laskow »

2021-10-09 15.36.11 zdoom.org bdef1d01077b.png
Oh gosh, that was my misunderstanding...

Is it impossible to check damage types when an actor dies by using Zscript?
User avatar
Virathas
Posts: 254
Joined: Thu Aug 10, 2017 9:38 am

Re: [ZScript] [ACS] Play dialogue when monster killed

Post by Virathas »

You can alwyas do something "tricky" - use WorldThingDamged, and simply check if monster that was damaged has 0 or less health. Just remember to have plenty of failsafe's, that the one doing the damage must be a player.
Laskow
Posts: 100
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him

Re: [ZScript] [ACS] Play dialogue when monster killed

Post by Laskow »

Virathas wrote:You can alwyas do something "tricky" - use WorldThingDamged, and simply check if monster that was damaged has 0 or less health. Just remember to have plenty of failsafe's, that the one doing the damage must be a player.
Spoiler:
Finally it works!! Still having a problem with the ACS code though I took a step forward. Thanks!
User avatar
Virathas
Posts: 254
Joined: Thu Aug 10, 2017 9:38 am

Re: [ZScript] [ACS] Play dialogue when monster killed

Post by Virathas »

Do you really need ACS for this? Can't you play the audio directly from the KillDialogue inventory item? Since it is ZScript, you can add your own variables for delay between "speeches". The only thing that would (probably) not be as easy to do is have the logged messager in "specific" location, but a message could still be easily sent (like the ones when picking up items)

If ACS is something that you really want to use, make sure that:
1) the ACS is called
2) the script Activator is set properly (make sure that the player is the activator, and not item or world or none)
3) the random in the script is giving only integers

(I don't have time at the moment to debug it :P )
Post Reply

Return to “Scripting”