LordStark Posted June 3, 2022 Report Share Posted June 3, 2022 Hi team, Just wanted to say thank you to everyone who has helped me so far. There are limits on the number of posts that can be made so I am not able to reply to everyone who helps and thank them personally - but I do very much appreciate all the advice. On to my question, I am modding the millenium mod and I wanted to make my anglo-saxon units upgradable to a unit ("Master at Arms")that looks like the norse huscarl - the only problem is, the huscarl carries and axe over his soldier rather than a sword or a spear. Is there anyway for me to change this? Also, is there away to change the wording of so that instead of it saying "Upgrade to Master at Arms" it says "Appoint to Master at Arms"? Quote Link to comment Share on other sites More sharing options...
Stan` Posted June 3, 2022 Report Share Posted June 3, 2022 10 minutes ago, LordStark said: On to my question, I am modding the millenium mod and I wanted to make my anglo-saxon units upgradable to a unit ("Master at Arms")that looks like the norse huscarl - the only problem is, the huscarl carries and axe over his soldier rather than a sword or a spear. Is there anyway for me to change this? You can create another actor that uses the sword animation and props (props are the tools and weapons carried by the unit) See XML.Actor – Wildfire Games Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 3, 2022 Author Report Share Posted June 3, 2022 Thanks Stan, any advice on changing the words of the upgrade so it does not say "Upgrade to Appoint Man-at-Arms"? Quote Link to comment Share on other sites More sharing options...
Stan` Posted June 3, 2022 Report Share Posted June 3, 2022 Unfortunately it is "hardcoded" here https://github.com/0ad/0ad/blob/aaf6271b47686a17b9b995b7cf83064e1234a02b/binaries/data/mods/public/gui/session/selection_panels.js#L1142 You can mod that file, but keep in mind it will break all the translations of your mod. As it is required to be translated. It could be expanded in the future. cc @Freagarach Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 3, 2022 Author Report Share Posted June 3, 2022 When you say "it will break all the translations of your mod" do you mean that if my mod had upgrades elsewhere (it doesn't) that they would simply not say "upgrade"? If that is the only issue I would be more than happy to change it. Where would I find that file to mod? Also, do I just change it to: " if (data.item.tooltip) tooltips.push(sprintf(translate("%(primaryName)s %(tooltip)s"), { "primaryName": primaryName, "secondaryName": secondaryName, "tooltip": translate(data.item.tooltip) }));" And this would have the ingame effect of: "Master at Arm - Appoint this unit as the Master at Arms" That seems super easy... Quote Link to comment Share on other sites More sharing options...
Stan` Posted June 3, 2022 Report Share Posted June 3, 2022 I mean that your mod relies on translations that are inside the public mod. So if you change the four occurences of the string in that file (see the url for the path of that file) the game engine will no longer be able to match the strings and the translations. So it will default to english and whatever you put there. Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 4, 2022 Author Report Share Posted June 4, 2022 So I ended up extracting the public zip file (into the same folder as the zip file). So I ended up with public.zip and public (normal folder). I then went into the public folder and found the code you referred to and deleted the green highlighted parts: Quote if (g_ShowSecondaryNames) { if (data.item.tooltip) tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s (%(secondaryName)s). %(tooltip)s"), { "primaryName": primaryName, "secondaryName": secondaryName, "tooltip": translate(data.item.tooltip) })); else tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s (%(secondaryName)s)."), { "primaryName": primaryName, "secondaryName": secondaryName })); } else { if (data.item.tooltip) tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s. %(tooltip)s"), { "primaryName": primaryName, "tooltip": translate(data.item.tooltip) })); else tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s."), { "primaryName": primaryName })); } But nothing happened in game.... I then tried removing the public.zip file but that caused technical issues. What am I doing wrong here? Quote Link to comment Share on other sites More sharing options...
Stan` Posted June 4, 2022 Report Share Posted June 4, 2022 Did you put the edited file in your mod? 1 Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 4, 2022 Author Report Share Posted June 4, 2022 I have done that now and it works. Thank you very much. Absolutely loving my new "Appoint to Master at Arms position" and "Dismiss Master at Arms" feature. 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.