• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

benthevaporeon

Sergeant
Sep 16, 2021
58
16
for people that know the games code or have made game rule mods, i have a queston







how hard is it to get game rule mods to work, and also do they slow the game down a lot











there are 2 main mods i wish to make if they do not exist yet





first off is to have Morale be contagious, meaning that if the average morale in a dome is 90, then the people with below that value will slowly have their morale go up to the average, this would likely require some trial and error with the base morale so that the slow decline from perfect to normal still happens. This would also cause the more common and problematic bad morale to spread, meaning if the domes average is 50, then 1 person with a higher base morale due to religion or such will have their morale brought down to the average. The idea behind this is that if someone is around negative people, they tend to become negative as well, and the same also applies in the positive sense to some extent. This also would prolong positive and negative morale events.





The second mod I would hope to make is a ‘food diversity’ effect on the performance of food related buildings. It would tally all the food gathered over the past time period(probably 15 sol so that it takes outside ranches slowest crops) and then keeps track of how much was harvested and what. If you get all your food from fruit trees, the beyond earth rice, or the more common for me out dome wheat, then your buildings won’t offer as much comfort(not sure if it would be a penalty, or less of a boost with a lower base). I would hope to use a global value for the performance boost or penalty that would take into account all you have produced over a time period, rather then the probably impossible task of keeping track of what food box has what in it.

The reason for this mod in game is to avoid the late game appeal of getting all of your food from out dome wheat as you get more then you likely can use without workers.

Its also because I noticed that when I have one production building in the start of the game, the colonists are likely eating only leaf crops, wheat, or soybeans and only one at a time. Later on in mid to late game, you have a lot of food choices, but there tends to be one clear ‘best’ choice.

It would also give real reason to set up domes that have ranches or outside ranches even when it takes effort to not anger the vegans.









A third would be to make the rc transports use the shuttle ai to keep up with storages, but that would have to wait until I knew what I was doing
 
how hard is it to get game rule mods to work, and also do they slow the game down a lot
You can create a game rule in the mod editor then test whether it's active in game with the IsGameRuleActive() function.
first off is to have Morale be contagious, meaning that if the average morale in a dome is 90, then the people with below that value will slowly have their morale go up to the average, this would likely require some trial and error with the base morale so that the slow decline from perfect to normal still happens. This would also cause the more common and problematic bad morale to spread, meaning if the domes average is 50, then 1 person with a higher base morale due to religion or such will have their morale brought down to the average. The idea behind this is that if someone is around negative people, they tend to become negative as well, and the same also applies in the positive sense to some extent. This also would prolong positive and negative morale events.
You can mod the Colonist:UpdateMorale() function. Changing the colonist's morale would change the average, which would in turn affect each colonist's morale... you might want to take this into consideration.
The second mod I would hope to make is a ‘food diversity’ effect on the performance of food related buildings. It would tally all the food gathered over the past time period(probably 15 sol so that it takes outside ranches slowest crops) and then keeps track of how much was harvested and what. If you get all your food from fruit trees, the beyond earth rice, or the more common for me out dome wheat, then your buildings won’t offer as much comfort(not sure if it would be a penalty, or less of a boost with a lower base). I would hope to use a global value for the performance boost or penalty that would take into account all you have produced over a time period, rather then the probably impossible task of keeping track of what food box has what in it.

The reason for this mod in game is to avoid the late game appeal of getting all of your food from out dome wheat as you get more then you likely can use without workers.

Its also because I noticed that when I have one production building in the start of the game, the colonists are likely eating only leaf crops, wheat, or soybeans and only one at a time. Later on in mid to late game, you have a lot of food choices, but there tends to be one clear ‘best’ choice.

It would also give real reason to set up domes that have ranches or outside ranches even when it takes effort to not anger the vegans.
Feeding its population would be one of the most important challenges to any extraterrestrial colony, and I agree that this aspect is rather simplistically modelled in SM. The ranches in particular have been poorly implemented IMO. They should not be available from start but locked behind a mid to late game tech (typically Gene Adaptation) and consume large amounts of base food to produce small amounts of luxury food...
It's not possible to keep track of every single crate. One solution would be to mod as much custom resources as you want food types but distributing them through grocers and restaurants would not be easy. The best option, I think, would be to calculate a global food diversity index for the entire map based on the few last sols' food production (you can use OnMsg.CropProduced and OnMsg.FoodProduced functions to track your production).
A third would be to make the rc transports use the shuttle ai to keep up with storages, but that would have to wait until I knew what I was doing
It's probably doable. I'd first look into the Lua/Units/RCTransport.lua and Lua/Buildings/ShuttleHub.lua files.
 
Last edited: