Jump to content
Sign in to follow this  
GunnDawg09

createVehicle command help

Recommended Posts

So I have a trigger set up to run once all of the opfor enemies are killed. Once that happends I have it execute support.sqf with, [] exec "attackhelo.sqf

inside of attackhelo.sqf I have this....

Helo1 = createVehicle ["AH1Z", [(getMarkerPos "hspawn")]];

Basically what I am trying to do is spawn a helicopter at the marker location named "hspawn" after all the enemies are killed, but it never spawns. Am I doing something wrong?

Share this post


Link to post
Share on other sites

Just some basics:

[] <-- these are used to define an Array.

Positions are stored as Arrays.

the getMarkerPos comand itself returns an Array (position).

example:

[123,4550,0]

so if you put getMarkerPos in brackets like this [getMarkerPos "hspawn"] you would get an nested array.

example:

[[123,4550,0]]

And that is something, which a command that requires an position can not handle.

Share this post


Link to post
Share on other sites

ok that seems to work great, just one problem... The example makes the vehicle spawn right on the players position, rather than a marker position where I want it to spawn...

Examples Code: _helo = "AH1Z" createVehicle (position player)

I tried to do this: _helo = "AH1Z" createVehicle [(getMarkerPos "hspawn")];

With my code it didnt work, nothing spawned, how would I make it spawn at my marker?

---------- Post added at 02:49 AM ---------- Previous post was at 02:45 AM ----------

Just some basics:

[] <-- these are used to define an Array.

Positions are stored as Arrays.

the getMarkerPos comand itself returns an Array (position).

example:

[123,4550,0]

so if you put getMarkerPos in brackets like this [getMarkerPos "hspawn"] you would get an nested array.

example:

[[123,4550,0]]

And that is something, which a command that requires an position can not handle.

Thanks :)

I changed it to: _helo = "AH1Z" createVehicle (getMarkerPos "hspawn");

and it worked fine, but how would I declare which direction things spawn?

Share this post


Link to post
Share on other sites

Use the "setDir" command.

Share this post


Link to post
Share on other sites
Use the "setDir" command.

Can you use this to force the Direction an helicopter lands at an 'H' or the direction a vehicle faces having reached a waypoint?

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  

×