HK-42 Posted December 21, 2008 Share Posted December 21, 2008 Is there a script that will turn about say 5 people to a hostile faction, but they will attack all attacking people not just the pc. Like free for all or a bar fight:xp:. (the latter is what im trying to do) Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted December 22, 2008 Share Posted December 22, 2008 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 Link to comment Share on other sites More sharing options...
TriggerGod Posted December 22, 2008 Share Posted December 22, 2008 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 More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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... 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 More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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 More sharing options...
Canderis Posted December 22, 2008 Share Posted December 22, 2008 You need to start it with void main(){ and end it with } Link to comment Share on other sites More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 You need to start it with void main(){ and end it with } Oh yea...I always forget obvious 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 More sharing options...
Mandalore_The_Great Posted December 22, 2008 Share Posted December 22, 2008 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 More sharing options...
Canderis Posted December 22, 2008 Share Posted December 22, 2008 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. Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted December 22, 2008 Share Posted December 22, 2008 Brain blast?? sounds kinda shaky... but it could work. Nice job, Canderis. 10/10 for idea, -2 for ^ Link to comment Share on other sites More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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 More sharing options...
Canderis Posted December 22, 2008 Share Posted December 22, 2008 What didnt you get? Go to TH chat box, i can help you better there. Link to comment Share on other sites More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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 More sharing options...
Mandalore_The_Great Posted December 22, 2008 Share Posted December 22, 2008 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 More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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 More sharing options...
sekan Posted December 22, 2008 Share Posted December 22, 2008 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 More sharing options...
stoffe Posted December 22, 2008 Share Posted December 22, 2008 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 More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 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 More sharing options...
Mandalore_The_Great Posted December 22, 2008 Share Posted December 22, 2008 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" might've been because you forgot to put a } at the end Link to comment Share on other sites More sharing options...
HK-42 Posted December 22, 2008 Author Share Posted December 22, 2008 nope i put one and I got the script compiled and the npcs do attack whoever but they won't start till I hurt them. They just stand there till I attack. Link to comment Share on other sites More sharing options...
glovemaster Posted December 23, 2008 Share Posted December 23, 2008 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 More sharing options...
HK-42 Posted December 23, 2008 Author Share Posted December 23, 2008 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 More sharing options...
Mandalore_The_Great Posted December 23, 2008 Share Posted December 23, 2008 oh well... try making one of the NPCs friendly, thereby attacking him, then when he dies, make it so they go insane, and maybe they'll attack each other since they were already engaged in a fight Link to comment Share on other sites More sharing options...
stoffe Posted December 24, 2008 Share Posted December 24, 2008 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 More sharing options...
HK-42 Posted December 29, 2008 Author Share Posted December 29, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.