Jump to content
Sign in to follow this  
Abumarwan

ARMA 3 Spawn AI in Multiplayer

Recommended Posts

I'd like to spawn a AH-99 BLACKFOOT with AI as a pilot, and with the AI maintaining these variables...

(driver this) disableAI "Target";

(driver this) disableAI "Autotarget";

This will make him ignore targets, and not fly around all over the place.

this doMove (getPosATL this);

this flyInHeight 400;

This will make him hover at 400 Altitude.

Can someone write me the full script to make this happen? Or give me some pointers?

So far I have been able to spawn the AH-99, but I can't seem to make it spawn with an AI in the pilot seat, and i defenetly can't make the AI keep those traits that I listed above..

please help asap

This is for my clans multiplayer mission...

Share this post


Link to post
Share on other sites

Ok, I've figured it out by using this script..

SpawnUnit_command = _this select 0;

SpawnUnit = "B_Helipilot_F" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", SpawnUnit_command]];

~0.01

deletevehicle SpawnUnit

SpawnUnit = nearestobject [[(getpos player select 0), (getpos player select 1), 50],"B_Helipilot_F"];

deletevehicle SpawnUnit

sleep 0.5

deletevehicle SpawnUnit

exit

That script spawns a pilot, and I can then order him to get into the chopper. But, how do I add the restrictions that he hovers at 400 altitude, and doesnt move or attack?

Share this post


Link to post
Share on other sites

That's a particularly odd script there. A strange mix of SQS, SQF and insanity.

_vec = [[(getpos player select 0), (getpos player select 1), 400], getDir player, "B_Heli_Attack_01_F", west] call BIS_fnc_spawnVehicle;

_heli = _vec select 0;
_heliCrew = _vec select 1;
_heliGroup = _vec select 2;
_heliDriver = driver _heli;

_heliGroup setBehaviour "CARELESS";

{_heliDriver disableAI _x} forEach ["Target", "Autotarget"];

_heli flyInHeight 400; // once it engages it'll hover lower unless you give it waypoints.

Share this post


Link to post
Share on other sites

Thanks for the help there. That script is almost what I need, however...

Can we make the Gunner seat empty? And Can we also make the chopper/pilot spawn infront of me on the ground?

The idea for this is that I want to be able to board the gunner position, take control of the chopper and fly to the engagement, then give control back to the AI, have him hover at 400 Altitude while I destroy enemies with my gun.

So far, it just spawns two AI inside a AH-99 at 400 altitude, and then they descend to 50 altitude for a hover. I cant seem to give them orders also... maybe because Im on Opfor though.

Share this post


Link to post
Share on other sites
kylania also dont mean to hijack how would you set a waypoint using that method ?

You can set a waypoint by Shift left clicking on the map.

After a few more tweaking, this script here is pretty much exactly what I need.

SpawnUnit_command = _this select 0;

SpawnUnit = "B_Helipilot_F" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", SpawnUnit_command]];

This spawns me an AI, who I can order around and tell to get into the AH99. The only thing I need help doing is making sure he never goes below 400 altitude, and that he always maintains a auto-hover unless I order him otherwise...

Is there anyway to do this?

Share this post


Link to post
Share on other sites
you can set a waypoint by shift left clicking on the map.

:suspect:

If you want to give the helcopter a waypoint you first have to give it a group name like kylania has done

_heliGroup = _vec select 2;

and then e.g.

_wp0 = _heliGroup addWaypoint [getMarkerPos "move1", 0];
_wp0 setWaypointType "MOVE";
_wp0 setWaypointSpeed "FULL";
_wp0 setWaypointBehaviour "SAFE"; 
_wp0 setWaypointCombatMode "YELLOW";

Edited by clydefrog

Share this post


Link to post
Share on other sites

Can I get some attention to me original question? Read my last few posts for an idea of where I'm at, and what I'm trying to figure out.

Share this post


Link to post
Share on other sites

To be honest your description of what you wanted changed so drastically each time something new was posted and you kept using your own crazy code instead of what people were telling you to try that I kinda stopped reading. You lost me at "I'm OPFOR but wanna gun the Blackfoot with a BLUFOR pilot". :)

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  

×