Tulughma Posted February 4 Report Share Posted February 4 Introduction I love playing 0 A.D. but found myself really missing some of the basic expanded hotkeys that AutoCiv provides. Instead of waiting for the official update, I decided to try tweaking the mod's code to make it work with Alpha 27. This also gave me a chance to better understand 0 A.D.'s modding system, even though I admit I have very limited knowledge of how everything works under the hood. This guide is the result of my experimentation - a temporary solution that got AutoCiv running on Alpha 27 on my Mac. I want to acknowledge that this is just a hack, not a proper patch, and express my deep respect to the amazing 0 A.D. developers and to Nani's incredible AutoCiv mod. I'm sharing this workaround with the community in case others find it useful while waiting for the official update. Installation Steps 1. Locate Mods Directory Find your 0 A.D. mods folder based on your operating system: Windows (Vista+): C:\Users\{name_of_user}\Documents\My Games\0ad\mods\ macOS: ~/Library/Application Support/0ad/mods/ Linux: ~/.local/share/0ad/mods/ 2. Install Mod Files Extract autociv.zip directly into the mods directory (don't create an additional autociv folder during extraction) 3. Update Dependency Version Edit mod.json: Find line 7 and change it to: "dependencies": ["0ad=0.27.0"] 4. Restructure Data Directory Locate the autociv_data folder Move it into the gui folder Note: I kept getting the error "This part of the engine may only read from 'gui/', 'simulation/', 'maps/'," etc. Since I couldn't figure out how to change this restriction, I simply moved the folder and updated the paths accordingly. 5. Update File Paths Add "gui/" before "autociv_data/" in following files: autociv/gui/autociv_readme/autociv_readme.js (line 11): const markdown = Engine.ReadFile("gui/autociv_data/README.md") autociv/gui/common/botmanager.js (line 417): let customNamesCivs = Engine.ReadJSONFile("gui/autociv_data/civilizations.json"); autociv/gui/options/optionsautociv.js (line 93): g_autociv_optionsFiles.push("gui/autociv_data/options.json") autociv/gui/options/pregame/mainmenuautociv.js (line 29): let settings = Engine.ReadJSONFile("gui/autociv_data/default_config.json"); 6. Update Font Path In autociv/gui/options/options~autociv.js, change line 85 to: return Engine.ListDirectoryFiles("gui/fonts/", "*"). Note: This tells AutoCiv to look for fonts within the mod's gui folder although it will not find them there. You don't need to move there the game's internal fonts folder for it to work - we're just avoiding accessing restricted parts of the engine. 7. Patch the Stats Bar In autociv/simulation/components/GuiInterface~autociv.js, update line 214 to: "team": 1, and line 215 to: "hasSharedLos": true, Note: Credit goes to Seleucids for this more elegant solution than my original fix. 8. Disable Game Setup Error In gui/gamesetup_mp/gamesetup_mp~autociv.js, delete or comment out (by adding // in front of) line 11: //input.onPress = () => confirmPassword() and line 12: //input.onPress = () => confirmSetup() 9. Disable Hotkey Saving System In gui/hotkeys/HotkeysPage~autociv.js, comment out line 18: //Engine.ConfigDB_WriteFile("user", "config/user.cfg"); Note: Unfortunately, this means you won't be able to change hotkeys through the game settings interface. It's not ideal, but it was the only way I could get around the errors. Known Limitations Hotkey changes cannot be saved Some multiplayer setup features are disabled Stats bar doesn't show teams or count kills Again, this is a temporary solution until an official update is released. I hope this helps anyone else who's missing their AutoCiv in Alpha 27! 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 4 Report Share Posted February 4 14 minutes ago, Tulughma said: In gui/hotkeys/HotkeysPage~autociv.js, comment out line 18: //Engine.ConfigDB_WriteFile("user", "config/user.cfg"); Note: Unfortunately, this means you won't be able to change hotkeys through the game settings interface. It's not ideal, but it was the only way I could get around the errors. You can replace this by following what was done here https://gitea.wildfiregames.com/0ad/0ad/commit/281bb0b2ecfc21b1cdac5e53b1f76e4f944a0fa8 Which would probably be: Engine.ConfigDB_SaveChanges("user"); 1 Quote Link to comment Share on other sites More sharing options...
Seleucids Posted February 4 Report Share Posted February 4 2 hours ago, Tulughma said: Stats bar doesn't show teams or count kills Teams and count kills are able to be displayed in the in-game summary page. Let's look at which engine commands they called in that page. Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 6 Report Share Posted February 6 autociv.zip Here is autociv with overlay stats, as well as option compatibility with other mods fixed. (I was asked to do this for a while lol) 4 5 Quote Link to comment Share on other sites More sharing options...
leopard Posted February 7 Report Share Posted February 7 14 hours ago, Atrik said: Here is autociv with overlay stats, as well as option compatibility with other mods fixed. (I was asked to do this for a while lol) You are a blessing to the community. @Atrik 1 Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 7 Report Share Posted February 7 @nani 1 4 Quote Link to comment Share on other sites More sharing options...
mtl Posted February 7 Report Share Posted February 7 ty Quote Link to comment Share on other sites More sharing options...
leopard Posted February 8 Report Share Posted February 8 I think @nani autociv should be in vanilla. why should it be a separate project, @seeh's version of autociv has a lot of features too. if we could add them to vanilla it would be great, plus 0AD should allow double press of a key as a single hotkey( not sure if I said it correctly) for example in age of empires we can build houses using hotkey Q+Q, that could makes things easy. AOE hotkeys seems practical. 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8 Report Share Posted February 8 6 hours ago, leopard said: I think @nani autociv should be in vanilla. why should it be a separate project, @seeh's version of autociv has a lot of features too. if we could add them to vanilla it would be great, plus 0AD should allow double press of a key as a single hotkey( not sure if I said it correctly) for example in age of empires we can build houses using hotkey Q+Q, that could makes things easy. AOE hotkeys seems practical. So far there is no pull request to integrate the features. It will require some work toadapt the code. Also not all features might make the cut. At the beginning autociv was just the game setup addon now there are a lot of features that need to be split and rewritten so they can be maintenable in the long run. 3 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted February 9 Report Share Posted February 9 @Atrik: ChatCommandHandler~autociv.js line 14, pingall fails, thisbotsListIgnore -> this.botsListIgnore Quote Link to comment Share on other sites More sharing options...
Atrik Posted February 9 Report Share Posted February 9 @sarcoma indeed. I didn't introduced this bug thoughts autociv.zip Here is the corrected version. 1 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted February 9 Report Share Posted February 9 (edited) another bug Spoiler ERROR: Errors executing script event "Tick" ERROR: JavaScript error: gui/session/objectives/autociv_statsOverlay.js line 82 g_InitAttributes.settings.PlayerData[state.playerNumber] is null stateStrength@gui/session/objectives/autociv_statsOverlay.js:82:28 ■ @gui/session/objectives/autociv_statsOverlay.js:7:29 update/entries</preStatsDefault<@gui/session/objectives/autociv_statsOverlay.js:257:80 update/entries<@gui/session/objectives/autociv_statsOverlay.js:257:17 update@gui/session/objectives/autociv_statsOverlay.js:254:38 onTick@gui/session/objectives/autociv_statsOverlay.js:119:18 happens when u switch to gaia perspective as observer @nani: happens when 'Symbolize the rating' option is on Edited February 9 by sarcoma Quote Link to comment Share on other sites More sharing options...
Tulughma Posted February 10 Author Report Share Posted February 10 Atrik's version is wonderful! I found a tiny bug when hitting enter in the host game dialog (instead of clicking on the "continue" button). I did my best to find a solution, and here's my fix: Edit autociv/gui/gamesetup_mp/gamesetup_mp~autociv.js and change line 19 from: input.onPress = () => confirmSetup() to: input.onPress = () => confirmSetup(attribs.loadSavedGame) 1 Quote Link to comment Share on other sites More sharing options...
Seleucids Posted Monday at 21:28 Report Share Posted Monday at 21:28 autociv-sevda.zip This is my enhanced version of autociv, which displays the count of each unit class, KD ratio etc. Quote Link to comment Share on other sites More sharing options...
Classic-Burger Posted Tuesday at 07:21 Report Share Posted Tuesday at 07:21 (edited) On 08/02/2025 at 4:29 AM, Stan` said: So far there is no pull request to integrate the features. It will require some work toadapt the code. Also not all features might make the cut. At the beginning autociv was just the game setup addon now there are a lot of features that need to be split and rewritten so they can be maintenable in the long run. It would have to be one by one and with community support and feedback. Right? Edited Tuesday at 07:22 by Classic-Burger Quote Link to comment Share on other sites More sharing options...
Classic-Burger Posted Tuesday at 07:24 Report Share Posted Tuesday at 07:24 On 07/02/2025 at 9:36 PM, leopard said: plus 0AD should allow double press of a key as a single hotkey( not sure if I said it correctly) for example in age of empires we can build houses using hotkey Q+Q, It could also be cycled with the mouse wheel. Quote Link to comment Share on other sites More sharing options...
Stan` Posted Tuesday at 07:28 Report Share Posted Tuesday at 07:28 6 minutes ago, Classic-Burger said: It would have to be one by one and with community support and feedback. Right? One by one would at least maximise its chance of getting merged. A mega patch will certainly not. 2 Quote Link to comment Share on other sites More sharing options...
seeh Posted Tuesday at 10:23 Report Share Posted Tuesday at 10:23 (edited) 3 hours ago, Classic-Burger said: in age of empires we can build houses using hotkey Q+Q i recommend build hotkey like this: h = build house m = build markt b = build backack f = build farm f,f = build farmstead f,f,f = build fortress .... etc. understand? github.com/...build Edited Tuesday at 10:25 by seeh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.