Jump to content
Sign in to follow this  
thetrooper

Spawn a jet problem

Recommended Posts

Wonder if someone can help me please. I'm trying to spawn a sigle jet (To-199).

The following screen isn't working.

enGrp = createGroup east;
en1 = enGrp createUnit ["O_Plane_CAS_02_F",markerPos "p1",[],0,"CAN_COLLIDE"];
en1 setUnitRank "CAPTAIN";

It looks fine to me me though :confused:

I've tested this and for some reason the jet appears and disappears very quickly. Does Anyone know why, is this a bug?

Edited by TheTrooper

Share this post


Link to post
Share on other sites

Why do you want to spawn in a jet if you can get the same thing just by using the Editor?

Share this post


Link to post
Share on other sites

Hi theTrooper,

Try using bis_fnc_spawnvehicle

[markerPos "p1", 0, "O_Plane_CAS_02_F", EAST] call bis_fnc_spawnVehicle;

Share this post


Link to post
Share on other sites

createUnit it should be createvehicle but Das Attorneys answer is better as it comes with a crew I think

Share this post


Link to post
Share on other sites

You have to create a vehicle, not a unit.

example:

jet1 = createVehicle ["O_Plane_CAS_02_F", position player, [], 0, "FLY"];

  enGrp = createGroup east;
  jpilot1 = enGrp createUnit ["O_Pilot_F", markerPos "p1", [], 0, "FLY"];

   jpilot1 assignAsDriver jet1;
   jpilot1 moveInDriver jet1;

Share this post


Link to post
Share on other sites

I totally forgot, you get a return from the function:

_return = [markerPos "p1", 0, "O_Plane_CAS_02_F", EAST] call bis_fnc_spawnVehicle;

_return select 0 = vehicle
_return select 1 = crew
_return select 2 = group

Share this post


Link to post
Share on other sites
Why do you want to spawn in a jet if you can get the same thing just by using the Editor?

You don't deserve your signature.

:p

Share this post


Link to post
Share on other sites

So a scripting enthousiast should always do it the hard way instead of saving time by doing it in the editor, taking 3 seconds?

Share this post


Link to post
Share on other sites

Hi IT07. The main reason I need to spawn is because I don't want the opfor jet to be visible for a while. I tried a eneblesimulation, hide object approach but still appears on radar etc. Also to spawn cuts back on lag if there's a lot of units about. By the time a unit spawns then lots are dead by that time so its no problem. Otherwise, there's no problem creating it in editor but sometimes a spawn is required so accidents don't occur :) Hope that makes sense.

Share this post


Link to post
Share on other sites

Ah I see. Ok then I didn't say anything :P

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  

×