Jump to content

Home

Free For All Script


HK-42

Recommended Posts

all you gotta do is put this script function in:

ChangeToStandardFaction(oNPC*, STANDARD_FACTION_HOSTILE_1);

put this a few times with the name of the NPCs at the place where I put the * it might be HOSTILE_2... not sure though

 

You misunderstood him. I'll try and simplify it for him...

dialog...

script fires

NPC1 hits NPC3 with a barstool, NPC2 gets hit by a beer bottle by NPC4, NPC1 beats up NPC4 with your flask of juma, and you wail on all of them.

 

As for your actual question, I do not think its possible. But one of our local scripting gurus may know something we don't...

Link to comment
Share on other sites

You misunderstood him. I'll try and simplify it for him...

dialog...

script fires

NPC1 hits NPC3 with a barstool, NPC2 gets hit by a beer bottle by NPC4, NPC1 beats up NPC4 with your flask of juma, and you wail on all of them.

 

As for your actual question, I do not think its possible. But one of our local scripting gurus may know something we don't...

:lol:

 

I think it is possible in the game, because you see animals attacking a human, the human attacking the animal, and you come in and kill both...

 

Ill try the Mandalore's script and post the results.

Link to comment
Share on other sites

all you gotta do is put this script function in:

ChangeToStandardFaction(oNPC*, STANDARD_FACTION_HOSTILE_1);

put this a few times with the name of the NPCs at the place where I put the * it might be HOSTILE_2... not sure though

 

nope, syntax error at ChangeToStandardFaction

 

my nice little script:

ChangeToStandardFaction(oNPC"ryloth_exslum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC"ryloth_exslum2", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC"ryloth_twislum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC"ryloth_twislum2", STANDARD_FACTION_HOSTILE_1);

Link to comment
Share on other sites

You need to start it with

void main(){

and end it with

}

 

Oh yea...I always forget obvious :migraine:

 

Syntax error at string constant rows 3, 4, 5, 6

 

void main()
{
      ChangeToStandardFaction(oNPC"ryloth_exslum1", STANDARD_FACTION_HOSTILE_1);
      ChangeToStandardFaction(oNPC"ryloth_exslum2", STANDARD_FACTION_HOSTILE_1);
      ChangeToStandardFaction(oNPC"ryloth_twislum1", STANDARD_FACTION_HOSTILE_1);
      ChangeToStandardFaction(oNPC"ryloth_twislum2", STANDARD_FACTION_HOSTILE_1);
}

Link to comment
Share on other sites

try, instead of

(oNPC.. //bla-bla-bla, try 
oNPC1..//bla-bla-bla 

That works with spawning more than one item

@TriggerGod- I knew what he meant I just thought maybe HOSTILE_2 would be different from HOSTILE_1

 

Anyway, you could try making it so they don't see you until after they're all in a fight with each other(put your guy on the other side of the bar from the participants, for an example).

Link to comment
Share on other sites

Brain Blast! What you can do is make 2 of the enimys hostile 2 and one is hostile 1 and aonther friendly 2. Modify the ondeath script of one of the hostile 2's to change the friendly's faction to hostile 2 then they will fight and you can help.

 

Uh, what? I got about half that.

Link to comment
Share on other sites

try, instead of
(oNPC.. //bla-bla-bla, try 
oNPC1..//bla-bla-bla 

That works with spawning more than one item

@TriggerGod- I knew what he meant I just thought maybe HOSTILE_2 would be different from HOSTILE_1

 

Anyway, you could try making it so they don't see you until after they're all in a fight with each other(put your guy on the other side of the bar from the participants, for an example).

 

Could you describe that a little more to fix the syntax?

Link to comment
Share on other sites

what I meant is make a script that looks like this:

void main() {
ChangeToStandardFaction(oNPC0"ryloth_exslum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC1"ryloth_exslum2", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC2"ryloth_twislum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC3"ryloth_twislum2", STANDARD_FACTION_HOSTILE_1);

 

if you mention where the syntax errors were exactly, then that would help a little more

Link to comment
Share on other sites

what I meant is make a script that looks like this:

void main() {
ChangeToStandardFaction(oNPC0"ryloth_exslum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC1"ryloth_exslum2", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC2"ryloth_twislum1", STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC3"ryloth_twislum2", STANDARD_FACTION_HOSTILE_1);

 

if you mention where the syntax errors were exactly, then that would help a little more

mobfight.nss(3): Error: Syntax Error at "string constant"

mobfight.nss(4): Error: Syntax Error at "string constant"

mobfight.nss(5): Error: Syntax Error at "string constant"

Link to comment
Share on other sites

This script should work

 

void main() {
object oNPC0 = GetObjectByTag("ryloth_exslum1");
object oNPC1 = GetObjectByTag("ryloth_exslum2");
object oNPC2 = GetObjectByTag("ryloth_twislum1");
object oNPC3 = GetObjectByTag("ryloth_twislum2");

ChangeToStandardFaction(oNPC0, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC1, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC2, STANDARD_FACTION_HOSTILE_1);
ChangeToStandardFaction(oNPC3, STANDARD_FACTION_HOSTILE_1);
}

Link to comment
Share on other sites

This script should work

ChangeToStandardFaction(oNPC0, STANDARD_FACTION_HOSTILE_1);

 

Keep in mind though that NPCs in the Hostile faction will not attack each other, only those who are considered enemies of the Hostile faction (the player, party and allies).

 

You could try using the STANDARD_FACTION_INSANE faction instead, that one is hostile to itself as well.

Link to comment
Share on other sites

Keep in mind though that NPCs in the Hostile faction will not attack each other, only those who are considered enemies of the Hostile faction (the player, party and allies).

 

You could try using the STANDARD_FACTION_INSANE faction instead, that one is hostile to itself as well.

 

Alright I got the script done, but the NPCs just stand there till I attack them. Also I cant get their weapons to appear.

Link to comment
Share on other sites

Assuming "ryloth_exslum1" and the others are the tag of the NPC, otherwise you will have to swap as necessary, try:

void main(){
   ChangeToStandardFaction(GetObjectByTag("ryloth_exslum1"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_exslum2"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_twislum1"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_twislum2"), STANDARD_FACTION_INSANE);
}

Link to comment
Share on other sites

Assuming "ryloth_exslum1" and the others are the tag of the NPC, otherwise you will have to swap as necessary, try:

void main(){
   ChangeToStandardFaction(GetObjectByTag("ryloth_exslum1"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_exslum2"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_twislum1"), STANDARD_FACTION_INSANE);
   ChangeToStandardFaction(GetObjectByTag("ryloth_twislum2"), STANDARD_FACTION_INSANE);
}

 

tried this one and it did the same thing, it turned the insane, but they dont start attacking they just stand there till I attack them.

Link to comment
Share on other sites

Alright I got the script done, but the NPCs just stand there till I attack them. Also I cant get their weapons to appear.

 

If they are already within the perception range of each other by the time you change their faction you may need to kickstart their combat AI manually for them to start fighting. Usually NPCs will start fighting when they perceive an enemy, which can cause problems if they're friendly when they first perceive them. Something like:

 

void ST_Fight(int iFac, object oActor = OBJECT_SELF) {
   ChangeToStandardFaction(oActor, iFac);  
   ExecuteScript("k_ai_master", oActor, 1003);
}


void main() {
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_exslum1"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_exslum2"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_twislum1"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_twislum2"));
}

Link to comment
Share on other sites

If they are already within the perception range of each other by the time you change their faction you may need to kickstart their combat AI manually for them to start fighting. Usually NPCs will start fighting when they perceive an enemy, which can cause problems if they're friendly when they first perceive them. Something like:

 

void ST_Fight(int iFac, object oActor = OBJECT_SELF) {
   ChangeToStandardFaction(oActor, iFac);  
   ExecuteScript("k_ai_master", oActor, 1003);
}


void main() {
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_exslum1"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_exslum2"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_twislum1"));
   ST_Fight(STANDARD_FACTION_INSANE, GetObjectByTag("ryloth_twislum2"));
}

 

Thanks Stoffe it finally worked. . :) Now just to boost up there hp and defense they died almost right after it started.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...