Aller au contenu

Photo

Question about creatures perception and event*disappear


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Phaenan

Phaenan
  • Members
  • 315 messages
Hey folks.


I'm currently trying to tailor myself a creature core tweaking the ambient system to my fancy, and I ran into something. I wanted to use EVENT_TYPE_PERCEPTION_APPEAR and EVENT_TYPE_PERCEPTION_DISAPPEAR to make a few on the fly adjustments.
Long story short, the PERCEPTION_DISAPPEAR event doesn't seem to trigger - ever - by itself. Not while the perceived creature is still alive, at least.
To illustrate if need be, here the core script handling the events :
- http://pastie.org/825615
Don't mind the AMBIENT_CONTINUE block, it's just a workaround for the lack of automatic PERCEPTION_DISAPPEAR event.
And here a log example of what happened before the workaround. Imagine the main character running around the NPC, going in and out the range several times during the log.
- http://pastie.org/825631
Note that the PERCEPTION_APPEAR sometimes triggers (but not always, FloatyMessage proving it) depending on the current ambient system state. Whether the NPC is roaming, in a looping animation, etc.


Am I missing something, or does a perceived creature remains in the perceiver list until death makes them part, literally ? And more importantly, does the PERCEPTION_DISAPPEAR just never triggers by itself ? Or am I missing the obvious one more time ?  :huh:

Modifié par Phaenan, 15 février 2010 - 04:09 .


#2
Magic

Magic
  • Members
  • 187 messages
Sorry, I simply can't confirm. The EVENT_TYPE_PERCEPTION_DISAPPEAR (26) fires. I would have been very surprised if it does not and just tested it. The event not showing in your log is interesting though! Maybe to begin with the obvious, did you redirect it? ^^ Is the script the first event script for events to enter?

Edit: More testing - more questions. What is the perception range of the creature? Could you add the event creator to the log? I found that the disappear range is about twice the appear range so "maybe" the PC didn't walk far away enough while other NPCs moved closer?

Modifié par Magic, 15 février 2010 - 06:38 .


#3
Phaenan

Phaenan
  • Members
  • 315 messages
True, forgot to say no event is redirected behind me back since I hardly use addons myself. Just to be on the safe side, I just confirmed it with GetM2DAString(TABLE_EVENTS, "Script", 26) and apparently there is not related engineevents override stepping on my toes. So the custom creature core should be the first script to get its hands on any event send to that specific NPC. :o


Edit: More testing - more questions. What is the perception range of
the creature?


PercepRngShrt, roughly 7.0f according to my tests. But I pretty much tried to get as far as the map would allow me, without any luck. Damn that NPC elven sight ! :blush:

Modifié par Phaenan, 15 février 2010 - 06:41 .


#4
Magic

Magic
  • Members
  • 187 messages
Well, interesting: The disappear event fires at the same distance for short and medium, about 60.0f. That's about the width of the camp btw. :) No more ideas at the moment.

Modifié par Magic, 15 février 2010 - 07:04 .


#5
Phaenan

Phaenan
  • Members
  • 315 messages
That'd explain why it didn't fire by itself.

Good, then ! My workaround does the trick just fine anyway, I just wanted to be sure I wasn't going the long way because of some stupid oversight. ^_^"