// Camera data used for default camera motion and parametersnativevoidCameraSetData(playergroupplayers,stringcameraId);// CatalogsnativeboolCatalogEntryIsDefault(intcatalog,stringentry);nativeintCatalogFieldValueGetAsInt(intcatalog,stringentry,stringfieldPath,intplayer);//--------------------------------------------------------------------------------------------------// Note: The LinkReplace API does not actually search & replace all catalog fields.// It saves the replacement in a separate table so that code setup to handle being replaced can// do the replacement where necessary.//--------------------------------------------------------------------------------------------------nativevoidCatalogLinkReplace(intplayer,intcatalog,stringidA,stringidB);nativestringCatalogLinkReplacement(intplayer,intcatalog,stringid);nativevoidGameSetSeed(intvalue);// Player statesconstintc_playerStateChargesPaused=9;constintc_playerStateCooldownsPaused=10;constintc_playerStateMineralCostIgnored=11;constintc_playerStateVespeneCostIgnored=12;constintc_playerStateTerrazineCostIgnored=13;constintc_playerStateCustomCostIgnored=14;constintc_playerStateDisplayGameResult=15;// StringExternal looks up the given string identifer in the externalized string tablenativetextStringExternalHotkey(strings);nativetextStringExternalAsset(strings);// Unit attributesconstintc_unitAttributeNone=-1;// Base Damage.constintc_unitAttributeShielded=-2;// Damage vs. Shielded Units.// Unit statesconstintc_unitStateDetectable=29;constintc_unitStateRadarable=30;// Unit propertiesconstintc_unitPropLifeArmor=35;// Read-onlyconstintc_unitPropShieldArmor=36;// Read-onlynativeunitUnitAddOnChild(unitinUnit,intinIndex);nativeunitUnitAddOnParent(unitinUnit);// behavior buff flagsconstintc_unitBehaviorFlagRefreshStack=9;// Unit weaponsnativefixedUnitWeaponDamage(unitinUnit,intinIndex,intinAttribute,boolinMaximum);nativefixedUnitWeaponSpeedMultiplier(unitinUnit,intinIndex);// Local Selection Typesconstintc_localSelectionTypeUnknown=-1;constintc_localSelectionTypeControlGroup=0;constintc_localSelectionTypeIdleButton=1;constintc_localSelectionTypePylonButton=2;constintc_localSelectionTypeSelectLarva=3;constintc_localSelectionTypeSelectBuilder=4;constintc_localSelectionTypeAlert=5;constintc_localSelectionTypeHeroPanel=6;constintc_localSelectionTypeInfoPanel=7;constintc_localSelectionTypeWorldPanel=8;nativevoidUIStatusBarOverride(playergroupinPlayers,intgroup);nativevoidUIStatusBarClearOverride(playergroupinPlayers);nativevoidUISetResourceVisible(playergroupinPlayers,intinResource,boolinVisible);nativevoidUISetSelectionTypeEnabled(playergroupinPlayers,intinSelectionType,boolinEnabled);// Unit flagsconstintc_unitFlagShareControl=53;
Changes to existing presets:
// Camera movement eventsconstintc_cameraMoveReasonAny=-1;constintc_cameraMoveReasonAlert=0;constintc_cameraMoveReasonIdleWorker=1;constintc_cameraMoveReasonKeyScroll=2;constintc_cameraMoveReasonMinimap=3;constintc_cameraMoveReasonMouseScroll=4;constintc_cameraMoveReasonSelection=5;constintc_cameraMoveReasonTown=6;constintc_cameraMoveReasonView=7;constintc_cameraMoveReasonZoom=8;// Playersconstintc_maxPlayers=16;// Behavior info flagsconstintc_unitBehaviorFlagHidden=10;
I have spend the past 6 months working on a new custom AI (from scratch) that is better then the AI that comes with the game and is more fun to play against.
Noteable features:
Unit micro (focus fire on weakest unit, use weapon bonuses, retreat wounded units)
Tactical ability usage (blink, force fields, emp's and fungal growth are all used)
Excessive creep spread (zerg AI uses tons of creep tumors to make a creep highway)
Harassment strategies (medivac drops, mutalisk harassment and nydus worms)
I am currently building my AI project in Notepad++. It currently exists of 893.556 bytes of .galaxy files.
Notepad++ works fine for syntax highlighting and auto-completion, but what I am really missing is debugging functionality.
When I make a typo somewhere, the game simply refuses to run and I have to dig through my most recent changes to find the mistake.
I am unable to develop this project in the editor, because the editor does not recognize the "include" statement so functions declared in other files are not known to him, generating tons of compile errors.
If you could provide with a program that has similar features to Notepad++ and includes a galaxy preprocessor so it can tell where I made an error in the script, I will love you till the end of time.
Galaxy requires you to declare all variables first before you do any other statements.
The reason the line with the avgDistanceFromCenterToEdge declaration is pointed at is because that is the first time you declare something new after running regular statements.
When you comment out those regular statements, like you said, it will work fine.
Move the "tempRegion =" and the "RegionSetCenter" lines beneath the "int addY =" line and it should work.
color libNtve_gf_DialogItemColor (int lp_dialogItem, int lp_player);
Takes an int as second argument, not a player group. But I guess that should prevent it from running in the first place...
Are you getting a color with three 0.0 values, or are you getting a null pointer that your colorToString converts into 0,0,0? Because ColorGetComponent returns 0.0 when given a null pointer as color.
The automatic lowering of supply depots is somewhere in the engine. I have completely replaced all the AI scripts with my project and the depots are still getting lowered.
However, creating an order that should raise them shouldn't be hard. The Blizzard AI scripts have a function for creating orders based on a unit and an ability.
The most important to use this function is the unit pointer. You need to get the supply depot you want to lower/raise in some way. If you need help with that, let me know. For the player argument, you can simply use UnitGetOwner(unit u) and plug the supply depot in there as well.
The ability string is indeed the c_AB_DepotRaise you found. Of course there is also c_AB_DepotLower. Those are defined in the requirements.galaxy.
The AITacticalOrder function creates the order based on the ability and checks if the result is a viable order for the unit you specified. If this is not the case, it will return null.
Now you need a way to give the supply depot the order to raise or lower. There are actually two ways to do that:
I am using UnitIssueOrder in my project, because with the inQueueType I can queue orders which is not possible with AICast. Downside is that orders given with UnitIssueOrder are not registered by the APM meter.
No, there is not, unfortuantely.
There is a AIGetTime() native that will return the same value the game timer in the bottom left shows you (in seconds). But because the game is effectively frozen when the game is running through the script, it cannot be used as a benchmark.
0
Additions:
Changes to existing presets:
0
Are you simply looking for a way to store strings for later use?
Or do you want to store them on/in the units?
0
Give the unit the GhostHoldFire ability and turn it on?
0
I have spend the past 6 months working on a new custom AI (from scratch) that is better then the AI that comes with the game and is more fun to play against.
Noteable features:
--
I have uploaded the following maps with this AI integrated:
How to play: Create a custom game and search for "EagleAI". Add an AI to the game and set the difficulty. That's it!
Please try it and let me know what you think. Feel free to post the replay. (if you do, please tell me which league you are in)
PS It's possible the AI is vulnerable to some cheeses. I haven't build any specific counters against those yet, so please be a sport and play fair. :)
0
@avogatro: Go
It's already on there... :D
0
@ShooperMAN:
This is per scope.
Pretty useless code, but it's for demonstration purposes... :)
0
I am currently building my AI project in Notepad++. It currently exists of 893.556 bytes of .galaxy files.
Notepad++ works fine for syntax highlighting and auto-completion, but what I am really missing is debugging functionality.
When I make a typo somewhere, the game simply refuses to run and I have to dig through my most recent changes to find the mistake.
I am unable to develop this project in the editor, because the editor does not recognize the "include" statement so functions declared in other files are not known to him, generating tons of compile errors.
If you could provide with a program that has similar features to Notepad++ and includes a galaxy preprocessor so it can tell where I made an error in the script, I will love you till the end of time.
0
Here is the problem:
Galaxy requires you to declare all variables first before you do any other statements.
The reason the line with the avgDistanceFromCenterToEdge declaration is pointed at is because that is the first time you declare something new after running regular statements.
When you comment out those regular statements, like you said, it will work fine.
Move the "tempRegion =" and the "RegionSetCenter" lines beneath the "int addY =" line and it should work.
0
This should work:
I can't explain why this works or not for you, I've never worked with interface elements.
0
color libNtve_gf_DialogItemColor (int lp_dialogItem, int lp_player);
Takes an int as second argument, not a player group. But I guess that should prevent it from running in the first place...
Are you getting a color with three 0.0 values, or are you getting a null pointer that your colorToString converts into 0,0,0? Because ColorGetComponent returns 0.0 when given a null pointer as color.
0
Maybe the engine needs a tick to update the color internally?
Have you tried setting the color and calling the getter a few seconds later?
0
The automatic lowering of supply depots is somewhere in the engine. I have completely replaced all the AI scripts with my project and the depots are still getting lowered.
However, creating an order that should raise them shouldn't be hard. The Blizzard AI scripts have a function for creating orders based on a unit and an ability.
The most important to use this function is the unit pointer. You need to get the supply depot you want to lower/raise in some way. If you need help with that, let me know. For the player argument, you can simply use UnitGetOwner(unit u) and plug the supply depot in there as well.
The ability string is indeed the c_AB_DepotRaise you found. Of course there is also c_AB_DepotLower. Those are defined in the requirements.galaxy.
The AITacticalOrder function creates the order based on the ability and checks if the result is a viable order for the unit you specified. If this is not the case, it will return null.
Now you need a way to give the supply depot the order to raise or lower. There are actually two ways to do that:
I am using UnitIssueOrder in my project, because with the inQueueType I can queue orders which is not possible with AICast. Downside is that orders given with UnitIssueOrder are not registered by the APM meter.
To summarize:
0
No, there is not, unfortuantely. There is a AIGetTime() native that will return the same value the game timer in the bottom left shows you (in seconds). But because the game is effectively frozen when the game is running through the script, it cannot be used as a benchmark.
0
It's on the wiki: http://wiki.sc2mapster.com/galaxy/triggers/presets/unit-property-get/
0