Jump to content
Sign in to follow this  
Monsada

dissembark except driver and gunner

Recommended Posts

Hi all,

I am worried with a problem, I am doing an script for IA and want the group exit vehicle when near objective. I trid this:

{
 If (_x!= gunner _vehicle && _x!= driver _vehicle) then	{
    _x leaveVehicle _vehicle;
 };							
} foreach crew _vehicle;

the problem is gunner returns a relative name to vehicle

_vehicle = A_1_1

gunner _vehicle = A_1_1G

driver _vehicle = A_1_1D

but crew returns another names: example

1_2_3

1_2_4

1_2_5

how to identify de gunner and driver using crew for avoiding disembark gunner and driver?

(corrected _x, thankhs nuxil)

Edited by Monsada

Share this post


Link to post
Share on other sites

if you look on your if statment you see its wrong. the x is missing a underscore x -> _x

If (x!= gunner _vehicle && x!= driver _vehicle) then	{

If (_x != gunner _vehicle && _x != driver _vehicle) then	{

also. i would not use leaveVehicle. even tho it unassigns them. but you never know..

so put in a simple action. getout or eject . like

{
If (_x != gunner _vehicle && _x != driver _vehicle) then	
{
	unassignVehicle _x;
	_x action ["getOut", vehicle _x] ;
};							
} foreach crew _vehicle;

Edited by nuxil

Share this post


Link to post
Share on other sites

An alternative without the if:

{
    unassignVehicle _x;
    _x action ["getOut", _vehicle];
} forEach ((crew _vehicle) - [driver _vehicle, gunner _vehicle]);

Share this post


Link to post
Share on other sites

Don't you find they still get back in?

I have to use

[_x] allowGetIn false;

placed after the action command.

Share this post


Link to post
Share on other sites

They do get back in probably because they're still part of the same group.

Share this post


Link to post
Share on other sites

Thanks for all, it runs ok ;)

Now I had one doubt more, I need to know the capacity of a vehicle.

How can I get it? How can I know if a vehicle is full?

Share this post


Link to post
Share on other sites

Thanks Deadfast!! it runs ok.

Another trouble, now I want to order a group of IA to "MoveToCargo", the problem is that IA disapear and apear in vehicle as cargo.

I tried:

_x moveinCargo _vehicle;

_x action ["getInCargo", _vehicle];

and

_x action ["moveToCargo", _vehicle];

but two first moves instantly, and the last, _x action ["moveToCargo", _vehicle]; does nothing.

How can i do for the IA moves to vehicle and then gett in it?

Share this post


Link to post
Share on other sites

maybe something like

_vehicle = car;
{
_x assignAsCargo _vehicle;
[_x] allowGetIn true;
[_x] orderGetIn true
} foreach (units group AI);

in this example, AI is the name of the group leader of the Ai squad.

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  

×