Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Advanced Patrol

Go down

Advanced Patrol Empty Advanced Patrol

Post by Razer01 Fri 15 Apr 2022, 00:25

I bring to your attention a some code of free patrolling. Please note that each patrol has its own route.

Code:
function onCreate()
u1 = "iu06usfldr";
u2 = "iu06usfldri1";
u3 = "iu06usfldri2";
u4 = "iu06usfldri3";
t0 = "12000";
t1 = "14000";
t2 = "18000";
t3 = "16000";
t4 = "32000";
t5 = "2500";
t6 = "5000";
t7 = "7500";
t8 = "10000";
t9 = "12500";
z1 = "triggerzone";
z2 = "triggerzonei1";
z3 = "triggerzonei2";
z4 = "triggerzonei3";
z5 = "triggerzonei4";
z6 = "triggerzonei5";
z7 = "triggerzonei6";
z8 = "triggerzonei7";
z9 = "triggerzonei8";
soldier0 = {u1,u2,u3,u4};
soldier1 = {u1,u2,u3,u4};
zonal0 = {z1,z2,z3,z4,z5,z6,z7,z8,z9};
zonal1 = {z1,z2,z3,z4,z5,z6,z7,z8,z9};
uTime = {t0,t1,t2,t3,t4,t5,t6,t7,t8,t9};
b0 = true
b1 = true
b2 = false
bStack = {b0,b1,b2};
count = 0;
end

function onMissionTime_00x00x06(missionTimeInMilliSeconds)
startMove()
end

function startMove()
OFP:move("iu06usfldr","waypointi1p","AddToEnd")
OFP:move("iu06usfldri1","waypointi1p","AddToFront")
OFP:move("iu06usfldri2","waypointi1p","Override")
OFP:move("iu06usfldri3","waypointi1p","Override")
end

function onArriveAtWaypoint(entityName, waypointName)
if entityName == "iu06usfldr" and waypointName == "waypointi1" then
OFP:move("iu06usfldr","waypointi7p","AddToFront")
end
if entityName == "iu06usfldri1" and waypointName == "waypointi1" then
OFP:move("iu06usfldri1","waypointi7p","AddToFront")
end
if entityName == "iu06usfldri2" and waypointName == "waypointi1" then
OFP:move("iu06usfldri2","waypointi7p","AddToEnd")
end
if entityName == "iu06usfldri3" and waypointName == "waypointi1" then
OFP:move("iu06usfldri3","waypointi7p","AddToEnd")
end
--**************************************************************
--**************************************************************
if entityName == "iu06usfldr" and waypointName == "waypointi18" then
OFP:move("iu06usfldr","waypointi22p","AddToFront")
end
if entityName == "iu06usfldri1" and waypointName == "waypointi18" then
OFP:move("iu06usfldri1","waypointi22p","AddToEnd")
end
if entityName == "iu06usfldri2" and waypointName == "waypointi18" then
OFP:move("iu06usfldri2","waypointi22p","AddToFront")
end
if entityName == "iu06usfldri3" and waypointName == "waypointi18" then
OFP:move("iu06usfldri3","waypointi22p","AddToEnd")
end

end

function onEnter(zoneName, unitName)
count = count +1;
local i = bStack[math.random(3)]
local zone0 = zonal0[math.random(9)]
local zone1 = zonal1[math.random(9)]
local exSold0 = soldier0[math.random(4)]
local exSold1 = soldier1[math.random(4)]
local exTime = uTime[math.random(10)]
if zoneName == zone0 and i == true then
 else if OFP:isInTrigger(exSold1,zone1) == true then
OFP:stopForTime(exSold0,exTime,"AddToFront");
end
end
if count == 36 then
startMove()
count = 0;
end
end

Advanced Patrol Dwm_2010

It should be noted that the third junction point of the route is the penultimate waypoint in the second (4x) path.

Razer01

Points : 13
Reputation : 1
Join date : 2014-12-15

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum