Jump to content
Sign in to follow this  
dirtynorf

execVM variable trouble

Recommended Posts

So, I am trying to make a vehicle move to a marker position. I'm using execVM in the vehicle init to move it to a pre-determined marker. The marker is called "planespot1" in the NAME field and when I tried to debug the marker position get, the value returned was "any" and so I am not sure its picking the marker up.

 

How can I get a marker name into a script from execVM and then use its position?

 

Also the _plane variable does work (the engine turns on)

_plane = _this select 0;
marker = _this select 1;
_altitude = _this select 2;

_markerPos = getMarkerPos marker;
//debug bit
hint format ["%1", (_markerPos select 0)];


if ( (typename _plane != "PLANE") or (typename marker != "MARKER") ) exitwith {
	hintSilent "Invalid Parameters parsed";
};

sleep 1;

_plane allowDamage false;
_plane setVectorUp [(_markerPos select 0), (_markerPos select 1), _altitude];
_plane engineOn true;

Share this post


Link to post
Share on other sites

[plane,"markername",50] execVM

Share this post


Link to post
Share on other sites

Yes typeName "Plane" does not even exist.

It should/could either be

typeName _plane != "Object"

OR

! _plane isKindOf "Air"

And what is that:

_plane setVectorUp [(_markerPos select 0), (_markerPos select 1), _altitude];

It seems You expect setVectorUp to do something else than it actually does.

https://community.bistudio.com/wiki/setVectorUp

Try setPosATL instead.

Share this post


Link to post
Share on other sites

Yes before I posted I:

1) Had no idea what typename actually did

2) Didn't properly understand setVectorUp.

 

Thank you for the replies and the lesson in looking up everything on the wiki.

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  

×