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.

NPCs Hostile after Dialouge Choice

Page: 1 of 1
 LDR
04-28-2010, 7:46 PM
#1
Story: In my prison ship mod, you speak to an iridonian prisoner that suggests a prison break...

Lets say I access a terminal called pri_cellterm and after a certain dialouge coice, the doors called pri_field open, and when they open, the pri_guard and pri_guardcap become hostile. Can someone make an example of how to make this script?
 newbiemodder
04-28-2010, 8:59 PM
#2
You could put this script on the OnOpen script line for your door:

void main() {
object oObject1 = GetObjectByTag("tag of guard capt");
object oObject2 = GetObjectByTag("tag of guard");
ChangeToStandardFaction(oObject1, 1);
ChangeToStandardFaction(oObject2,1);

}

That should work, I'm not the best script writer......
 LDR
04-28-2010, 9:00 PM
#3
Thank you!

Edit: And how do you make a script that makes a certain door open via a computer terminal dialouge choice?
 newbiemodder
04-28-2010, 9:33 PM
#4
script to open door I think is something like this:

void main() {

object oDoor = GetObjectByTag( "tag of your door");
ActionUnlockObject( oDoor );
ActionOpenDoor( oDoor );
}
 LDR
04-28-2010, 9:57 PM
#5
Thank you so very much. One last thing. If you betray the iridonian that suggested the prison break, you tell the Guard Captain what the iridonian tried to make you do. What script do I make to make the iridonian dissapear from the module permanently when i hit that dialouge option?
 newbiemodder
04-28-2010, 10:25 PM
#6
use the DestroyObject function, check this thread

http://www.lucasforums.com/showthread.php?t=201971&highlight=destroy+object)
 LDR
04-29-2010, 5:20 PM
#7
It doesn't work. Only one person called pri_guard turns hostile. What if it was a whole bunch of NPCs named pri_guard?
 Hope Estheim
04-29-2010, 5:53 PM
#8
void main() {
// make main NPC go hostile
object oNPC=GetObjectByTag("npc_tag");
ChangeToStandardFaction(oNPC, 1);

// and if there are any thugs to fight...
object oThug1 = GetObjectByTag("npc1_tag");
object oThug2 = GetObjectByTag("npc2_tag");
object oThug3 = GetObjectByTag("npc3_tag");

// make them hostile
ChangeToStandardFaction(oThug1, 1);
ChangeToStandardFaction(oThug2, 1);
ChangeToStandardFaction(oThug3, 1);

// give them kick to make them start attacking you
ExecuteScript("k_ai_master",oNPC,1005);
}

That should show you what to do. Hah.
 LDR
04-29-2010, 7:55 PM
#9
I'm still encountering the same problem. Only one of the pri_guard UTCs attacks me. Though the two driods and Guard Captain attack me, the rest of the pri_guard UTCs don't.
 Hope Estheim
04-29-2010, 9:06 PM
#10
Add more Henchmen... LOL

just add

object oThug4 = GetObjectByTag("npc4_tag);

ChangeToStandardFaction(oThug4, 1);

and so forth and so forth...
 newbiemodder
04-29-2010, 9:08 PM
#11
Try this one...I got this one from DarthStoney

void sub1(string stringParam1) {
int int1 = 0;
object object1 = GetObjectByTag(stringParam1, int1);
while (GetIsObjectValid(object1)) {
ChangeToStandardFaction(object1, 1);
object1 = GetObjectByTag(stringParam1, (int1++));
}
}

void main() {
sub1("tag of first group of npcs");
sub1("tag of second group of npcs");
}

Just add additional sub1's after the void main() function for each group of npc that have the same tag in a module.
 LDR
04-29-2010, 9:13 PM
#12
Thank you, both of you. And newbiemodder (can I call you NBM? ) do I only put pri_guard after sub1, and that's all I do?
 newbiemodder
04-29-2010, 9:25 PM
#13
lets say you have 15 npcs on your level all with the same tag...pri_guard...then yes put that shared tag name after the sub1...that should turn all npcs with that tag hostile..
 LDR
04-29-2010, 9:28 PM
#14
And then I just add void main() {
object oObject1 = GetObjectByTag("pri_guardcapt");
object oObject2 = GetObjectByTag("pri_meddrd");
object oObject3 = GetObjectByTag("pri_maindrd");
ChangeToStandardFaction(oObject1, 1);
ChangeToStandardFaction(oObject2, 1);
ChangeToStandardFaction(oObject3, 1);

}

directly under it?
 newbiemodder
04-29-2010, 9:49 PM
#15
no. just use the script I gave u in post #11 as your hostile script...all you need to do is change the tag name after the sub1
 LDR
04-30-2010, 6:59 AM
#16
It works! The jailbreak works! Thank you!
Page: 1 of 1