Jump to content

Home

How to turn all NPC's hostile


DarthRevan243

Recommended Posts

Okay, I'm making a mod but I've encountered a problem:

 

I want to give the option for the PC to either kill all the republic soldiers or help them. I don't know what script to run to make the NPC's turn hostile. Here are their utc's if it helps:

 

12.utc

 

asddd

 

ddd

 

g_turret

 

n_repoffjmb

 

n_repsoldjmb

 

n_repsoldjmb1

 

n_repoffsd

 

n_repoff33

 

n_repsold32

 

I need to make then ALL hostile after you declare war with the Captain.

 

How do I do this? Please tell me if you know!

 

-DarthRevan243

Link to comment
Share on other sites

You need to create a script, call it "Makeevil" or something and then make the script that Glovemaster just gave you. Where it says tag you go into KotOR tool and look at the utc's of the characters that you just outlined. There you should find the tags of the characters. Tag is usually the same as the ResRef.

 

Then you just attach the script (after compiling it into a ncs) to the dialog that you created. Place it on the dialog node, "You're going to die, Captain." or, better yet, the captain's response that ends the dialog.

 

Once the dialog goes, the script should fire and the characters should all become hostile.

 

 

PostScript: Using the DLG editor and K1 doesn't affect the process that Glovemaster outlined.

Link to comment
Share on other sites

The tag's and ResRef's of creatures, items etc are different things - here's a shot

 

tag.jpg

 

In this script, replace npc_tag with the tags of your NPC's, compile it and attach it to a dialog node.

void main() {

	// This tells the script who to affect

object oNPC0 = GetObjectByTag("npc_tag");
object oNPC1 = GetObjectByTag("npc_tag");
object oNPC2 = GetObjectByTag("npc_tag");
object oNPC3 = GetObjectByTag("npc_tag");
object oNPC4 = GetObjectByTag("npc_tag");
object oNPC5 = GetObjectByTag("npc_tag");
object oNPC6 = GetObjectByTag("npc_tag");
object oNPC7 = GetObjectByTag("npc_tag");
object oNPC8 = GetObjectByTag("npc_tag");
object oNPC9 = GetObjectByTag("npc_tag");
object oNPC10 = GetObjectByTag("npc_tag");


	// This changes the NPCs to a hostile faction

ChangeToStandardFaction(oNPC0, 3);
ChangeToStandardFaction(oNPC1, 3);
ChangeToStandardFaction(oNPC2, 3);
ChangeToStandardFaction(oNPC3, 3);
ChangeToStandardFaction(oNPC4, 3);
ChangeToStandardFaction(oNPC5, 3);
ChangeToStandardFaction(oNPC6, 3);
ChangeToStandardFaction(oNPC7, 3);
ChangeToStandardFaction(oNPC8, 3);
ChangeToStandardFaction(oNPC9, 3);
ChangeToStandardFaction(oNPC10, 3);

}

--Stream

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...