[AI] GetExpansionPeon always returns null

Level 28
Joined
Feb 2, 2006
Messages
1,630
Hi,
I want my AI scripts to build expansions.
However, the native
JASS:
GetExpansionPeon
always returns null, so nothing is build. Here it states: AI Manual

"This native will return the peon unit that will start a new expansion for the AI player, however, it will return null if there is no gold mine (excluding a gold mine the AI player already own) found on the map."

I have many gold mines in my map but they are a bit further away from the base and only connected via waygates. Is this some issue for the AI?
Does anyone know how to fix this?
 
Level 14
Joined
Jan 10, 2023
Messages
247
I think the waygates are likely your problem or at least worth ruling out. I would offer to help, but I don't know AI scripts well enough to mess around and find out.

I imagine when a computer uses a waygate normally, it is because they have given an order and the pathing system finds the shortcut.

You could try revealing the map to computers at the start, but I wonder if they would try to move to a location that there was no path to...

Maybe you could connect the unconnected regions with obnoxiously long foot paths?

I'd rule out the waygates though first and foremost.


Edit: Are you using black mask boundaries between areas, or only path blockers?
 
Top