Jump to content
Sign in to follow this  
mikeyb118

Script for a Medic in a static Group

Recommended Posts

I use disableAI "MOVE" too much for setting AI units in defensive positions, primarily because I hate it when units wonder off. When I put medics in my static groups and allow them to move they go off alone, engage the enemy and die. So I use this script to keep the medic safe at his marker until his friends are hurt.

_array = [p1, p2, p3, p4, p5, p6];

while {alive Medic1} do {
for [{_i=0}, {_i < count _array}, {_i=_i+1}] do {
if (((damage (_array select _i)) > 0.1) and ((damage (_array select _i)) < 0.99)) then 
{
	Medic1 enableAI "MOVE";
	Medic1 setunitpos "MIDDLE";
	sleep 30;
	Medic1 domove (getMarkerPos "Medic1sp");
	sleep 10;
	Medic1 disableAI "MOVE";
	Medic1 setunitpos "DOWN";
} 
else 
{
	sleep 5;
};
};
};

I want to create an ammunition "runner" script for a similar situation. The script should scan the selected units for magazines belonging to their primary weapon. When magazines run below a specified level, I want my runner to go to an ammunition box, take that type of magazine and then go to the unit that is running low to give or simulate giving some magazines. I've read through the wiki and a few threads but I still don't know how to approach this.

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  

×