Author Topic: My OnDeath scipt is only firing once?  (Read 355 times)

Legacy_Mr. Versipellis

  • Full Member
  • ***
  • Posts: 236
  • Karma: +0/-0
My OnDeath scipt is only firing once?
« on: August 20, 2012, 03:57:56 pm »


                I made a thread about this about a month ago but it died off. I've got an OnDeath script here which should resurrect an npc tagged "Erno", who is the owner of the script, and then add him back to the party. This seems to work fine, but only for the first death - the second time he dies, his corpse just sits there, not doing an awful lot. Does anyone know what could be causing this?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
My OnDeath scipt is only firing once?
« Reply #1 on: August 20, 2012, 08:45:53 pm »


               Just skimming thru the code... the part that reads:

//Double-hit thing to stop the body from getting destroyed or anything
 if (GetDidDie()) return;
 else SetDidDie();


looks like it might be the culprit - do these functions 'unset' the data when done using it or do they leave the flag set and thus trip on second pass through?

Be well. Game on.
GM_ODA
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
My OnDeath scipt is only firing once?
« Reply #2 on: August 20, 2012, 10:34:18 pm »


               

ehye_khandee wrote...

Just skimming thru the code... the part that reads:

//Double-hit thing to stop the body from getting destroyed or anything
if (GetDidDie()) return;
else SetDidDie();


looks like it might be the culprit - do these functions 'unset' the data when done using it or do they leave the flag set and thus trip on second pass through?

Be well. Game on.
GM_ODA



It looks like it was removed,  Most likely the problem.   

http://social.biowar...942323#13023659 
               
               

               
            

Legacy_Mr. Versipellis

  • Full Member
  • ***
  • Posts: 236
  • Karma: +0/-0
My OnDeath scipt is only firing once?
« Reply #3 on: August 21, 2012, 03:11:57 am »


               That did the trick. Thanks!