Giving orders.
by Christian Rademan · in Torque Game Builder · 10/18/2007 (4:44 am) · 3 replies
I want to give my game objects orders i.e
If they errive at a goal they must execute the order given them.
How can I do this?
If they errive at a goal they must execute the order given them.
How can I do this?
#2
As far as giving them orders -- all really depends on what an 'order' is ... if it's "goto the next location", then just assign a 'next location' field to the 'goal' and have the object inspect this and go there ... if it's more complex then that ... then you'll have to be more specific perhaps ...
Unless Dmitriy's 3 examples were all you needed to get you in the right direction ...
10/19/2007 (12:06 pm)
Not quite sure the question really makes sense -- how do they 'arrive at the goal'? Are you using a path system? or 'moveTo'?As far as giving them orders -- all really depends on what an 'order' is ... if it's "goto the next location", then just assign a 'next location' field to the 'goal' and have the object inspect this and go there ... if it's more complex then that ... then you'll have to be more specific perhaps ...
Unless Dmitriy's 3 examples were all you needed to get you in the right direction ...
#3
I just gave each object a onReachedgoal method and an order e.g "fireMissile" or "Patrol" or whatever. Then when it has reached a goal it just checks which order has been given and executes it.
10/22/2007 (1:11 am)
Thanks. I solved the problem. I just gave each object a onReachedgoal method and an order e.g "fireMissile" or "Patrol" or whatever. Then when it has reached a goal it just checks which order has been given and executes it.
Torque Owner Dmitriy Stukalov
1. t2dSceneObject::onPositionTarget()
2. t2dTrigger::onEnter()
3. Collision detection