Jump to content

Population decimal values


Micfild
 Share

Recommended Posts

Hi! It was creating a mod to test a few things and tried to set the population value of a unit to a decimal number (i.e. 1 --> 1.5). As expected, the game didn't like that one bit XD.

I was wondering, can it be done? Would it be trivial or complex (like, in a scale of changing a line or changing several scripts)? 

I'm just curious.

Thanks.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Micfild said:

 

I was wondering, can it be done? Would it be trivial or complex (like, in a scale of changing a line or changing several scripts)? 

Well changing it is probably a matter of replacing a positiveinteger to positivedecimal in one of the simulation scripts. However it might appear weird on the GUI (e.g with a ton of decimals)

  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Freagarach said:

In cost.js you can find the relevant line.

Thanks @Stan` and @Freagarach, it was in cost.js, as you said. Line 16 of the script, change the schema from nonNegativeInteger to decimal did the trick (it doesn't accept nonNegativeDecimal - not a valid datatype). Although the decimal values don't show on the cost card of the unit, it does show and work perfectly on the resource panel at the top of the screen.

 

In this image, women costs 1.5 pop.

 https://i.imgur.com/qORPVcW.jpeg

Thanks once more.

  • Thanks 1
Link to comment
Share on other sites

Could this help to display several game settings as integer values instead of decimals? E.g. volume setting is currently shown as something like 22.0. if this could be e.g. 22% instead, it would be nicer. This is off course of very minor interest - and a bit OT here from me, sorry. ;)

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