irisharmy 1 Posted March 21, 2013 (edited) Hi guys, Im writing a hostage rescue mission and I have everything finished except for 3 final scripts to end the mission. I will post the briefing of my mission so you will understand how it works then i will tell you how i need it to end. Briefing : Aim of the game is simple. There are 3 factions - Bluefor (Spec Ops) , Opfor (Terrorists) and Drug Dealers (Hostages and Mercenaries). Mercenaries want to rescue hostages as they are friendly associates in a local drugs gang. Bluefor want to capture and interrogate the hostages for information related to their activity. Terrorists want to obtain better equipment i.e. a Helicopter / Armed boat / NLAWs . With this said, all factions can negotiate on terms in order to trade or join forces. If Bluefor captures and secures all existing hostages to any of the local safe zones (Blue Flag) - They Win. If Terrorists obtain and secure a Heli / HMG Boat / Boat with 2 NLAWS back at their base - They Win. If Mercenaries rescue all existing hostages and get them to a local drugs safehouse (Green Sign) - Drug Dealers Win. The Blue Flag represents Spec Ops, the Green Icon represents Drug Dealers and the Black/Red Iran army flag represents Terrorists So as you can see above, I will need to make 3 triggers for the 3 different ways the game can end. 1st : If Bluefor captures and secures all existing hostages to any of the local safe zones (Blue Flag) - They Win. I need to make a trigger so that if all remaining bluefor and all remaining hostages enter the trigger zone and if there are no terrorists or mercenaries in the trigger zone - the game ends. 2nd : If Terrorists obtain and secure a Heli / HMG Boat / Boat with 2 NLAWS back at their base - They Win. I need to make a trigger so that if either a Heli / HMG Boat / Boat and 2 NLAWS are in the trigger zone - the game ends. Also the trigger must ensure that no bluefor or mercenaries are in the trigger zone i.e its secure. 3rd : If Mercenaries rescue all existing hostages and get them to a local drugs safehouse (Green Sign) - Drug Dealers Win. I need to make a trigger so that if all remaining civilians are in the trigger zone and there are no bluefor or terrorists in the zone i.e its secure - Civilians win. Ok thats it . If you guys could help me with this it would be absolutely great as it will really complete the mission. Without these triggers there is no finality to the game. Edited March 21, 2013 by irisharmy Share this post Link to post Share on other sites
irisharmy 1 Posted March 21, 2013 okay above post might put people off because of its length :) .... simply i need 1 trigger to end game if all alive bluefor and all alive hostages enter the trigger zone and if there are no terrorists or mercenaries in the trigger zone. i need a trigger to end game if either a Heli or HMG Boat are in the trigger zone and no bluefor or mercenaries are in the trigger zone. i need a trigger to end game if all alive civilians are in the trigger zone and there are no bluefor or terrorists in the trigger zone. simple ! :p Share this post Link to post Share on other sites
f2k sel 164 Posted March 21, 2013 for the first one if you have two groups then you could do it by using trigger anyone present repeating cond {_x in thislist} count units group player == {alive _x} count units group player and {_x in thislist} count units group man == {alive _x} count units group man man would be the leader of the civ group. Share this post Link to post Share on other sites
irisharmy 1 Posted March 21, 2013 (edited) can you tell me exactly what to put into the condition box or wherever the above code goes as im not familiar with php and dont understand the above code. Edited March 21, 2013 by irisharmy Share this post Link to post Share on other sites
f2k sel 164 Posted March 21, 2013 Paste the above code in the condition box of the trigger You will need to name the leader of the hostages man it just makes sure that all living units of player group are in the trigger area and the same for the hostages you will need to select an end from drop down menu. Share this post Link to post Share on other sites
irisharmy 1 Posted March 21, 2013 (edited) and do i need to replace any of the player 'group' code with blufor or civilians ? Im not getting anything to happen. I have created a trigger with this code: {_x in thislist} count units group player == {alive _x} count units group player and {_x in thislist} count units group man == {alive _x} count units group man the type is set to end #1. the activation is set to None. the part below is set to once and below that is set to present. i have made one hostage a sergeant while all the rest are privates and i have typed 'man' in the sergeants name field. all blufor and hostages are place in the trigger and nothing is happening. Do you have a steam name so i can add you now and maybe you could aid me on the steam text if you like ? Edited March 21, 2013 by irisharmy Share this post Link to post Share on other sites
f2k sel 164 Posted March 21, 2013 If the two groups are separate then it should be ok. Share this post Link to post Share on other sites
irisharmy 1 Posted March 21, 2013 (edited) do you have a steam name so i could add you ? would appreciate it ! should the trigger not specify blufor and civilian(hostage) ? i dont see where in the code it specifies between them 2 and how it could therefore end the game when both blufor and hostages are in the trigger. just a reminder the hostages and mercenaries are two groups of the faction civilians. as i said it would be handier if i could talk to you over steam ! Edited March 21, 2013 by irisharmy Share this post Link to post Share on other sites
f2k sel 164 Posted March 21, 2013 I avoid using steam as much as possible. It doesn't need to check the sides as it's checking the groups belonging to player and man Share this post Link to post Share on other sites
irisharmy 1 Posted March 21, 2013 Yeah its still not working ... very strange. so are you saying that 'player' represents blufor just as 'man' represents hostages ? Share this post Link to post Share on other sites
f2k sel 164 Posted March 21, 2013 See if this helps http://www.sendspace.com/file/df67c5 the mission will end when both groups are in the trigger Share this post Link to post Share on other sites
irisharmy 1 Posted March 22, 2013 Yeah that worked great F2k I have setup the end game triggers for all civilian and spec ops. Also was wondering can i add a condition to the same trigger where there must be no opfor in the trigger before the game ends. Finally do you know how to make a trigger for a ship/heli present ? Thats a great help to me so far so thanks for that ! Share this post Link to post Share on other sites
f2k sel 164 Posted March 22, 2013 just add this to the condition line after what is already there. and {side _x == east} count thislist == 0 for a ship just group the object to the trigger or if it has a name anyone present condition boat1 in thislist Share this post Link to post Share on other sites
irisharmy 1 Posted March 23, 2013 Do you know how to make the trigger where blufor and hostages in trigger but no opfor or mercenaries in trigger ? If I can get this i'm almost done as I have got all the mercenary/hostages triggers working flawlessly. Share this post Link to post Share on other sites
f2k sel 164 Posted March 23, 2013 I thought we'd more or less covered that already. {_x in thislist} count units group player == {alive _x} count units group player and {_x in thislist} count units group man == {alive _x} count units group man and {side _x == east} count thislist == 0 as long as blufor is player group and man is hostage group. I don't know what your using for mercenaries. Share this post Link to post Share on other sites
irisharmy 1 Posted March 24, 2013 (edited) Got everything working finally :D Heres the code for the terrorist end game trigger : (boat1 in thislist or boat2 in thislist or heli1 in thislist) and {side _x == west } count thislist == 0 and {_x in thislist} count units group mercman == 0 and {_x in thislist} count units group terman > 0 Thanks alot for the help ! :D Edited March 24, 2013 by irisharmy Share this post Link to post Share on other sites
irisharmy 1 Posted March 24, 2013 Hi one last thing. Im making three seperate trigger scripts to cover the whole island for the following events. Do these triggers look right ? At least 1 terrorist alive and all specops and mercenaries dead: {side _x == west } count thislist == 0 and {_x in thislist} count units group mercman == 0 and {_x in thislist} count units group terman > 0 At least 1 Specops alive and all terrorists and mercenaries dead: {side _x == west } count thislist > 0 and {_x in thislist} count units group mercman == 0 and {_x in thislist} count units group terman == 0 At least 1 Civilian (hostage or mercenary) alive and all specops and terrorists dead: {side _x == civilian } count thislist > 0 and {side _x == west } count thislist == 0 and {_x in thislist} count units group terman == 0 Because when I hosted the server online and tested it with just myself playing, no AI or anyone else, the moment i got into a car, the civilian end game trigger initiated ? Share this post Link to post Share on other sites
f2k sel 164 Posted March 25, 2013 (edited) I can't seem to replicate the problem, is it the last trigger firing? What unit were you playing as? What side are the mercman and terman? The reason I ask is that if they are west or Civs then west and civ can never be zero unless they are dead as well. Edited March 25, 2013 by F2k Sel Share this post Link to post Share on other sites
irisharmy 1 Posted March 25, 2013 The trigger that fires is the last one - (At least 1 Civilian (hostage or mercenary) alive and all specops and terrorists dead). Even though when i was playing there weren't any civilians and the triggers condition is for at least one civilian.. Also it fires when i get into a vehicle ... I was playing as a terrorist, and this was online without any AI. Terman is the name of the leader of terrorist group so its correct as far as i know. Maybe i should use the not alive in list function ? Share this post Link to post Share on other sites