Micfild Posted September 25, 2021 Report Share Posted September 25, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 25, 2021 Report Share Posted September 25, 2021 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) 1 Quote Link to comment Share on other sites More sharing options...
Freagarach Posted September 25, 2021 Report Share Posted September 25, 2021 In cost.js you can find the relevant line. 2 Quote Link to comment Share on other sites More sharing options...
Micfild Posted September 25, 2021 Author Report Share Posted September 25, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
Micfild Posted September 25, 2021 Author Report Share Posted September 25, 2021 @Langbart Sent me a message with a solution to the Unit Cost Card not showing decimal values. Posting it here since it's relevant. In gui/common/tooltip.js In line 708, remove the Math.floor, leaving just the rest of the equation and it's done. 1 Quote Link to comment Share on other sites More sharing options...
Ceres Posted September 25, 2021 Report Share Posted September 25, 2021 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. 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.