Jump to content
domithious

Defending a position from attack waves

Recommended Posts

Hello Arma fans; i need some help please. 

 

I'm trying to create a mission where it gets to a point that i need to defend a position from waves of AI attacks. I am trying to make the ai attacks random, in terms of time, and so far I've made a very crude approach. However, I can't get a staggered attack from the ai, they all seem to attack at once. I'm sorry, but i don't know how to script, so i am trying to do things with triggers, and activate on triggers. So far i have the following:

 

1) Blufor approaches a trigger area. This activates black out; skiptime; black in; This doesn't work very well, but not really important. 

 

2) I have a number of ai squads, initially hidden from view, with waypoints to the Blufor position

 

3) I have waypoint timers, for each ai squad, synced on the initial trigger. The move waypoints are set with random min and max values across the squads. My thinking is that each ai squad will move from their hidden position between a min and max time. 

 

What i have found is all AI moving at the same time. I wonder if skipping time has had an impact on the waypoint timer. 

 

I'm picking up things as i go along, but i'm a bit stuck on this one. Any advice?

 

Thanks

Dom

Share this post


Link to post
Share on other sites

It could be that having the trigger acting as the waypoint activation is skipping the wait times for the waypoints. Just a guess.

Share this post


Link to post
Share on other sites

Skiptime maybe the whole problem, but aside from that these are the obvious answers which it sounds like you're using some.

 

1. The most simplest  thing is place AI groups at different distances from the target.

2. Or in the waypoint window set the speed to limited or fast for some groups.

3. Use the Timeout Boxes in the waypoint screen to create a delay.

4. You can also use triggers syncronized to waypoints. (Use F5 key and drag a line from a trigger to a waypoint.)

5. You can put conditional statements in a waypoint and when condition is true the waypoint is active.

 

Also different options in the CombatMode box in the waypoint window will produce different AI behaviour as well as the waypoint type.

 

Hold, Sentry or Guard waypoints will cause AI to hold at waypoint until enemy is detected.

 

When enemy is detected AI will move a given distance and attack, when enemy is dead AI will return to waypoint.

 

CombatMode Open Fire, Engage At Will AI will hunt down enemy as soon as spotted.

 

A Guard waypoint with Open Fire, Engage at will create the most challenging AI.

Share this post


Link to post
Share on other sites

Hi, thanks for the advice. It looks like the skiptime is working OK; with some trail and error i think i will get this working as i want now. On the other hand i am still having trouble with the "black out" and "back in" :(

 

What i am trying to make it look like is, my group approaching a defensive position during the day, after a cut scene it's night time and the group is in the defensive position, So i have a trigger to activate on blufor present. Then i want to: black out, teleport units to their positions, skiptime, black in. I trying this by using:

 

sleep 4;
titlecut ["","BLACK Out",3];
 
 
hint "10 hours later";
 
{_x setPos getMarkerPos "def1"} forEach units Me; 
 
jac1 setPos (getMarkerPos "Jack1"); Jac1 setdir 320; d3 moveingunner jac1; d2 moveincommander jac1; 
 
{_x setPos getMarkerPos "def2"} forEach units You; 
 
jac2 setPos (getMarkerPos "Jack2"); Jac2 setdir 320; s3 moveingunner jac2; s2 moveincommander jac2;
 
 

 

skiptime 10; sleep 1;
titlecut ["","BLACK IN",2];
 
I can get the separate events to work individually, but i can't get everything to work together smoothly (although it does work). I don't think the sleeps are working, everything seems to happen at once. If i only "black out" and "black in", then the screen looks nice and smooth. If i include the skiptime and teleport then the screen freezes for a split second, and everything happens in one go, without fading. Is there a way to make this flow smoothly, as 3 events?

Share this post


Link to post
Share on other sites

Well sleep is not an OFP command (only came in with Arma 2 + UP)

 

You can introduce delays/pauses if you insert:

 

~10 (10 sec delay)

 

between lines in your script.

Share this post


Link to post
Share on other sites
On 10/12/2016 at 6:07 PM, zulu1 said:

Well sleep is not an OFP command (only came in with Arma 2 + UP)

Sleep is Arma-1 command and this is forum for Arma-1 🐵

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

×