actor patrolling. I'm missing something simple, please help :)
Let me explain first what I'm trying to do and then explain what I've done so far.
I have 12 actors(4 actors but 3 types of each).
I have 5 patterns of movement that 1 of each type of actor(so 4 at a time on the screen) will do. Each round i'll have those 4 actors do 1 of those 5 patterns of movement.
What is the easiest way to set up the patterns so that each round I can specify a pattern and have the appropriate actor follow his appropriate path route?
I need any of the 4 types to follow a corresponding path in a pattern.
I though that it would be best to make 4 more actors and call them waypoints(1,2,3,4) and program in the patterns under them and constain the 12(3 of each to 1 corresponding waypoint) badguys to them as a faster way than putting all 4 routes of all 5 patterns in all 12 actors resulting in 240 behaviors and rulls for them instead this should only be 4 routes in 5 patterns in 4 actors.
The problem I have is generating a path. I know how to move an actor from A to B. But A to B to C to D to E to F and then when finished repeat, until destroyed. I can't use timers for each redirection in the path as that would lead to probably thousands of timers if you multiply it out.
So to sum up, i want to move one actor in a pattern on the screen, then back to their starting point, and repeat.
Advice?
I have 12 actors(4 actors but 3 types of each).
I have 5 patterns of movement that 1 of each type of actor(so 4 at a time on the screen) will do. Each round i'll have those 4 actors do 1 of those 5 patterns of movement.
What is the easiest way to set up the patterns so that each round I can specify a pattern and have the appropriate actor follow his appropriate path route?
I need any of the 4 types to follow a corresponding path in a pattern.
I though that it would be best to make 4 more actors and call them waypoints(1,2,3,4) and program in the patterns under them and constain the 12(3 of each to 1 corresponding waypoint) badguys to them as a faster way than putting all 4 routes of all 5 patterns in all 12 actors resulting in 240 behaviors and rulls for them instead this should only be 4 routes in 5 patterns in 4 actors.
The problem I have is generating a path. I know how to move an actor from A to B. But A to B to C to D to E to F and then when finished repeat, until destroyed. I can't use timers for each redirection in the path as that would lead to probably thousands of timers if you multiply it out.
So to sum up, i want to move one actor in a pattern on the screen, then back to their starting point, and repeat.
Advice?
Comments
MOVE TO original waypoint.position.X/Y
- Jeff
If I had a patrol path. That's the problem, I don't know how to tell Gamesalad to move an actor to a location, then to another location, and keep going to various locations on the screen.
How do you do that without a timer?
You could try something like this:
Create 4 rules (this is just an example for a 4 way point setup where the actor moves in a square pattern).
Rule #1:
If self.position.X is 0 and self.position.Y is 0, interpolate self.position.X to 100.
Rule #2:
If self.position.X is 100 and self.position.Y is 0, interpolate self.position.y to 100.
Rule #3:
If self.position.X is 100 and self.position.Y is 100, interpolate self.position.x to 0.
Rule #4:
If self.position.X is 0 and self.position.Y is 100, interpolate self.position.Y to 0.
Change the interpolation durations to suit your needs.
- Jeff
Thanks Jeff, you got me going again!