generic individual alert function

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: generic individual alert function

Re: generic individual alert function

by MartinHowe » Tue May 12, 2020 3:17 pm

Well I have had to do a lot of looking through the source, both c++ and ZScript, while developing this actor, and a lot of it is still a mystery to me. I haven't worked on ZDoom since 2008 (morphing code) and even the bits that haven't been rewritten since then give me that "WTF?! Did I really write that?!" feeling :p

What I can say, experimentally, is that this is functionally equivalent to firing a pistol right next to the monster, so he gives his "Sight" sound, turns to attack, etc. Given time, and a moment of inspiration, something more elaborate could be forged.

Re: generic individual alert function

by Matt » Tue May 12, 2020 12:51 pm

Sweet, thanks! Does doing this play alert sounds and stuff as well?
(EDIT: yes it does!)

Doom's AI is such a total black box to me...
EDIT: This is a help

Re: generic individual alert function

by MartinHowe » Tue May 12, 2020 6:23 am

Hope necrobumping this one is OK if it gives a solution, as I was trying to do this myself and found a (partial) answer at least from within ZScript:

To make your monster's target target your monster in return:
self.target.LastHeard = self;

This works (I tried it). I have to go back to work soon so haven't got time to flesh it out, but this should get you started.

generic individual alert function

by Matt » Tue Sep 17, 2019 5:28 pm

I'm imagining something like

Code: Select all

bool Alert(actor alerted, actor target, actor alertsource=null, int flags=0);
with a return for whether the actor was successfully alerted.

Would be useful for stuff like this, or other interactions where only a single monster is being alerted to a specific thing (pickpocket, touch, very narrow line-of-sight check).

Flags might include:
- forcing an already alerted monster to switch targets
- don't play the alert sound
- allow an immediate attack(?)
- allow targeting of friendlies or same-team

Top