kocrachon 2 Posted June 4, 2007 Ok to sum it up, I have 4 buildings I want to destroy, and after all 4 are destroyed, no matter the sequences, and then after destroying all 4, I also have an exfil trigger set to where once we step on it, it ends the mission. But I dont know how to make it to where it wont activate that trigger unless I finish the other triggers first. Anyone able to help me figure out the scripting I need to do. Some one told me to do variables but they didn't explain it enough for me. Share this post Link to post Share on other sites
5133p39 16 Posted June 4, 2007 if i understand correctly, you have 4 buildings which must be destroyed to activate some action. Then you can make a trigger with the following condition<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(Damage building1 == 1) && (Damage building2 == 1) && (Damage building3 == 1) && (Damage building4 == 1) That should be it. Share this post Link to post Share on other sites
kocrachon 2 Posted June 4, 2007 Actually the way I have it set right now is each building has a trigger grouped with it and the trigger is activated by "Not Present" so the minute the building is considered not their, the trigger is activated. So I was wondering, how would I tell the exfil trigger that the condition is the other 4 triggers being activated. Share this post Link to post Share on other sites
5133p39 16 Posted June 4, 2007 Ok, and those triggers alone works? Ok then. In the mission init script define 4 variables:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1d = false; b2d = false; b3d = false; b4d = false; Then in each of your building triggers put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b#d = true; into the "on activation" field (replace the # with the appropriate number of the building). Then create the final trigger with condition:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">b1s and b2d and b3d and b4d. Share this post Link to post Share on other sites
kocrachon 2 Posted June 4, 2007 and this mission init script... wheres that. Share this post Link to post Share on other sites
5133p39 16 Posted June 4, 2007 You create one. It's either init.sqs or init.sqf (the syntax may vary a little, depending on whether its a SQF or SQS - i would recommend you to get used to SQF as it allows better readable code). Put it in your mission directory (where the mission.sqm resides). You should read this: ArmA: Introduction to Scripting, Scripting Topics Share this post Link to post Share on other sites
kocrachon 2 Posted June 4, 2007 Yeah I have that, I have it from the BAS Coop helper, what I meant to ask is, where do I write that in at? and do I put [ and ] around it >.< sorry Im a scripting noob fo the most part. Share this post Link to post Share on other sites
kocrachon 2 Posted June 4, 2007 Right now I have it set under the class mission like this. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">version=11; class Mission { b1d=false; b2d=false; addOns[]= { "sara", "cacharacters", "CATracked" }; and here is what I have in my sensors. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Sensors { items=3; class Item0 { position[]={2553.353271,13.905000,2835.274658}; a=5.000000; b=5.000000; activationBy="VEHICLE"; activationType="NOT PRESENT"; interruptable=1; type="SWITCH"; age="UNKNOWN"; idVehicle=2; expActiv="b1d=true"; class Effects { }; }; class Item1 { position[]={2514.485352,13.905000,2834.865723}; a=5.000000; b=5.000000; activationBy="VEHICLE"; activationType="NOT PRESENT"; interruptable=1; type="SWITCH"; age="UNKNOWN"; idVehicle=1; expActiv="b2d=true"; class Effects { track="ATrack24"; }; }; class Item2 { position[]={2537.263428,13.905000,2725.933838}; a=20.000000; b=20.000000; activationBy="WEST"; interruptable=1; type="END1"; age="UNKNOWN"; expCond="this and b1d and b2d"; class Effects { }; }; }; }; So what am I doing wrong? Share this post Link to post Share on other sites
Big Dawg KS 6 Posted June 4, 2007 Are you sure that your Not Present triggers actually work for detecting if the buildings are destroyed? Also, those variables don't belong in the mission.sqm, you should remove them or it could cause problems with your mission. You have to define them in some script (either SQS or SQF file extension) or in the editor. Also, since you're not even checking of they're false you don't even need to define them anyway. Share this post Link to post Share on other sites
kocrachon 2 Posted June 4, 2007 Well thats where the trouble comes in at. I don't know how to set that last Part. Right now I have it set to play music when both of the objectives are blown up. (well, each trigger sets off its own music) And Those work fine right now. As for the End 1 objective, it works to the point of, if I take out the part of the script where it requires the other two to be blown up, I exfil properly. It will end when i stand in the area. So my issue in this whole scheme of things is making it to where I can't activate that trigger until, the exfil end 1 trigger, until I complete the other two triggers first. And I also need to make it to where it does not matter in what order I finish the other two triggers. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted June 5, 2007 Well thats where the trouble comes in at. I don't know how to set that last Part. Right now I have it set to play music when both of the objectives are blown up. (well, each trigger sets off its own music) And Those work fine right now.As for the End 1 objective, it works to the point of, if I take out the part of the script where it requires the other two to be blown up, I exfil properly. It will end when i stand in the area. So my issue in this whole scheme of things is making it to where I can't activate that trigger until, the exfil end 1 trigger, until I complete the other two triggers first. And I also need to make it to where it does not matter in what order I finish the other two triggers. The order doesn't matter with this method, all you have to do is make sure that when each trigger is activated the corrosponding variable is set to true (or you could use numbers like 0 and 1) and that the end trigger checks of those variables are true (or equal to the number if you used numbers). Share this post Link to post Share on other sites
kocrachon 2 Posted June 5, 2007 ehhh, now its confusing, I would have no clue how to make another script... Share this post Link to post Share on other sites