Author Topic: PC OnDamaged - is that possible?  (Read 762 times)

Legacy_Alaster Wolf

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #15 on: March 22, 2013, 08:19:09 am »


               

ffbj wrote...
I did a little fatigue demo since it was mentioned above, I thought I would post that too.
 http://nwvault.ign.c....Detail&id=3730


Wow, really cool demo! I have not run it yet but the description of it is exactly what I was doing in my script. It will really come useful! Thanks ffbj!
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #16 on: March 22, 2013, 10:59:20 am »


               All PCs run the same script for their events - its called "default" - and if you open some of the character bics you'll see it listed. You can use this script to run specific effects/routines on the PC whenever an event is fired for a particular PC. OldMansBeard has some excellent use of this method in his OHS System.

What's nice about using the "default" script is that it doesn't rely upon a heartbeat that has to check every single PC each time it fires, it fires only for a PC whenever the need arises. Therefore you could link an effect to the OnDamaged event in the "default" script and it will only fire for a PC whenever their OnDamaged event fires - no need for heartbeat checks.

I'll admit I might be a little off as its been several years since I've played with a "default" script so I'll defer to OMB and the OHS. Furthermore, I do recall something about not all events firing reliably but I can't remember which ones - OHS will have notes on this anyway.

Just for the record. The "default" script does not actually exist. It is a marker script placed into character bics so that PC behavior could be overridden by the Community. 
               
               

               


                     Modifié par Pstemarie, 22 mars 2013 - 11:09 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #17 on: March 22, 2013, 11:24:12 am »


               default script doesnt run for all events Pstemarie, merely a few and OnDamaged isnt among them

also due to my recent discovery, that traps created by scripts run default as heartbeat, I can't recommend using default script any further, unless you dont spawn traps (or you use NWNX to set PC's heartbeat as I do) pseudo-hb is better option
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #18 on: March 22, 2013, 11:36:24 am »


               Thanks Shadoow, I knew there was more with that default script but couldn't recall. Wondering though if just putting a flag to identify the caller as a PC would be enough to bypass traps. However, for this thread its moot since OnDamaged doesn't fire properly.
               
               

               


                     Modifié par Pstemarie, 22 mars 2013 - 11:36 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #19 on: March 22, 2013, 12:02:01 pm »


               

Pstemarie wrote...

Thanks Shadoow, I knew there was more with that default script but couldn't recall. Wondering though if just putting a flag to identify the caller as a PC would be enough to bypass traps. However, for this thread its moot since OnDamaged doesn't fire properly.

It is, but the problem is that the default script will still fire each 6seconds for each trap created by script.

As long as you care about efficiency pseudo-hb is better choice. If you aren't concerned about efficiency it doesn't matter of course.
               
               

               


                     Modifié par ShaDoOoW, 22 mars 2013 - 12:07 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #20 on: March 22, 2013, 12:08:04 pm »


               That makes sense - hadn't thought of it that way.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #21 on: March 22, 2013, 07:37:42 pm »


               I named a script "default" and the only time it ran was for the HeartBeat and Death events.  All other instances in the bic (including Rested, OnNotice, Endround, Attacked, Damaged, etc.) the script didn't fire for even though the bic listed default there.  Also it seems "default" is a patched implementation (likely 1.69) as older character files don't seem to have it listed even though they respect it.

Given module level support already deals with these events (module heartbeat can just loop through the PCs), it doesn't seem worthwhile to create a "default" script.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #22 on: March 22, 2013, 08:39:48 pm »


               True I just the default hb transversal for my fatigue script for instance it checks if the PC is in combat and then executes if that returns true.
In regard to traps, I have all traps designated by giving them the owners name on acquired. So wether by construction, purchase, or recovery it will have the aforesaid PC's name on it. Then you can get the last damager or last killer indirectly. So no anonymous trap killing in my campaign.
My rp justification for this is it is an imperial edict. Anyone who carries an unbranded trap is in violation, and you really don't want to annoy the empire.
               
               

               


                     Modifié par ffbj, 22 mars 2013 - 08:43 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #23 on: March 22, 2013, 08:56:55 pm »


               Good stuff to know Whizard. Like I said in my op I knew there were limitations, just didn't know what they were. My guess would be that at some point BioWare intended the default to do more, but they never got around to implementing it.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
PC OnDamaged - is that possible?
« Reply #24 on: March 27, 2013, 09:25:26 pm »


               I accidentally ran into a weird situation with the "default" script.  Whenever a negative mind-effect was removed (reverting the character back to GUI control) the script would fire.  This does not apply to the removal of other effects.  I have not found any useful implementation for this, especially since the removed effect cannot be obtained, and the script is shared with heartbeat and death.