Jump to content
Sign in to follow this  
BLSmith2112

Spawning a flying plane with a trigger + getting shot down.

Recommended Posts

Just spawn plane and use command setDamage to destroy it. Or spawn AA infanty below it and make them knowsAbout plane.

This would be much easier then creating missiles and stuff. Also your code doesn't make any sense. :D

Share this post


Link to post
Share on other sites

AA units are pretty fast from my experience. If you set knowsAbout to 4 they would be even faster. You should try it.

Share this post


Link to post
Share on other sites

Hi, I read through the thread and have a few hints for you:

1. Problem is, if you really want to go into mission creation and want such "fancy" stuff there's almost no way but to learn the script language. Otherwise you'll always have to rely on someone doing your scripting.

2. I've seen the hideObject command before and the the enableSimulation too. Those would work if you would write correct script language.

3. I didn't use hideObject before and would also recommend to use the "spawnVehicle" function and "setDamage" command.

I'll write you some sample Code for spawning a plane (tiggered) and destroying it.

This is how you apply the Code:

1. Open the Arma3 Editor and create a player unit.

2. Create a common trigger and change activation to "Radio Alpha".

3. Copy/Paste the following Code into the OnAct tab of the trigger.

myVehicleArray = [position player,315,"B_Plane_CAS_01_F",WEST] call BIS_fnc_spawnVehicle;

null = [] spawn {
(myVehicleArray select 0) flyInHeight 300;
sleep 3;
(myVehicleArray select 0) setDamage 1;
};

With this code you can see a plane spawning in flying at your custom altitude (300m predefined) and being destroyed after your custom time setting (3 sec predefined).

edit: Actually the "flyInHeight" command doesn't work properly for me but to set the position manually with "setPosASL" also stalls the plane and it has to accelerate again. (both not satisfying)

And finally:

1. If you want to see your plane instead of the Wipeout I put in there you have to make sure your plane is actually in the game

(Addon or where you got it from) and the spawnVehicle function can find the configFile or whatever.

2. If you have any further questions ask right away but I can't tell you how to set up the missile launch manually.

3. I'll alter the code with additional enemy AA group spawning and shooting in the following post.

Edited by LeoB
tweeked the code and added hints

Share this post


Link to post
Share on other sites

So here's the script code with an additional AA-squad spawning in.

They don't shoot right away but they can shoot it down. Thats the best I could achieve. I also tried to enhance the behaviour with

the "hideObject" and "disableSimulation" commands, so the AA-group could target the aircraft before it starts flying (with "doTarget" command) but that won't work since the group can't target a "hidden" object obviously.

myVehicleArray = [position player,315,"B_Plane_CAS_01_F",WEST] call BIS_fnc_spawnVehicle;

null = [] spawn {
(myVehicleArray select 0) flyInHeight 300;
_guardAA =
[position player,opfor,configFile>>"CfgGroups">>"East">>"OPF_F">>"Infantry">>"OIA_InfTeam_AA"] call BIS_fnc_spawnGroup;
_guardAA reveal (myVehicleArray select 0);
};

Make sure the player is an Opfor guy, otherwise the spawned squad will engage you.

Since I'm also interested in the effect you want to achieve I only got the advice to look into the main campaign's scripting of one of the last missions. (If thats possible with un-pbo"ing"!?) There's the same effect scripted that you seek for.

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  

×