SC2Mapster Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Help
SC2MAPSTER
News
Maps
Assets
Teams
Authors
Forums
Paste
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
SC2Mapster Wiki
1,003
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Help
SC2MAPSTER
News
Maps
Assets
Teams
Authors
Forums
Paste
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
Data/Units
(section)
Back to page
Edit
VisualEditor
View history
Talk (0)
Edit Page
Data/Units
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===AI: Tactical AI Channel=== *Specify the a trigger function that should be called periodically to while an order is being channelled so that the AI can cancel it, if desired. *Represents a function name in the Galaxy virtual machine. *When the unit is owned by an active AI player, it will periodically poll this function only while channelling. *Tactical AI is only run for active computer players. It is not possible to turn on for non-computer player slots. *The referenced function must use the following prototype: void tacticalaifunction(int player, unit aiUnit, unitgroup scanGroup); *The Odin has a good example of such a function: void AIChannelMPOdin (int player, unit aiUnit, unitgroup scanGroup) { order cancelOrd = AICreateOrder(player, c_AB_Bombardment, 1); order curOrd; abilcmd curAbilCmd; point loc; fixed barrageRadius = AIEffectFixed(player, c_EF_BombardmentArea, c_fieldAreaRadius0); unit unitToCheck; int loop = 0; if (!UnitOrderIsValid(aiUnit, cancelOrd)) { return; } curOrd = UnitOrder(aiUnit, 0); if ((curOrd == null) && AIIsAttackOrder(curOrd)) { return; } curAbilCmd = OrderGetAbilityCommand(curOrd); if (AbilityCommandGetAbility(curAbilCmd) != c_AB_Bombardment || AbilityCommandGetCommand(curAbilCmd) != 0) { return; } loc = OrderGetTargetPoint(curOrd); loop = UnitGroupCount(scanGroup, c_unitCountAll); while (loop > 0) { unitToCheck = UnitGroupUnit(scanGroup, loop); loop = loop - 1; if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) { // found at least one enemy in the barrage area return; } } // cast a cancel order to stop barraging the empty area AICast(aiUnit, cancelOrd, c_noMarker, c_castHold); }
Summary:
Please note that all contributions to the SC2Mapster Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab