Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Everyone hostile script...

Page: 1 of 1
 Gorgod
11-23-2010, 9:06 PM
#1
I'm looking to create a modification that can make everyone hostile. However, I have no clue how to do this. I've found a "make hostile" script, but for me, it didn't work. I've created basic mods in the past, such as turning NPCs into merchants, but nothing to this extent. I think I could go into KOTOR Tool and change everyone's "faction" to hostile, but even if I could do that, it would take forever.


Is there a quick way to make a mod such as this?



Tutorials, and even better, pre-made mods are welcome.
 DarthStoney
11-23-2010, 9:31 PM
#2
There are a couple of ways to do this, if everyone in the room has individual "tags" this would be the way to do it
void main() {
object oMan1= GetObjectByTag("NPC1", 0);
object oMan2 = GetObjectByTag("NPC2", 0);
object oMan3 = GetObjectByTag("NPC3", 0);
ChangeToStandardFaction(oMan1, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oMan2, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oMan3, STANDARD_FACTION_HOSTILE_1);
}
or if more then one have the same "tag" you can do this
void main() {
int int1;
int int2 = 25;
int1 = 0;
while ((int1 <= int2)) {
{
object oThugCommon = GetObjectByTag("ThugCommon", int1);
object oThug1 = GetObjectByTag("Thug1", int1);
if (GetIsObjectValid(oThugCommon)) {
AssignCommand(oThugCommon, ClearAllActions());
ChangeToStandardFaction(oThugCommon, 1);
}
if (GetIsObjectValid(oThug1)) {
AssignCommand(oThug1, ClearAllActions());
ChangeToStandardFaction(oThug1, 1);
}
}
(int1++);
}
}
 Gorgod
11-23-2010, 9:59 PM
#3
There are a couple of ways to do this, if everyone in the room has individual "tags" this would be the way to do it
void main() {
object oMan1= GetObjectByTag("NPC1", 0);
object oMan2 = GetObjectByTag("NPC2", 0);
object oMan3 = GetObjectByTag("NPC3", 0);
ChangeToStandardFaction(oMan1, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oMan2, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oMan3, STANDARD_FACTION_HOSTILE_1);
}
or if more then one have the same "tag" you can do this
void main() {
int int1;
int int2 = 25;
int1 = 0;
while ((int1 <= int2)) {
{
object oThugCommon = GetObjectByTag("ThugCommon", int1);
object oThug1 = GetObjectByTag("Thug1", int1);
if (GetIsObjectValid(oThugCommon)) {
AssignCommand(oThugCommon, ClearAllActions());
ChangeToStandardFaction(oThugCommon, 1);
}
if (GetIsObjectValid(oThug1)) {
AssignCommand(oThug1, ClearAllActions());
ChangeToStandardFaction(oThug1, 1);
}
}
(int1++);
}
}

On the first code, would I have to make an "object oMan" for each individual NPC?
 DarthStoney
11-24-2010, 12:55 PM
#4
On the first code, would I have to make an "object oMan" for each individual NPC?

Yes, if each NPC has a different "tag" then you'll need to add a line for each one. Also the "oMan" can be any name you want.
Page: 1 of 1