Uhmmm i'm trying to write a RTS type of game for a school assignment and i'm trying to make a tank making it's way to a specified location by following through a calculated shortest path algorithm.
To do that, i got 3 target entities called the gStartNode, gGoalNode and gDestination.
When the player clicked on a specific unblocked grid on the map,
- The gStartNode entity basically get the tank's starting position.
- The gGoalNode entity will be the specified position goal for the tank.
- The gDestination entity will traverse along the calculated shortest path, grid by grid until it reaches the gGoalNode's location(goal destination).
So basically the tank will try to follow the gDestination entity which will be leading it grid by grid until it reaches the final grid.
I did the ENABLE_SCAN on the gDestination entity in which at each EVENT_SCAN it will move to the next intended grid. Therefore at each EVENT_FRAME of the tank entity, i do a c_scan to scan for all entities with the ENABLED_SCAN on.
This works fine if it's just a single tank. But with an array of tanks and gDestination entities, if i do group movement to a single point, once two gDestination e.g. destA and destB moves toward a single point, it will be scanned by the closest distance tank e.g. tankA and both destA and destB will move to the next grid. thus making tankB's path-following movement haywire!
Now the question is, is there any way i could make c_scan detect a specific ENABLE_SCAN enabled entity? or anyway i could check if a certain gDestination entity belongs to a specific tank in it's EVENT_SCAN function?
Sorry for the long explaintion but i just want to dish out as much information as possible and hope you guys can get a better understanding of the whole picture. :)) Thank you in advance!
Last edited by CaedLucin; 08/07/10 04:03.