Jump to content

Changing a units visual weapon - can it be done purely via code?


LordStark
 Share

Recommended Posts

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"?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...