Search the Community
Showing results for tags 'if/then'.
Found 2 results
-
Race Circuit Script (aka learning to count)
wogz187 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
This topic is solved. Clear courses by reaching the next marker. If you're looking for the module it's available here: Drive Link This is the test rig in the demo. Adding new marks and whole new courses is easy. From here on is the original topic, I need to learn how to count. I posted this the other day, with a plea to understand why it works when, in my estimation, it shouldn't really. Regardless. I set about to simplify ring counting. I don't like having one .sqf file for each ring course. I feel like 1 or 2 scripts should be able to do this. One file if somebody helps me to learn how to count. Two if this works: Determine which course and define ring marks with generic titles, ringCOURSE.sqf-- this example shows 2 courses with 3 rings each if (ringCHALL==1) then { ring1=ringMARK1_1; ring2=ringMARK1_2; //first course second mark ring3=ringMARK1_3; rings= []execVM "ringCLEAR.sqf"; }; if (ringCHALL==2) then { ring1=ringMARK2_1; ring2=ringMARK2_2; //second course second mark ring3=ringMARK2_3; rings= []execVM "ringCLEAR.sqf"; }; and then build a switchdo case for each ring, or a waitUntil loop, or... I don't know and that's the question. Keep in mind there is only one ring with one trigger attached to drive the ring clearing script(s). This is what it needs to do, ["task1",[currentRING,true]] call BIS_fnc_taskSetDestination; ringGOAL_1 setpos (getpos currentRING); The real trick in this is how to go from: ring1, ring2, ring3, to set the variable "currentRING" in sequence. Oh, boy! I hope that makes sense! -
Having Trouble Getting Convoy Moving Post-Attack
Zaptoman posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys. Need some assistance. I've got a convoy travelling down the road. I've scripted them to switch group leader to the next available hunter if one is destroyed. However, often they just sit in place after combat. Hence I'm trying a new script to get them moving again. This is my code so far. if (!alive cvoy1) then {cvoy setleader cvoy2}; if ((!alive cvoy1) and (!alive cvoy2)) then {cvoy setleader cvoy4}; if ((!alive cvoy1) and (!alive cvoy2) and (!alive cvoy4)) then {cvoy setleader cvoy6}; if ((units cvoy) findNearestEnemy cvoy=null) then {units cvoy doFollow leader cvoy}; However I can't get it to work. Do I need to define an object in the mission's init.sqf?