Jump to content
Sign in to follow this  
magnus28

simple mission editor question

Recommended Posts

Hello,

Was playing around the mission editor setting up scenarios.

Was wondering how to get 3 or 4 guys that you can control to spawn 'inside' the vehicle.

For example: I can choose non-playable, and choose a tank from 'empty' faction, and then create player and a group of playable ai 'outside' the vehicle and command them to get in.

But I want to make say a BMP-3, and start the mission with a section of infantry in the back, and all gunnery positions manned.

If I just create the vehicle, it starts mission with ai inside, but they are not controlled by anyone

Share this post


Link to post
Share on other sites

Try adding this to the Initialization of the BMP3.

{addSwitchableUnit _x} foreach units (group this);

Share this post


Link to post
Share on other sites

thanks.. where _x am i supposed to add a variable like 3, or positon name like gunner?

I guess i'm asking for a line that will max out the vehicle capacity, but have all the ai controllable

Share this post


Link to post
Share on other sites

That just makes all the units in the BMP's group switchable. Seems you need a bit more than that.

Here's a little demo for you that uses the functions BIS_fnc_spawnVehicle and BIS_fnc_spawnGroup to hopefully do what you want.

Download the demo... extract the folder and put it in your /MyDocuments/Arma 2/missions/ folder.

Open the mission in the editor and run it to see what it does.

Use Notepad or some other text editor to look at the scripts and see how they work.

Hope you can follow it. I've added lots of comments.

EDIT: Just realised that only the Cargo units were made switchable! To solve that problem add this line at the end of the vehicle spawn script.

{addSwitchableUnit _x;} foreach units (group _veh);

Edited by twirly

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  

×