Printable Version of Topic

Click here to view this topic in its original format

Armed Assault Info Forums _ Mission Editing & Scripting _ moveInDriver not triggering

Posted by: crockid5 Jan 14 2014, 18:53

If I do

CODE
player moveInDriver _vehicle;

Then the player will move into the driver seat of "_vehicle".

However, if I do

CODE
_guy = "TK_INS_Soldier_2_EP1" createUnit [getPos _vehicle, _group];
_guy moveInDriver _vehicle;


Then nothing happens, the guy doesn't move into the front seat of the vehicle, he just spawns next to it. Does anyone know why?

Posted by: D@V£ Jan 14 2014, 18:59

Try adding a delay between spawning the unit and moving it into the vehicle. The createunit command is pretty tough on the engine.

Failing that, it's possible that the newly spawned soldier isn't being recognized as _guy. You should be able to fix this using the http://community.bistudio.com/wiki/nearestObject command.

Posted by: crockid5 Jan 14 2014, 23:40

QUOTE(D@V£ @ Jan 14 2014, 17:59) *
Try adding a delay between spawning the unit and moving it into the vehicle. The createunit command is pretty tough on the engine.

Failing that, it's possible that the newly spawned soldier isn't being recognized as _guy. You should be able to fix this using the http://community.bistudio.com/wiki/nearestObject command.


None of them work :/


Posted by: D@V£ Jan 15 2014, 00:17

Try:

CODE
_guy = "TK_INS_Soldier_2_EP1" createUnit [getPos _vehicle, _group, "_guy = this", 0.5, private];

To create the unit. Or this:
CODE
_guy = "TK_INS_Soldier_2_EP1" createUnit [getPos _vehicle, _group, "_guy = this; this moveindriver _vehicle", 0.5, private];

Which should create the unit and move it into the drivers seat, but like I said, createunit can be a bit cpu intensive, so can sometimes be a bit buggy.

Also, make sure _vehicle is properly defined in your script. (Remember that anything with an underscore before it is local, so defining _vehicle in another script won't work)

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)