Edit Scripts Midgame

Hi there!

I'm currently trying to build a factory for status bars of all kinds. (Pretty much just this, but variable)

Problem is the change script. It kind of needs to be variable as well to reflect the varying names, but doing this

x => {
  JS.eval ("$('#" + Att + "-span').html('" + Att + "/" + Att + "Max") + "');")
  JS.eval ("$('#" + Att + "-indicator').css('padding-right', '" + (200 * GetInt(game.pov, Att) / GetInt(game.pov, Att + "Max")) + "px');")
}

obviously doesn't work because the "Att" variable will just be signed off as is instead of being replaced by its value, thus bricking the script.
I tried a few things, but can't find a way of changing it so the Att gets replaced with the given value (Health, Stamina, etc)...

Any ideas/workarounds would massively help me out!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums