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?
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......
Thank you!
Edit: And how do you make a script that makes a certain door open via a computer terminal dialouge choice?
script to open door I think is something like this:
void main() {
object oDoor = GetObjectByTag( "tag of your door");
ActionUnlockObject( oDoor );
ActionOpenDoor( oDoor );
}
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?
It doesn't work. Only one person called pri_guard turns hostile. What if it was a whole bunch of NPCs named pri_guard?
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.
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.
Add more Henchmen... LOL
just add
object oThug4 = GetObjectByTag("npc4_tag);
ChangeToStandardFaction(oThug4, 1);
and so forth and so forth...
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.
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?
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..
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?
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
It works! The jailbreak works! Thank you!