Aller au contenu

Photo

Getting Companion Death Scripts to Work


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

#1
Darin

Darin
  • Members
  • 282 messages
 Havin an issue with companion death scripts...trying to use general scripts for all creatures, with a variable fro companions to mark them as such.

With this at the end of my death script, companions ofen are removed from party when killed:

string sScript; if(GetLocalInt(OBJECT_SELF,"nCompanion")==1) { sScript = "gb_comp_death"; ChangeFaction(OBJECT_SELF,GetFirstPC()); if(!GetIsObjectInParty(OBJECT_SELF)) AddToParty(OBJECT_SELF,GetFirstPC()); } else if(GetLocalInt(OBJECT_SELF,"nHenchmen")==1) { sScript = "gb_assoc_death"; ChangeFaction(OBJECT_SELF,GetFirstPC()); } else sScript = "nw_c2_default7"; ExecuteScript(sScript,OBJECT_SELF);


Not sure what's going on.

#2
Darin

Darin
  • Members
  • 282 messages
tried using the normal companion death script as only death script, still removes the companion from the party on death. Any ideas?

#3
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
Are you sure it is the death script that is doing it? Could there be another script such as a heartbeat script removing them?

#4
Morbane

Morbane
  • Members
  • 1 883 messages
it is caused by how they are spawned/added to the party - you have to use the proper method for them to remain after death

Modifié par Morbane, 20 septembre 2013 - 07:50 .


#5
Morbane

Morbane
  • Members
  • 1 883 messages

EpicFetus wrote...

 Havin an issue with companion death scripts...trying to use general scripts for all creatures, with a variable fro companions to mark them as such.

With this at the end of my death script, companions ofen are removed from party when killed:

string sScript; if(GetLocalInt(OBJECT_SELF,"nCompanion")==1) { sScript = "gb_comp_death"; ChangeFaction(OBJECT_SELF,GetFirstPC()); if(!GetIsObjectInParty(OBJECT_SELF)) AddToParty(OBJECT_SELF,GetFirstPC()); } else if(GetLocalInt(OBJECT_SELF,"nHenchmen")==1) { sScript = "gb_assoc_death"; ChangeFaction(OBJECT_SELF,GetFirstPC()); } else sScript = "nw_c2_default7"; ExecuteScript(sScript,OBJECT_SELF);


Not sure what's going on.

p.s.
nobody can read that code - edit it and fix it - then it will be readable.:sick:

#6
Darin

Darin
  • Members
  • 282 messages
By "proper method" does that mean ga_selectable is necessary? Wasn't using that, started to work after I did...though I changed some stuff around and have not extensivley tested it.

#7
Darin

Darin
  • Members
  • 282 messages
Okay, back with the same issue... now they all have gb_comp_death as their death script, no DeathScript variable set, and...only 1 will survive (last to die). wtf?

#8
andysks

andysks
  • Members
  • 1 654 messages
So you gave up on the system you wanted to use, and they still behave weirdly?
Which scripts are you using to add them to the party?

#9
Darin

Darin
  • Members
  • 282 messages
ga_roster_add_object
ga_roster_selectable (0)
ga_roster_party_add

#10
Darin

Darin
  • Members
  • 282 messages
okay, so this is weird....if you're controlling the npc and they die, they'll fall down and pop back up after the fight... if not, they die and are removed from the party. I think this is either the module scripts handling death and dying (using the ones from the OC) or one of the other scripts on the NPC.

#11
kevL

kevL
  • Members
  • 4 074 messages
this might have something to do with it.

but it's so complicated i forget exactly what i was on about......

Basically, there's a semi-hidden deathscript (defined in nwn2_scriptsets.2da) that gets called or not depending on whether or not you're controlling the last standing character. Or not...


/maybe