I have a extension mod I'm working on that uses balance multi dependency and the liberty campaign dependency for hero units. I went this route so I can have the overlords morph into transport units individually. I also wanted the automated assimilator and extractor and spent two days figuring out how to set those up with the balancemulti dependency. I knew little to nothing about the editor other than adjusting values for damage and what have you. I learned a lot about how its all connected. I have Kerrigan Zeratul and Raynor as a revivable heroes for each respective race. Everything is working for a melee map extension mod except the AI doesn't know to use the revive ability at their command structure.
Edit 11-17: It's possible they don't know to build the automated geysers either but I haven't thought to check that until I just uploaded this post.
Im looking for the simplest solution even if it involves cutting corners but I've exported the .galaxy files and have been looking them over. I have no idea how to get the ai to use the ability though.
I guess if you know you could also help me figure out how to have Jim Raynor (Commando) use his plasma gun and grenades.
Any help will be appreciated.
(if you need the file I can email it or upload to a site but recommendations on where to upload would be appreciated as well)
Edit- 11-29
so far this is the most useful resource I've found for scripting.
So far so good. I have the AIs using Automated Refineries when they have >=1 Orbital Command and regular Refineries when they lose their Orbital Command. The AIs will also revive their hero unit now.(I'll post what I did for that a little later I need to wrap this up)
I think the string within the quotes needs to match the ID of the unit in the data editor. It's the ID field when you select a unit in the data editor right click and select modify unit. The string you could name whatever but for the sake of familiarizing myself with galaxy I'm sticking with Blizzards naming conventions.
Add special units
BuildAI.galaxy
if (objType == c_TB_AutomatedRefinery) {
return c_makeCollector;
Think this is required for a vespene geyser unit, didn't try it without adding this first.
This is how I get Terran to change which refinery to use as default.
Then I edited the AISetStock functions and added the if else statements for the build types in the files under
IMPORTANT EDIT: From the looks of it changing all these AISetStock functions separately isn't required.
The important edits are the AIDefaultEconomy settings in MeleeLowAI.galaxy and the AIDefaultEconomy functions at the bottom of the HdVh VyHd ChIn builds for the 3 races.
My recommendation for someone starting from scratch mirrors a recommendation a I found digging up everything I could on this stuff. Get notepad++ find the galaxy language file for notepad++ and install it. export all the scripts under
TriggerLibs
TriggerLibs\Tactical
TriggerLibs\Terran
TriggerLibs\Protoss
TriggerLibs\Zerg
You probably don't need much if anything from TriggerLibs\GameData
Theres a program called casc you can use to extract them all at once instead of one by one in the sc2editor.
Open all the galaxy files for now while you dont know what you need.
Use even abuse the Find in all open documents feature.
It's awesome and really speeds up how quickly you can find how things work.
Last post and I'll mark this question as solved. Full disclosure I haven't read the rules for posting. I just try not to post in ways that would obviously be against them.
Replying to my own posts instead of just editing may be frowned upon and if so if asked to I can copy and paste these two replies to the original question.
Again the text within the quotes I think needs match the ID under modify in the data editor. In this case it's an ability so I don't have it open but it might say modify ability instead of modify unit.
Then I added the ability function to
TactTerrAI.galaxy
//------------------------------
// Revive Raynor
//------------------------------
bool ReviveRaynor (int player, unit aiUnit) {
order ord;
ord = AICreateOrder(player, c_AB_ReviveRaynor, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return false;
}
AICast(aiUnit, ord, c_noMarker, c_castHold);
return true;
}
I think this needs to be before any AIThinkFunctions that call it for the call to work.
In the case of Terran the TownHall tactical ai function can be either AIThinkCommandCenter (also Planetary Fortress by default) or AIThinkOrbitalCommand. So within both of these functions I added the call to use the ability.
if (ReviveRaynor(player, aiUnit)) {
return;
}
Zerg didn't have an AIThinkFunction attached to its TownHall by default with the dependencies I'm using. I created my own by adding this to
TactZergAI.galaxy
//------------------------
// Revive Kerrigan
//------------------------
bool ReviveKerrigan (int player, unit aiUnit) {
order ord;
ord = AICreateOrder(player, c_AB_ReviveKerrigan, 0);
if (!UnitOrderIsValid(aiUnit, ord)) {
return false;
}
AICast(aiUnit, ord, c_noMarker, c_castHold);
return true;
}
//---------------
// Think Hatchery
//---------------
void AIThinkHatchery(int player, unit aiUnit, unitgroup scanGroup) {
// also used for lair, hive
order ord;
// rally
if (AIEvalTacticalData(aiUnit, null)) {
return;
}
if (ReviveKerrigan(player, aiUnit)) {
return;
}
}
After that in the data editor for the Hatchery, Lair and Hive under the unit tab I found the tactical ai function setting and wrote in AIThinkHatchery tested it and the AIs are now reviving their hero units when they die.
I may have to change the conditions for it to cast the ability since it's used at the economy building and the revive takes around 1 min. I haven't gotten that far but I may have to check worker count before allowing the ability to be cast to ensure a healthy economy over a revived hero. I made them useful but they are weak to defensive structures and their damage against structures is nerfed.
I have a extension mod I'm working on that uses balance multi dependency and the liberty campaign dependency for hero units. I went this route so I can have the overlords morph into transport units individually. I also wanted the automated assimilator and extractor and spent two days figuring out how to set those up with the balancemulti dependency. I knew little to nothing about the editor other than adjusting values for damage and what have you. I learned a lot about how its all connected. I have Kerrigan Zeratul and Raynor as a revivable heroes for each respective race. Everything is working for a melee map extension mod except the AI doesn't know to use the revive ability at their command structure.
Edit 11-17: It's possible they don't know to build the automated geysers either but I haven't thought to check that until I just uploaded this post.
Im looking for the simplest solution even if it involves cutting corners but I've exported the .galaxy files and have been looking them over. I have no idea how to get the ai to use the ability though.
I guess if you know you could also help me figure out how to have Jim Raynor (Commando) use his plasma gun and grenades.
Any help will be appreciated.
(if you need the file I can email it or upload to a site but recommendations on where to upload would be appreciated as well)
Edit- 11-29
so far this is the most useful resource I've found for scripting.
https://mapster.talv.space/galaxy/reference
Still a bit confusing but Im not much of a programmer.
Things like AIGetTime() Im not sure but it seems it has to be relying on information I'm not seeing to set the pace of time.
So far so good. I have the AIs using Automated Refineries when they have >=1 Orbital Command and regular Refineries when they lose their Orbital Command. The AIs will also revive their hero unit now.(I'll post what I did for that a little later I need to wrap this up)
Add reference to
RequirementsAI.galaxy
I think the string within the quotes needs to match the ID of the unit in the data editor. It's the ID field when you select a unit in the data editor right click and select modify unit. The string you could name whatever but for the sake of familiarizing myself with galaxy I'm sticking with Blizzards naming conventions.
Add special units
BuildAI.galaxy
Think this is required for a vespene geyser unit, didn't try it without adding this first.
This is how I get Terran to change which refinery to use as default.
MeleeLowAI.galaxy
Then I edited the AISetStock functions and added the if else statements for the build types in the files under
IMPORTANT EDIT: From the looks of it changing all these AISetStock functions separately isn't required.
The important edits are the AIDefaultEconomy settings in MeleeLowAI.galaxy and the AIDefaultEconomy functions at the bottom of the HdVh VyHd ChIn builds for the 3 races.
TriggerLibs\Terran
TerranHard.galaxy
TerranVyHd.galaxy etc.
My recommendation for someone starting from scratch mirrors a recommendation a I found digging up everything I could on this stuff. Get notepad++ find the galaxy language file for notepad++ and install it. export all the scripts under
TriggerLibs
TriggerLibs\Tactical
TriggerLibs\Terran
TriggerLibs\Protoss
TriggerLibs\Zerg
You probably don't need much if anything from TriggerLibs\GameData
Theres a program called casc you can use to extract them all at once instead of one by one in the sc2editor.
Open all the galaxy files for now while you dont know what you need.
Use even abuse the Find in all open documents feature.
It's awesome and really speeds up how quickly you can find how things work.
Last post and I'll mark this question as solved. Full disclosure I haven't read the rules for posting. I just try not to post in ways that would obviously be against them.
Replying to my own posts instead of just editing may be frowned upon and if so if asked to I can copy and paste these two replies to the original question.
So for reviving the heroes at the Town Halls.
I added the references to
RequirementsAI.galaxy
Again the text within the quotes I think needs match the ID under modify in the data editor. In this case it's an ability so I don't have it open but it might say modify ability instead of modify unit.
Then I added the ability function to
TactTerrAI.galaxy
I think this needs to be before any AIThinkFunctions that call it for the call to work.
In the case of Terran the TownHall tactical ai function can be either AIThinkCommandCenter (also Planetary Fortress by default) or AIThinkOrbitalCommand. So within both of these functions I added the call to use the ability.
Zerg didn't have an AIThinkFunction attached to its TownHall by default with the dependencies I'm using. I created my own by adding this to
TactZergAI.galaxy
After that in the data editor for the Hatchery, Lair and Hive under the unit tab I found the tactical ai function setting and wrote in AIThinkHatchery tested it and the AIs are now reviving their hero units when they die.
I may have to change the conditions for it to cast the ability since it's used at the economy building and the revive takes around 1 min. I haven't gotten that far but I may have to check worker count before allowing the ability to be cast to ensure a healthy economy over a revived hero. I made them useful but they are weak to defensive structures and their damage against structures is nerfed.