Obscure CIA_Agent 0 Posted June 27, 2006 Ok so I need to know how to make this trigger work right. The trigger is an End#2 with the condition of: not (alive westsoldier1) and not (alive westsoldier2) and not (alive westsoldier3) and not (alive westsoldier4) and not (alive westsoldier5) If you start the mission with all AI present the trigger works fine. But when you disable even 1 AI the trigger will not work. Even if the whole West team is dead. What gives? Thanks, CIA Share this post Link to post Share on other sites
5133p39 14 Posted June 27, 2006 Put "WSOLS = [ws1,ws2,ws3,...]" into the mission init.sqs (ws1 - 3 are the soldiers). Make some trigger and put "({Alive _x}Count WSOLS) == 0" into its condition. The triger will activate when all the soldiers are dead or doesn't exist at all. Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 27, 2006 That doesn't work but thanks anyways... Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 27, 2006 Could you like give me the write code or something? Thanks, CIA Share this post Link to post Share on other sites
ProfTournesol 956 Posted June 27, 2006 What do you mean by : Quote[/b] ]But when you disable even 1 AI Do you mean disableAI command or anything else ? Share this post Link to post Share on other sites
Metal Heart 0 Posted June 27, 2006 Use count units westgroupname instead. Quote[/b] ]count arrayOperand types: array: Array Type of returned value: Number Description: number of elements in array Example: count [0,0,1,2] , result is 4 Quote[/b] ]units unitOperand types: unit: Object Type of returned value: Array Description: Arrays of all units in the group of given object. For dead object empty array is returned. Example: player in units player Share this post Link to post Share on other sites
UNN 0 Posted June 27, 2006 If you can't find a better way, this definetly works. Even if there not in the same group: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{!(Alive _x)} Count [ws1,ws2,ws3]=="Man" CountType [ws1,ws2,ws3] Share this post Link to post Share on other sites
ProfTournesol 956 Posted June 27, 2006 lol we're all posting together !!! Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 28, 2006 OK. Nothing anyone has told me works. I either get a "Unknown Operator" or "invalid number in expression" or some other wack error. It shouldn't be this hard. I want to beable to disable AI and still have the mission end when everyone dies. Let me explain this in different words... I have a mission with 5 WEST soldiers named "westsoldier1, westsoldier2, westsoldier3, westsoldier4, and westsoldier5" --- Now if you start the mission with AI present. (So its you as the leader and 4 AI soldiers) The trigger "not (alive westsoldier1) and not (alive westsoldier2) and not (alive westsoldier3) and not (alive westsoldier4) and not (alive westsoldier5)" works fine. And END#2 will work when they all die... BUT if you DISABLE AI before you start the mission (So its you alone, or like you and one other guy) The END#2 trigger wont work. The game thinks the DISABLED AI are there or something. None of your lines of code work. Please would someone give me the right code? This is the last trigger I need to get working, then my mission is complete. Thanks, CIA Share this post Link to post Share on other sites
Metal Heart 0 Posted June 28, 2006 Ok, if you just count the units from a group it doesn't work because dead units are not removed from the group instantly when they die. This definately works, I just tried it in the editor: 1. In every westsoldier's init line have: westgrp=group this 2. In trigger condition have: ({alive _x} count units westgrp) < 1 Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 28, 2006 I do not understand. I am making this mission in version 1.46. I copy and paste that exact code and it does NOT work. ({alive _x} count units westgrp) < 1 Unknown Operator or invalid number in expression. Does not work with or without "this" in front of it. What in the good Lord's name is going on here. maybe i shoulda joined the fbi... Share this post Link to post Share on other sites
5133p39 14 Posted June 28, 2006 I am making this mission in version 1.46. whoopsie, that might be the problem. You should tell us that in advance. I think most of the people here do have the Resistance, and mostly the 1.96 version. Maybe we all are suggesting something which doesn't work in the old version. I cannot test it right now, but later i'll try the solution in the 1.46 Share this post Link to post Share on other sites
Artak 0 Posted June 28, 2006 Consider that using the 'any' _x statement isn't possible in 1.46 but was added later with Resistance. I was looking through some games in a local store and they had several copies of OFP bestseller edition for 15 euros. Time you got one too? Share this post Link to post Share on other sites
Metal Heart 0 Posted June 28, 2006 Quote[/b] ]What in the good Lord's name is going on here. This is going on: Quote[/b] ]I am making this mission in version 1.46. no wonder nothing works. Get resistance for christ's sakes, the goty bestsellers costs like 5-15 euros and it has opf+resistance+red hammer. Resistance expansion has updated engine and more scripting commands and stuff. Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 28, 2006 Does anyone know the old school code? It's gotta be somewhat the same. PLEASE HELP ME! Share this post Link to post Share on other sites
Obscure CIA_Agent 0 Posted June 28, 2006 Oh yea and I DO have resistance 1.96. I just like 1.46 better. Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 29, 2006 the only thing that pops up is this. Read Closely. Create a trigger with the following settings: Activation: West, Condition: Not present.. After that simply make the trigger cover the battle zone. I hope it helps you. Share this post Link to post Share on other sites
Heatseeker 0 Posted June 30, 2006 Does anyone know the old school code? It's gotta be somewhat the same. PLEASE HELP ME! Group the soldiers by typing this in their init box: soldiers = group this Make a trigger that counts the soldiers, try: Condition: west countside (units soldiers) < 0 type: end#2 On activation: forceend Im not sure if this works in 1.46, give it a try . Your initial problem was you using all soldiers being dead has a condition for end#2 to trigger but if the soldiers are not present in the mission (i.e. disabled in the mp selection screen) the trigger will obviously never work because the soldiers dont exist in your mission. If the above doesnt work! Just put a trigger that covers the whole island, press F2 and draw a line betwean the group leader and the trigger, you will now have more options in the activation area of such trigger, select "whole group" not present, type: end#2, on activation: forceend. I believe most of your questions can be found in the forum by using the search feature, you can also find many information @ofpec, if you expect to get more assistance in the future try to be more patient and polite, otherwise someone might spank you . Share this post Link to post Share on other sites