Hello,
This is likely to be a pretty straight-forward issue, and I'm a modding/LUA newbie, but:
I'd like a couple of pointers to the right direction if possible, please.
I'm trying to develop a mod which adds another number to use alongside the Green Planet terraforming DLC. Mainly just as a learning tool for me, more than a serious attempt to create a viable mod. I've been relying quite heavily on the mod editor, and I suspect I'm at a point where I can't just rely on templates anymore.
Essentially, I want to add in "Radiation", (to go along with atmosphere, water, vegetation, temperature) starting at 100, and then have a researchable tech to unlock a building which slowly reduces this to zero. (Ideally, it would slowly creep back up to 100 if the building goes offline.)
I'd like to display this number on the screen somewhere at all times. In the general proximity of the other terraforming variables would be ideal, but not absolutely required.
I am already able to define an appropriate tech, and get it to unlock a building, which can then be built and attached to power, etc. Using the build template, I can get it to use a certain amount of power/material/manpower, etc. I'm fairly confident with that part, at this point.
Where I'm falling apart is creating a new variable for radiation, and how to display it on-screen. I thought it would be relatively straight-forward to define one in the mod editor, but this doesn't appear to be the case. At least, not that I can find. I could be missing something obvious.
I'm guessing this means I have to use LUA code to define a global variable somehow, and then figure out a way to get it to update itself every sol for as long as the number is above zero?
Has anyone had any experience with this? I'm not a complete newbie when it comes to coding. I've done a bit in my time, but it's been a while... so chances are I'll understand the concepts if not the specifics... but I'm a bit time-poor at the moment, so was hoping for a push in the right direction to help cut out some of the head-banging and get to the fun stuff more quickly.
Thanks.
This is likely to be a pretty straight-forward issue, and I'm a modding/LUA newbie, but:
I'd like a couple of pointers to the right direction if possible, please.
I'm trying to develop a mod which adds another number to use alongside the Green Planet terraforming DLC. Mainly just as a learning tool for me, more than a serious attempt to create a viable mod. I've been relying quite heavily on the mod editor, and I suspect I'm at a point where I can't just rely on templates anymore.
Essentially, I want to add in "Radiation", (to go along with atmosphere, water, vegetation, temperature) starting at 100, and then have a researchable tech to unlock a building which slowly reduces this to zero. (Ideally, it would slowly creep back up to 100 if the building goes offline.)
I'd like to display this number on the screen somewhere at all times. In the general proximity of the other terraforming variables would be ideal, but not absolutely required.
I am already able to define an appropriate tech, and get it to unlock a building, which can then be built and attached to power, etc. Using the build template, I can get it to use a certain amount of power/material/manpower, etc. I'm fairly confident with that part, at this point.
Where I'm falling apart is creating a new variable for radiation, and how to display it on-screen. I thought it would be relatively straight-forward to define one in the mod editor, but this doesn't appear to be the case. At least, not that I can find. I could be missing something obvious.

I'm guessing this means I have to use LUA code to define a global variable somehow, and then figure out a way to get it to update itself every sol for as long as the number is above zero?
Has anyone had any experience with this? I'm not a complete newbie when it comes to coding. I've done a bit in my time, but it's been a while... so chances are I'll understand the concepts if not the specifics... but I'm a bit time-poor at the moment, so was hoping for a push in the right direction to help cut out some of the head-banging and get to the fun stuff more quickly.
Thanks.