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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...