Fallen Guardian Posted January 9, 2011 Share Posted January 9, 2011 So my first script I need is for two NPCs to die on the death of another NPC. I found a script and it works fine except it only kills off one of the NPCs. Here is the script. void main() { object oNPC=GetObjectByTag("n_merc01"); object oNPC2=GetObjectByTag("n_merc02"); AssignCommand(oNPC,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), GetObjectByTag("n_merc01"))); object oNPC=GetObjectByTag("n_merc01"); AssignCommand(oNPC2,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), GetObjectByTag("n_merc02"))); ActionStartConversation(GetFirstPC(),"n_ethan"); } Second question. I want an NPC to fire on another NPC. I gpt tje script and put it in the right spot in the dialogue file but it just skips the script. Here is the script. void main() { object oTrask=GetObjectByTag("n_ethan"); object oDroid=GetObjectByTag("n_merc02"); SetMinOneHP(oDroid,FALSE); AssignCommand(oTrask,ClearAllActions()); CancelCombat(oTrask); ChangeToStandardFaction(GetObjectByTag ("n_merc02"), 12); ChangeToStandardFaction(GetObjectByTag ("n_ethan"), 11); AssignCommand(oTrask, GN_DetermineCombatRound()); AssignCommand(oDroid, GN_DetermineCombatRound()); ActionResumeConversation(); } Can anyone help? Link to comment Share on other sites More sharing options...
TimBob12 Posted January 9, 2011 Share Posted January 9, 2011 first question is it for K1 or K2 cos I am on a different computer but I can access files on my otherone so I know which copy of nwnscript.nss to pull off. EDIT: Why are you using GetObjectByTag each time? This would be clearer void main() { //NPCs object oNPC=GetObjectByTag("n_merc01"); object oNPC2=GetObjectByTag("n_merc02"); //Actions AssignCommand(oNPC,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oNPC)); AssignCommand(oNPC2,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oNPC2)); ActionStartConversation(GetFirstPC(),"n_ethan"); } Also you had spaces in between the T and the Y of TYPE See if that works. I just cleared it up a little. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted January 9, 2011 Share Posted January 9, 2011 Why are you using GetObjectByTag each time? beat me to it! This would be clearer void main() { //NPCs object oNPC=GetObjectByTag("n_merc01"); object oNPC2=GetObjectByTag("n_merc02"); //Actions AssignCommand(oNPC,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oNPC)); AssignCommand(oNPC2,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oNPC2)); ActionStartConversation(GetFirstPC(),"n_ethan"); } I like this. The other issue I saw in your code, Fallen Guardian, was that you set the value for oNPC twice... once is enough ( I am sure this was just a copy/paste error ) As for your second question, my only thought is the factions you changed those NPC's to... are those Gizka factions? The code looks fine, but you could accomplish this by having Trask "pretend" to shoot the droid, by ActionPlayAnimation(xxxx), whatever animation shooting is... You would need to apply an animation to the target of the shot, oDroid I guess, but this could work. Link to comment Share on other sites More sharing options...
Fallen Guardian Posted January 9, 2011 Author Share Posted January 9, 2011 Thanks both of you. I actually got this out of the Brother hood of shadow source scripts. It's for kotor 1. For some reason the Conversation still won't start though. Link to comment Share on other sites More sharing options...
TimBob12 Posted January 9, 2011 Share Posted January 9, 2011 Do they both die now though. Make sure the conversation has the right filename Link to comment Share on other sites More sharing options...
TimBob12 Posted January 9, 2011 Share Posted January 9, 2011 Do they both die now though. Make sure the conversation has the right filename Edit sorry for the duble post my phone went onto sleep mode while posting. When i turned it on it posted aggain. If a mod could delete pleaase Link to comment Share on other sites More sharing options...
Fallen Guardian Posted January 9, 2011 Author Share Posted January 9, 2011 Yeah they both die. And it is the right file name. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.