Jump to content
Sign in to follow this  
KEVINMGXP

Campfire guarding.

Recommended Posts

For those that are interested I was using this example back in Arma2 not sure where I got the info from doh I am not exactly a scripting guru :p anyway I am basically testing various codes again to make the enemy act more like guards around a campfire and make them only react when it is needed, thus keep them at bay till they need to react ... this will be most likely not the most perfect way to do it however I am trying to find a way to make my mission work and let the AI react is a certain way. If anyone knows a better way feel free to add advice, am using this at several enemy camps on my current mission development where some units are placed at the campfire.

I thought maybe it is a good id to share this for those that can put it to use ...

Campfire guards:

-----------------

1: Place a campfire on the map: (in theory this can be don from any other empty object "correct me if I am wrong...")

_______________________________

In the Initialization box:

FenceProne = {_unit = _this select 0; _trig = _this select 1; _uPos = unitPos _unit; if(_uPos != "DOWN" && !isPlayer _unit)then{_unit setUnitPos "DOWN"; _unit disableAI "MOVE"; sleep 1; _unit enableAI "MOVE"; waitUntil{!(_unit in (list _trig))}; _unit setUnitPos _uPos}}

2: Place a trigger on the map:

______________________________

axis a: 1e+007

axis b: 1e+007

In the text box: Break Safe

In the Condition box:

{behaviour _X != "SAFE"} count thislist > 0

In the Initialization box:

{_X doFollow (leader group _X); _X doWatch objNull} forEach thislist

press ok for now.

3: Place a group of 3 units on the map: (you can make the group as large as you want ...)

____________________________________________________________________________

Group leader: stance will be up ...

In the Condition box:

doStop this; this doWatch (this modelToWorld [0,30,0]);

Second unit: stance will be kneeled ...

In the Condition box:

doStop this; this doWatch (this modelToWorld [0,30,0]); kneel = this spawn {_this setUnitPos "MIDDLE"; _this setBehaviour "SAFE"; waitUntil{behaviour _this != "SAFE"}; _this setUnitPos "AUTO"; _this doFollow _this};

third unit: stance will be sitting ...

In the Condition box:

doStop this; this doWatch (this modelToWorld [0,30,0]); sit = this spawn {_this disableAI "ANIM"; _this action ["SITDOWN",_this]; _this setBehaviour "SAFE"; waitUntil{behaviour _this != "SAFE"}; _this enableAI "ANIM"; _this doFollow _this};

4: Back to the trigger:

_______________________

Now group the Lead unit with the trigger, open the trigger and set ...

ACTIVATION: to whole group

5: Waypoints:

_____________

Best is to place the first waypoint directly on top of the group leader, press F4 waypoints and double click on the group leader the first waypoint needs to be a move waypoint.

6: Synchronize:

_______________

Now synchronize the trigger with the first move waypoint.

7: Finish in touch:

___________________

Now in this example I will use this group as a crew for a vehicle, lets say a "BTR-K" place such an empty BTR on the map, for example 2 meters from where the group is sitting and place a second waypoint getin nearest right next to the vehicle,

place a third waypoint a while further and put this next code in the on act box:

in the on act box:

nul=[group this, position this, 100] call BIS_fnc_taskPatrol;

the above code will give the unit a patrol area radius 100 which should be random ...

now to test this place your self somewhere safe take a few pot shots at the group and if it all works out correctly they will get alerted. they will get in the BTR and start patrolling the area ....

You can experiment with this in several ways, place other patrols on the map eather by a certain script provided by the community or just use other groups with a move waypoint and use the bis_fnc_taskpatrol code in the on act box to trigger a patrol route.

Best of regards

---------- Post added at 10:07 PM ---------- Previous post was at 10:00 PM ----------

ps: I will see to it that I add a template later on so for those that want to use it can just copy and paste it into their own mission ;-)

---------- Post added 09-19-2013 at 12:05 AM ---------- Previous post was 09-18-2013 at 10:07 PM ----------

link to template: http://www.megafileupload.com/en/file/452377/Campfire-Guarding-Template-zip.html

Known issues:

1: In some occasions, while you clearly engaging the enemy one group seems to get alerted pretty instantly while the other one stays at safe.

2: When you go in with silent weapons and take out an enemy eg. "black op mission" the enemy still seems to know you're whereabouts (this also happens when you take out a single enemy who is patrolling on hes own ...)

I do not think in both situations that this happens because of the syntaxes but merely because how the game reacts at the moment ...

best of regards

Edited by LiquitHQ

Share this post


Link to post
Share on other sites

Hi LiquitHQ,

Thanks i will try this out when i get a chance.. i like trying to setup realistic patrolling and behaviour in the editor, usually i setup a series of waypoints with the last one being cycle.. from the cycle waypoint i add another guard waypoint and then another cycle waypoint after that that links to the original unit or first waypoint, then sync a trigger that covers required area to the first cycle waypoint, make it a switch - opfor - detected by blufor - repeatedly.. not sure if you get what i mean but this allows units to patrol the waypoints and if they are called upon by the guard trigger they will leave the patrol waypoints and investigate anything, once clear they return back to patrolling waypoints.

The only thing thats wrong with this is the units actually move to the guard waypoint before moving to required area.

Anyway ill try this out sometime and see how it works for me, cheers.

Share this post


Link to post
Share on other sites

I like to use it this way because I do not like to have to many waypoints on my map.

Personally I find it a bit messy when I use to much waypoints so I like to narrow it down as much as it is humanly possible, I like to work this way because it works faster eg. if something is going wrong I only need to address only a few waypoints to correct it.

Also the use of usps -> "ultra simple patrol script" mixed with this helps to narrow down the waypoints. this uses a spawn marker and a patrol marker to set it up, actually pretty nice to work with in a certain area where you want the enemy or even friendly units to patrol, and it makes the whole lot even more random, anyway when I try to develop a mission I try to focus on the replay-ability of my missions.

I still need to figure out a lot of stuff doh this was one of them, and so far it looks like it works perfectly for what I want to achieve ;-)

best of regards

Edited by LiquitHQ

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×