Jump to content
Sign in to follow this  
1para{god-father}

AI walk to vehicle and get in

Recommended Posts

I am trying to get a AI to walk to a vehicle and get in but it just does not seem to get in, i can get him to walk to the VIPwalk marker but that is it ?

using this in my script

_wp = _grpVIP addWaypoint [getMarkerPos "vipwalk", 0];
_wp setWaypointType "MOVE";

_wp1 = _grpVIP addWaypoint [getMarkerPos "vipgetin", 0];
_wp1 setWaypointType "GETIN";

Share this post


Link to post
Share on other sites

Not sure about the marker bit, but I dont think a "Get in" waypoint is enough.

If you name your AI individually, you can do the following:

Can you place the waypoint down on the map in the editor? If so, in the on activation line of the waypoint write "X (AI's name) moveInDriver Car1" (or whatever the name is).

This is the way I always do it, and it works well.

---------- Post added at 11:20 AM ---------- Previous post was at 11:19 AM ----------

If there is more than one in the group, then for the passengers you write" Man2 (or whatever) MoveInCargo Car1"

Share this post


Link to post
Share on other sites

Thanks , but it is all in a script so need another workaround.

Anyone help getting a guy in a Vehicle via script ?

Thanks

Share this post


Link to post
Share on other sites

Try using "GETIN NEAREST" it worked for me

_wp1=_group addWaypoint [getpos _vehicle,0];
_wp1 setWaypointType "GETIN NEAREST";

Share this post


Link to post
Share on other sites

If you can't use "get in nearest" (take the wrong vehicle i.e.), you do need "get in". In the editor this means you have to place the wp on the vehicle in question, not near it. How to achieve this in scripting, I don't know, I've never tried. But syncronizeObjectsAdd might be what does i? Dunno.

Be careful with pre assigned roles. Everything is always good and dandy when you're looking, and go straight to hell (someone gets killed by freak accidents you wouldn't believe) when it's actually playing.

Share this post


Link to post
Share on other sites

Well they just walk to the car and stand there and do not get in.

_wp1= _grpVIP addWaypoint [getpos pmccar,0];
       _wp1 setWaypointType "GETIN NEAREST";

Share this post


Link to post
Share on other sites

Did you try this?

You may also try AssignAsDriver with orderGetIn in a setWaypointStatements

_wp1 = _grpVIP addWaypoint [getpos pmccar,0];
_wp1 setWaypointStatements ["true", "VIP assignAsDriver pmccar; [VIP] orderGetIn true;"];

You don't even need a waypoint for that to work.

VIP assignasdriver thecar; 
[VIP] ordergetin true;

If you just want him to get in as a passenger then it should be VIP assignAsCargo pmccar.

Alternatively, place a unit down on the map and put something like this in his init:

 GetInWPGrp = group this; deleteVehicle this;

Now give this unit a physical editor waypoint to get into the vehicle (he will not be present in game because we deleted him). Then when you want the VIP guy to get into the vehicle, do something like:

_grpVIP copyWaypoints GetInWPGrp;

Edited by 2nd Ranger

Share this post


Link to post
Share on other sites

you could try this..

At the point the unit needs to get into the car, use this code.

unit doMove getPos car; // Unit do move to the position of the car
waitUntil {unit distance car <= 10; // Wait Until unit is less than or equal to 10 meters away from car
unit assignAsCargo car; // Change cargo to things like gunner or driver if you dont want cargo
[unit] orderGetIn true; // Order's the unit to get in whatever vehicle he is assigned to.
waintUntil {unitReady unit}; // Waits until the unit is ready
driver car doMove getMarkerPos "endofisland"; // create a marker with the name "endofisland" and the driver of car will drive to that marker when unit has gotten into the car

Most of the code i mentioned has already been mentioned above.

It's just trial and error, play around with it. So many different ways to get things done.

Good luck.

ta

Share this post


Link to post
Share on other sites

Thanks guys got it working now !!!

Used a combination of all suggestion and it works :)

this seemed to work best

_wp1 setWaypointStatements ["true", "VIP assignAsDriver pmccar; [VIP] orderGetIn true;"];

Share this post


Link to post
Share on other sites

Pleasure =)

Great community this is, glad to be a part of it.

Have fun. (gonna get the Take On Helicopters preview...)

ta

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  

×