Search the Community
Showing results for tags 'logic'.
Found 3 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! -
I want to make a ring course to fly through. The ring course will be defined by several markers (ringMARK1_1) and the ring itself has a trigger attached. Each time a ring is cleared I want it to snap to the next position. There is only one ring which moves from marker to marker. ringCHALLENGE.sqf ringChallenge = [] spawn { waitUntil { ring1==1 }; hint "Ring Challenge Activated"; currentRING= [ringMARK1_1,ringMARK1_2,ringMARK1_3] select 0; sleep 1; ["task1",[currentRING,true]] call BIS_fnc_taskSetDestination; ringGOAL setpos (getpos currentRING); }; What's the best way to update the ring position in a sequence? Can "select 0;" in the array be called something like "select next"? Is it better to use IF/WAIT for the next ring? Am I starting this all wrong?
-
A few months ago I had a script that would have a group of AI units fire into an area using a logic as their target, that then changed it's position for each new firer, so that every time a unit fired it would be at a different position within a given area. This used to work, but now I'm trying to use it again without success, as the AI will target and fire at the logic's original position, but no longer target it once it has changed position. The below code is part of what loops through each unit at a set interval while the script is still running. _logic setPos [(_xPos - _areaSizeX) + (random (_areaSizeX*2)),(_yPos - _areaSizeY) + (random (_areaSizeY*2)),_zPos]; sleep 0.1; _unit doWatch objNull; _unit reveal [_logic,4]; _unit doWatch _logic; _unit doTarget _logic; Then, once other variables have been set (like weapon/muzzle to fire, number of rounds to fire), the AI fire. This part still works: while {(_ammo > _endBurst)} do { _logic action ["UseWeapon",vehicle _unit,_unit,_index]; _ammo = _unit ammo _weapon; sleep 0.05; }; So, they end up firing as per normal, but they don't aim at the logic when it changes position (the logic DOES change position correctly). They continue to realign to the logic's original position. Any ideas why?