Jump to content
Sign in to follow this  
Impavido

New WP being followed by AI Infantry but not vehicle?

Recommended Posts

In-script, I create a group on the east team.

I then spawn vehicles and add the crew. At the bottom of the script, I add waytpoints for the group that gets the position of a game logic named WHQLogic. (highlighted in RED)

When I use a similar script to spawn infantry, they are created and follow the WP just fine. But if I spawn ARMOR, the vehicles just sit there with engines idle.

What is the nature of this problem? :confused:

_veh1 = createVehicle [_class, _start, [], 0, "none"];
~.1
_veh2 = createVehicle [_class, _start2, [], 0, "none"];
~.1

_gun1 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_drive1 = AQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_comm1 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_gun1 assignAsgunner _veh1;
_gun1 moveingunner _veh1;
_comm1 assignascommander _veh1;
_comm1 moveincommander _veh1;
_drive1 assignAsdriver _veh1;
_drive1 moveindriver _veh1;
_gun1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_drive1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_comm1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];

_gun2 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_drive2 = AQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_comm2 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_gun2 assignAsgunner _veh2;
_gun2 moveingunner _veh2;
_comm2 assignascommander _veh2;
_comm2 moveincommander _veh2;
_drive2 assignAsdriver _veh2;
_drive2 moveindriver _veh2;
_gun2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_drive2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_comm2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];

~1
[color="Red"]
_WHQ = (getpos WHQlogic)

_AS1WP = HQAtt1 addwaypoint [_WHQ,50]
_AS1WP setwaypointtype "SAD"[/color]

Share this post


Link to post
Share on other sites

HQAtt1 and AQAtt1 are group names I take it? I don't know if you can define a group like that, you may have to use

group = createGroup West

to create the group and its name, then use

group addVehicle vehicle

to add the vehicles/units to it, and THEN add the waypoint to the group. That or I'm totally wrong.

Share this post


Link to post
Share on other sites
HQAtt1 and AQAtt1 are group names I take it? I don't know if you can define a group like that, you may have to use

group = createGroup East

to create the group and its name, then use

group addVehicle vehicle

to add the vehicles/units to it, and THEN add the waypoint to the group. That or I'm totally wrong.

I already have created the group using creategroup. I put that ~1 delay before the creation of the WP thinking it would help, but it didnt.

Share this post


Link to post
Share on other sites

Maybe try adding the drivers to the HQAtt1 group instead of the AQAtt1 group. They may be in the same vehicle as the commander/gunner... but 1) you arent giving them the waypoints you're giving the commander... so he can't command the driver to move.

Share this post


Link to post
Share on other sites
Maybe try adding the drivers to the HQAtt1 group instead of the AQAtt1 group. They may be in the same vehicle as the commander/gunner... but 1) you arent giving them the waypoints you're giving the commander... so he can't command the driver to move.

*Face Palm

Lol. Thx JDog! :p

Share this post


Link to post
Share on other sites

I think J Dog your right they should all be the same group, so that it might be something like this

_grp = createGroup East;



_veh1 = createVehicle [_class, _start, [], 0, "none"];
_veh2 = createVehicle [_class, _start2, [], 0, "none"];



_gun1 = _grp createUnit ["RU_Soldier_Crew", [0,0,1], [], 0, "NONE"];
_gun1 assignAsgunner _veh1;
_gun1 moveingunner _veh1;

_drive1 = _grp createUnit ["RU_Soldier_Crew", [0,0,2] [], 0, "NONE"];
_drive1 assignAsdriver _veh1;
_drive1 moveindriver _veh1;



_comm1 = _grp createUnit ["RU_Soldier_Crew", [0,0,3], [], 0, "NONE"];
_comm1 assignascommander _veh1;
_comm1 moveincommander _veh1;

_gun1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_drive1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_comm1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];




_gun2 = _grp createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_gun2 assignAsgunner _veh2;
_gun2 moveingunner _veh2;

_drive2 = _grp createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_drive2 assignAsdriver _veh2;
_drive2 moveindriver _veh2;

_comm2 = -grp createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"];
_comm2 assignascommander _veh2;
_comm2 moveincommander _veh2;

_gun2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_drive2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];
_comm2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}];


_WHQ = (getpos WHQlogic)

_WP0 = _grp addwaypoint [_WHQ,50]
_WP0 setwaypointtype "SAD"

there is also no need to use assignas.... and moveIn.... together, the first annimates the get in order the second does not, use one or the other depending on the requirements.

Oh sorry you have it....still I dont think you need both assignas and moveIn together though

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  

×