Help with RTS AI

For questions about using Classic.

Post » Thu Apr 14, 2011 11:30 am

Hi all,
I was hoping I could find a solution to a problem I am having with trying to create a intelligent AI. I am not sure if the RTS behavior is the way to go here.
Basically, I am creating a top down game set in space, and I am up to creating a AI that will expand its own empire. I have everything done here, the AI will go to the planet, colonize it and then set it to their team. What I am having trouble with is how to tell the AI how to go to the closest planet to their homeworld, rather than going to a random planet in the rather large system, ending up in jumbled masses.
Is there a way to tell the RTS behavior to go to the closest planet? What events would I need to use to do this?

Thanks in advance :)
B
8
S
2
G
2
Posts: 144
Reputation: 1,588

Post » Thu Apr 14, 2011 2:49 pm

[code:w2utr7pd]+ MouseKeyboard: On Left mouse button Clicked
+ Terrain: Pick closest to: Sprite6.X, Sprite6.Y
-> Sprite6: Move to Terrain [/code:w2utr7pd]

Have the planets pick. If you have more than one unique planet sprite place the planets into a family.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Thu Apr 14, 2011 10:10 pm

Thanks a ton, I didn't realize there was an event for that! :)
B
8
S
2
G
2
Posts: 144
Reputation: 1,588


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests