I have been trying to find a way to pause one AI player as oppose to pausing all of them with the "Pause AI Time" trigger. So does anyone know of a work around for this? I have thought of just changing ownership to another player, but this caused more issues, as the current orders for the AI that was in charge are canceled. This is unwanted behavior for my map. If someone can figure out a way to have a seamless transition from a human player with no base, to taking over an AI controlled base that would be great, and please share your ideas.
You can add the functionality with a conditional check in the AI Wave and Think functions. They will still register new units for consistency and also still think tactically (which generally should not be disabled) but they would not be able to think and hence appear to stop (no new units, no movement).
You can also design your AI so that you can remove all their units and restart it by adding them again. Probably harder to do in a way that produces acceptable results. Again tactical AI will still function (which is generally a good thing).
So just recently I have found a work around for this. If you look at the triggers you can see "enable script use for unit". This stops a unit from being commanded from the AI. so just make a trigger, so that when a unit is created it turns "enable script on" for the specified unit. I ended up doing this with unit groups and added all the units for the specified AI computer to a group then turned on "enable script use for unit group". However, units that are just made, and are given orders from the AI will still perform the order (Only workers have shown this behavior). So I have put a behavior on creation that disables their build abilities temporarily (for 0.1 sec). this seemed to fix that issue. This method seems to work almost perfectly. More testing is needed.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello,
I have been trying to find a way to pause one AI player as oppose to pausing all of them with the "Pause AI Time" trigger. So does anyone know of a work around for this? I have thought of just changing ownership to another player, but this caused more issues, as the current orders for the AI that was in charge are canceled. This is unwanted behavior for my map. If someone can figure out a way to have a seamless transition from a human player with no base, to taking over an AI controlled base that would be great, and please share your ideas.
Thanks in advance.
does turning off melee AI work?
There is a pause unit function. You could pause all their units. Or do you not want that to happen?
If it is only orders which it effects you can have an array of orders, fill it with the units orders, change ownership and then reinstate the orders.
I'm not sure if changing ownership effects other things like unit IDs, rally points, behaviours, etc. So it might be more work than that.
You can add the functionality with a conditional check in the AI Wave and Think functions. They will still register new units for consistency and also still think tactically (which generally should not be disabled) but they would not be able to think and hence appear to stop (no new units, no movement).
You can also design your AI so that you can remove all their units and restart it by adding them again. Probably harder to do in a way that produces acceptable results. Again tactical AI will still function (which is generally a good thing).
So just recently I have found a work around for this. If you look at the triggers you can see "enable script use for unit". This stops a unit from being commanded from the AI. so just make a trigger, so that when a unit is created it turns "enable script on" for the specified unit. I ended up doing this with unit groups and added all the units for the specified AI computer to a group then turned on "enable script use for unit group". However, units that are just made, and are given orders from the AI will still perform the order (Only workers have shown this behavior). So I have put a behavior on creation that disables their build abilities temporarily (for 0.1 sec). this seemed to fix that issue. This method seems to work almost perfectly. More testing is needed.