Jump to content

Photo

Default event script


  • Please log in to reply
3 replies to this topic

#1
dainbramage

dainbramage
  • Members
  • 469 posts

Hey guys,

 

Is it possible to determine anywhere the default script that will be used when an event fires? AKA what script will be used if I run HandleEvent(ev) ?

 

In my specific case, I'm overriding EVENT_TYPE_DAMAGED. There's something I'm not catching when isabela fights the thugs (they fight forever, rather than them running off - they also don't use the surrender check other mobs do)... I'd like to either be able to add that exception manually, or just use the default handler if it's not creature_core or player_core.



#2
Sunjammer

Sunjammer
  • Members
  • 925 posts

Unhandled events or partially handled events (i.e. anything that doesn't set bEventHandled to TRUE) from creature_core and player_core drop through into rules_core.


  • MerAnne likes this

#3
Tchos

Tchos
  • Members
  • 5,026 posts

I'm shooting blind here, but based on what you say, that you're trying to make something happen when those mobs are damaged, plus they fight forever, I'm thinking perhaps they have some immortality or plot-related flag set on them, which causes them not to take damage, and thus the event never fires.  My experience in scripting DA:O is minimal, but augmented by its similarity to the NWN2 scripting, so some of what I say here may not be relevant.



#4
dainbramage

dainbramage
  • Members
  • 469 posts

Sorry, I meant above that level, the creature script itself. The toolset wiki notes that you should be able to get it programmatically from the target's Script property, but running GetLocalResource(GetEventTarget(ev), "Script") isn't returning me a valid result.

 

I can base it on tags instead, but that's kind of irritating as often there'll be 3-5 creatures sharing the same script.

 

EDIT: Posted without refreshing, so I missed Tchos' post. I figured out (shorty after making the original post above) what I needed to do in that specific case (thugs have a plot flag fire on event_type_damaged before it moves to creature_core), but I haven't been able to get the name of the event script in code. If possible I'd rather check against one script here than 3 tags in the thugs case, or 5 tags for the sloth demon, etc.