Jump to content
Sign in to follow this  
Joe98

How to force a soldier to get in a car in position 1 - using waypoints

Recommended Posts

There is a car named: Civilian - Cars - Offroad.

 

I have tested and this car has 6 positions. There is one driver and 5 cargo positions. (Surprisingly the driver is position 6 and the front passenger is position 5.)

 

I place an empty car on the map and name it car1. I place 2 men on the map and position them a long way from the car.

 

In the init of man1: this MoveInDriver car1;
In the init of man2: this MoveInCargo [car1,1];

 

The mission starts and the driver is behind the wheel and the passenger is in position 1 in the vehicle

If I play with this MoveInCargo [car1,1]; I can force the man to start in any of the other 4 cargo positions.

 

All is well so far. Except when I use waypoints.

 

This time I start the mission with the driver already behind the wheel of the car. The car has a Load waypoint and then a Move waypoint.

The soldier starts down the road a bit. He has a Move waypoint then a Get In waypoint.

 

The car’s Load waypoint and the soldier’s Get In waypoint are adjacent and I have connected them.

 

Start the mission and the car drives to the Load waypoint and stops and waits for the soldier. The soldier boards the car and the car continues to it’s Move waypoint.

This works perfectly. Except - I want the soldier to get in at position1 in the car. That way he can shoot out the back.

 

He always gets in at position 5. How can I force him to get in at position1?

 

I tried using this MoveInCargo [car1,1]; in the on Activation of his Get In waypoint but it does not work.

 

.

 

 

 

Share this post


Link to post
Share on other sites

first u should not use this in the "On Activation"-field of the waypoint if the desired unit is not the group leader. The reason is this wiki entry:

2D Editor: Waypoints

On Act(ivation)

Another script code block, executed when the waypoint is completed. Within this block, this refers to the group leader, and thisList refers to an array containing each unit in the group. Any expressions in the On Act. field must return nothing, or an error message will prevent the waypoint dialogue from closing.

 

 u should use the name of the unit instead.

 

another hint is the note from killzonekid of the wiki entry for movinCargo. It suggests to try this:

unit1 assignAsCargoIndex [heli, 3];
unit1 moveInCargo heli;

 hope that helps.

Share this post


Link to post
Share on other sites

Hi,

 

Maybe you can spawn invisible entities in the others places in the car, like that, you can't see the others entities, because invisible, and the soldier 2 only can get in and take the place you want.

 

You still can delete all the invisible entites when soldier 2 is inside the car if you want.

Share this post


Link to post
Share on other sites

Hi,

 

Maybe you can spawn invisible entities in the others places in the car, like that, you can't see the others entities, because invisible, and the soldier 2 only can get in and take the place you want.

 

 

 

The driver is in position 6.

 

Actually I tested by placing a soldier in position 5 - the front passenger seat.  Which means my soldier cannot get in at position 5.  

 

As expected my soldier did not get in because position 5 was taken. The car stopped and then drove away.  Which means I have to force him to get into another position.

 

.

 

 

.

Share this post


Link to post
Share on other sites

Hey,

 

 

 

As expected my soldier did not get in because position 5 was taken. The car stopped and then drove away.

 

Surely because they're not in the same group.

 

When I make some missions, I've seen that different units that don't belongs to the same group can't get in the same vehicle, or if they are already in the same vehicle, they can't take any choices or giving any orders.

 

Maybe you can try by adding each units, even the invisible entities, to the same group and after that, there shouldn't be any reason they don't take the last soldier. After that, just delete the invisible entities.

Share this post


Link to post
Share on other sites

Keep the seat free:

_car lockCargo [_SeatNumber,true];

Unlock seat and move unit in:

_car lockCargo [_SeatNumber,false];
_unit assignAsCargoIndex [_car,_SeatNumber];
[_unit] allowGetIn true;
[_unit] orderGetIn true;

Cheers

Share this post


Link to post
Share on other sites

I found a solution.

 

I tested everything in both Arma 2 and Arma 3.  Everything fails in both games and therefore there is no bug in Arma 3 :) 

 

Instead I had to use a work around.

 

Place the car on the map ( car1 ) and give it a Load waypoint and then a Move waypoint.

 

Place a soldier on the map ( green1 )  and give it Move waypoint and then another Move waypoint.   The purpose of the second waypoint is because if it all fails he will continue to the next waypoint.

 

Synch the car's Load waypoint with the soldier's first Move waypoint.

 

Set the start locations so the car will always arrive first.

 

In the soldier's first Move waypoint, in the OnAct  type:  green1  MoveInCargo   [car1,1];

 

The car will drive to the Load waypoint and stop. The soldier will walk to it's first Move waypoint - and then suddenly appear in the correct location in the car!

 

With the soldier loaded the car drives off.

.

.

 

 

 

 

 

 

 

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  

×