Jump to content
Sign in to follow this  
SovietReign

createVehicle Problem

Recommended Posts

So I'm trying to make a mission that has a similar function to Xeno's domination. I want it so that when I complete an objective, a vehicle spawns (and respawns if destroyed). I got some code but it won't work for some strange reason. In the "On act" of the trigger I have

_heli1 = "heli1" createVehicle ["MH9_Base_F", getMarkerPos "heli1sp", [], 0, "NONE"]; _heli1 = [this, 5, 1000] execVM "vehicle.sqf"; hint "Congratulations, your team has earned an MH-9. It is now available at base!";

The condition is Obj_1, and it works since the hint fires off but the vehicle won't spawn.

Please help me out.

Thanks!

Share this post


Link to post
Share on other sites

You need to look at createvehicle array: http://community.bistudio.com/wiki/createVehicle_array

_heli1 = createVehicle ["B_MH9_F", getMarkerPos "heli1sp", [], 0, "NONE"]; 
_heli1 = [this, 5, 1000] execVM "vehicle.sqf";
hint "Congratulations, your team has earned an MH-9. It is now available at base!";

Edited by cobra4v320

Share this post


Link to post
Share on other sites

When using createVehicle array there is no preceding string argument.

_heli1 = createVehicle ["[font=Verdana]B_MH9_F[/font]", getMarkerPos "heli1sp", [], 0, "NONE"];

I assume vehicle.sqf is the vehicular respawn script?

Well you are using it wrong.

Try

[color=#EEEEEE][[/color]_heli1[color=#EEEEEE], 5, 1000] execVM "vehicle.sqf";
[/color]

Share this post


Link to post
Share on other sites

You guys are gods.

Still have two problems though.

I assume vehicle.sqf is the vehicular respawn script?

Well you are using it wrong.

Try

When I enter that it tells me that "Local variable in Global slot" or something along those lines.

Also, how can I get the helicopter to spawn rotated 90 degrees?

I tried rotating both the trigger and marker it spawns on with no luck.

Share this post


Link to post
Share on other sites

Yeah you just need to name your helicopter, so instead of _heli1 use heli1. Make sense? _heli1 is local and heli1 is global.

Share this post


Link to post
Share on other sites
hold down shift key

I need to rotate the vehicle through code don't I?

Since the vehicle is spawned through a trigger and isn't anywhere on the map itself.

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  

×