Jump to content

Question about waypoints (routes) for ground forces.


Recommended Posts

Posted (edited)

Hi all.

 

Is it not possible to assign a new set of waypoints for the ground units.

 

I am using Controller.setTask(...) to set the waypoint for my units.

This works fine the 1st time i use it.

 

But when i want to assaign a new route it dosent work.

I even tried to Controller.popTask(...) . before assigning them a new set of waypoints. but no go.

 

So can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?

Edited by Lumax
Posted

I took a look at that. not much of help though.

 

My problem is not assigning a route to a group (random or not)

But rather assign a new route for the group which should replace the current assigned route.

 

So the question still remains unanswered:

can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?

Posted
So the question still remains unanswered:

can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?

 

You can assign a new task as many times and whenever you want. It doesn't matter if you pop the task or not because setTask effectively removes all previous tasks from the queue.

 

This is a snippet of a function from mist that assigns a given route to a group.

 

mist.goRoute =function(group, path)
local misTask = { 
	id = 'Mission', 
	params = { 
		route = { 
			points = mist.utils.deepCopy(path),
		},	
	},
}	
if type(group) == 'string' then
	group = Group.getByName(group)
end
local groupCon = group:getController()
if groupCon then
	groupCon:setTask(misTask)
	return true
end
...

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Thanks for clearing that up.

Guess i'll have to look at my code again. because setting a taks for the 1st time works but not the 2nd time :/

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...