Jump to content
Sign in to follow this  
Guest

cant get spawned units to follow new waypoints

Recommended Posts

Guest

Driving me nuts here, dont know wtf im doing wrong lol

simply spawning a new group, then adding a waypoint to them, they refuse to goto the dang waypoint...

heres the code, its activated from a radio call

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

Town4ArtyPatrol1 = createGroup east

Town4ArtyPatrol1 createUnit ["SoldierEB",getMarkerPos "Town4ArtyPosOnePatrol", [], 0, "FORM"]

Town4ArtyPatrol1 createUnit ["SoldierEB",getMarkerPos "Town4ArtyPosOnePatrol", [], 0, "FORM"]

_waypoint0 = Town4ArtyPatrol1 addWaypoint [getMarkerPos "Town4ArtyPosOnePatrolwp0", 0]

_waypoint0 setWaypointType "MOVE"

Really appreciate a hand here, comref is kinda not helping me here...

Share this post


Link to post
Share on other sites
Guest

being the Comref is so kind to describe how to use the new creation of waypoints for a spawned group, just found the problem (unreal)

If a leader is not designated for the group thru selectLeader, they dont go anywhere, as soon as I made a unit in the new group leader, they now follow the waypoint plan...

sheesh... what a waste of time to find this one

Share this post


Link to post
Share on other sites

That might have something to do with the cause of the problem,

but to be honest, i have generated groups like this without assigning a leader and they do follow the waypoints.

I have however used this syntax to create the units:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

type createUnit [position, group, init*, skill*, rank*]

So the syntax you used

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

group createUnit [type, position, markers, placement, special]

might demand to have a leader assigned,

maybe because no rank is stated in that syntax and when you place a group in the editor the leader is then the highest ranking member.

With just createunit, the leader is normally the first unit you spawn, as far as i remember, so selectLeader just changes that.

Are you sure you have already east units in the map?

If not you would have to create an AI center before,but i'm sure you are aware of that and it might not actually be the core of the problem anyway.

Share this post


Link to post
Share on other sites
Guest

your probably right, I used the syntax from creatUnitArray new command from Armed assault, which doesent include usage of the skill, init, etc - wierd tho, because both createUnitArray and createUnit both use the command 'createUnit' - although different elements provided in the array, dont know if they can be combined, ill prolly just go with the form uve provided to be safe tho -

gotcha on the part about having the units for that side in the sqm already, that, at least, was provided in the description for createGroup, so made sure east was present before hand.

thanks for the heads up on that Charonos

Share this post


Link to post
Share on other sites
Guest

Of course had to waste more time and see what this really is -

Indeed with the syntax usage for Armas new command CreatUnitArray, one must set a leader to get that newly created group moving on a newly created waypoint plan, everything works fine from there, tried it with a group of 5 units, and killed a few leaders while they were on their plan, the other units took over the new leader slot fine, no probs. nice to know anyhow, as there are a few key features for CreatUnitArray, like being able to input multiple marker positions in there and it will randomly place each unit at one of them, although its kind of restricting in that on the flip side, if this syntax type is used, u cant set skill, rank, init - one would think theyd just combine the two, but guess not.

Share this post


Link to post
Share on other sites
Guest

ya lol

your right, im sure one can just script in setting skill, rank for those units after the spawn, didnt really think of that initally when I discovered this..

ah well, more time consuming than desired to figure this out, but this spawn stuff is kinda cool, in this test, its a wide open feild with nothing, then all the sudden, theres a patrol group, an artillery peice, plus a crewman that runs up and mans arty peice - just wish that dang wiki would be a little more specific when dealing with new commands that are dependant on certain criteria set in other commands for them to function...

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  

×