OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gothicv on 06 Jun 2003, 01:10:27
-
Say in my mission, I have some dudes patrolling thru a town in a UAZ, how would I make them jump out and slaughter the enemy when they saw him??
-
make detection triger ;) name it (in da name field - not da text field) - make da trig bout 50-50 size nd put in it UAZ_DETECT = true
now make da next script
_trig = _this select 0
_UAZ = _this select 1
#loop
_trig setpos getpos _UAZ
~1
? UAZ_DETECT : goto "engage"
goto "loop"
#engage
_ppl = crew _UAZ
"unassignvehicle _X" foreach _ppl
"[_X] order getin false" foreach _ppl
"_X setcombatmode {red}" foreach _ppl
"_X setbehaviour {danger}" foreach _ppl
@ "_X in _UAZ" count _ppl < 1
~1
"_X reveal (_trig select 0)" foreach _ppl
exit
exec it
[nameoftriger,nameofUAZ] exec "scriptname.sqs"
i didnt check it but it shud work - plzreport ny erors
LCD OUT
-
set a moving trigger over the unit, and set the trigger to activate if you detect the enemy, write the script 'unitname' leavevehicle 'vehiclename';
unitname setbehaviour "combat"
if ur attacking, simply give them a transport unload waypoint
to go more in depth, out all the units in the back of the vehicle in a group, and give the leader a seek and destroy waypoint. in all of the sodiers initilizations, write:
'soldiername' moveincargo 'vehiclename'
-
as far as i remember i'm pretty sure that if an enemy is detected then the soliders disembark at their own accord?
maybe its happened... im mad... ofp has fried my brain ::)
-
@ mezzy - it hapens somtimes - not realy relaible
LCD OUT
-
woah - a moving trigger? Explain please!
-
it moves w/ regular setpos command ;)
just exec da script ;D
LCD OUT