Jump to content
Sign in to follow this  
Nightjay0044

Creating a sentry

Recommended Posts

Hi, okay I have this mission.

I have 3 alarm triggers for an alarm to go off once east detects west.

I have a bunch of patrols around the Area of operations.

What I want to make, it a sentry for each patrol to move to the town and activate the alarm so the player has time to kill the patrols so the alarm doesn't activate right away.

How do I do this?

Basically I just want the a guy from a patrolling group to run to the town and activate the alarm once east detects west.

thanks

Share this post


Link to post
Share on other sites

Something like :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_group = _this select 0

_unit = _group select ((count units _group) - 1)

;so that the last unit of the group moves to the alarm place

_unit domove getpos alarm_place

;alarm_place can be the name of a trigger or an invisible H

@(unitready _unit) or !(alive _unit)

? !(alive _unit) : exit

alarm = true

;alarm is the variable that must be set to true so that the alarm activate on the condition line of the alarm trigger for example

exit

call the script "move_to_the_alarm.sqs", and you can launch the script in the on activation field of the detection trigger, such as :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[name_of_patrol_group] exec "move_to_the_alarm.sqs"

Share this post


Link to post
Share on other sites

Example mission without scripts or addon required :

http://files.filefront.com/testalarmedEdenrar/;13472563;/fileinfo.html

Extract the folder named testalarmed.Eden and put it your OFP \YOURUSERNAME\mission\ directory and load it on Everon.

In this example, there is a 3 men east squad patrolling near you with 3 waypoints one of them being a CYCLE one.

As soon as they see/hear you (i set a knowsabout of 0.03, feel free to tweak it if you think they don't see you or see you too easily), a trigger will switch the cycled waypoint to the 4th one in town.

In the town as soon as one of the men enter the town trigger array, alarm will be launched, and both the 3 men squad and a garrisoned one will come to you with a setWpPos moving their final "SEEK AND DESTROY" waypoint to your location.

The 3 men squad is set to Hold Fire, so they will not attack you unless you fire at them (so they actually prefer to go to town instead of just firing back at you.

I used a setunitpos "up", to prevent the officer sprinting to town to just go prone as usual with the OFP AI, losing precious time and making such an easy slow target.

Share this post


Link to post
Share on other sites

It'd probably be better to have the sentry part of a different group to each patrol but with the same waypoints (moving in a patroling pattern with a cycle to loop them around). The difference being that you add an extra move waypoint in the town for the sentry after his cycle waypoint, make the respective detect trigger into a switch type then synchronise it to the sentry's cycle waypoint.

Make the sentry's move waypoint combat mode "hold fire" or "never fire" and the combat mode "aware", now when the detect trigger is activated, the sentry is forced to go to the move waypoint in the town. If you want to trigger an event based on the sentry's presence in the town then put a small if present trigger over his town waypoint, then use the group mode to drag a connection to his move waypoint, this will make the waypoint only activated by members of his group.

With regards to the rest of the patrol, you can do the same thing except instead of a move waypoint in the town use a seek and destroy or guard waypoint (depending on what you want them to do), bear in mind if they are the ones that detected the player, it will be difficult to stop them shooting at him.

This is assuming of course that you want to do this all with triggers and synched waypoints, I usually use a single large detect trigger which starts a script, the script then works out what to do and moves waypoints around, activates switch triggers, spawns more soldiers etc. etc.

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  

×