Jump to content
Sign in to follow this  
Franklin

Dynamicly created group with waypoints

Recommended Posts

I'm having a bit of trouble with the waypoint part of this script. I have no issues getting the group to spawn, and they move off to the first waypoint without any problem. How do i go about getting them to move on to the next waypoint, and the next without delay?

_swarm2 = [getMarkerPos "cave", east, ["TK_INS_Warlord_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_AT_EP1","TK_INS_Soldier_2_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AR_EP1","TK_INS_Soldier_Sniper_EP1"]] call BIS_fnc_spawnGroup;

_swarm2 setCombatMode "RED";

_swarm2 setBehaviour "aware";

_swarm2 setSpeedMode "NORMAL";

_waypoint6 = _swarm2 addWaypoint [getmarkerpos "wp6",0];

_waypoint6 setWaypointType "Move";

_waypoint6 setWaypointBehaviour "AWARE"";

_waypoint6 setwaypointcombatmode "RED";

_waypoint6 setWaypointSpeed "NORMAL";

_waypoint7 = _swarm2 addWaypoint [getmarkerpos "wp7",0];

_waypoint7 setWaypointType "Move";

_waypoint7 setWaypointBehaviour "UNCHANGED";

_waypoint7 setwaypointcombatmode "NO CHANGE";

_waypoint7 setWaypointSpeed "UNCHANGED";

_waypoint8 = _swarm2 addWaypoint [getmarkerpos "wp8",0];

_waypoint8 setWaypointType "Move";

_waypoint8 setWaypointBehaviour "UNCHANGED";

_waypoint8 setwaypointcombatmode "NO CHANGE";

_waypoint8 setWaypointSpeed "UNCHANGED";

_waypoint9 = _swarm2 addWaypoint [getmarkerpos "wp9",0];

_waypoint9 setWaypointType "Move";

_waypoint9 setWaypointBehaviour "UNCHANGED";

_waypoint9 setwaypointcombatmode "NO CHANGE";

_waypoint9 setWaypointSpeed "UNCHANGED";

Share this post


Link to post
Share on other sites

Without delay? How long is the delay? It is normal for a few seconds to pass while the AI calculates the route.

I don't think you need the NO CHANGE and UNCHANGED statements, but i'm not sure. (Think waypoints work that way if you don't set it).

You sure they all spawn; there's several typos in your classnames. The third has a space between INS_ and Soldier, the fifth has a space between Soldi and er_EP1. The last has a space between the TK_ and INS. The 3rd last has an extra space in front.

Share this post


Link to post
Share on other sites

odd, but whats even more odd is that they do all spawn... I'll fix that. However my actual problem is the group moves to its first waypoint, and then just sits there, never moving again. How do I make them keep on moving?

Share this post


Link to post
Share on other sites

Try writing MOVE instead of Move. I've had some troubles with waypoints too. If they can't find a way to a waypoint (even though there is one, in human eyes) they just stop.

Another problem I had was that when I had set the behaviour too low (safe for example) the unit would freeze whenever it saw something like an UAV even though the unit itself was a civilian or for that matter an independent friendly to the UAV.

Share this post


Link to post
Share on other sites

You may want to remove the extra quote at the end of this line

_

waypoint6 setWaypointBehaviour "AWARE"";

Are you using -showScriptErrors placed in the target line of the games short cut to display any errors?

Share this post


Link to post
Share on other sites

No, I'm not using the -showscripterrors param although it possibly could have told me what was wrong with this script seeing the comments you guys are making...

I'll give it a go and see what happens.

EDIT: I made the corrections to change "Move" to "MOVE", and took the second quotation out of the "AWARE" part, and its working fine. They move to all waypoints as intended. In regards to the typos in the classnames, in all honesty i don't know where that came from... I went to make the corrections pointed out in regards to those, and the errors are not in the script at all. Thanks to all for the help, even if it was simply pointing out minor typos... I'm gonna go hide for a while now :P

Edited by franklin

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  

×