I didn't notice this a few days ago! Thanks for the replies
.
Thanks for sharing your techniques. I'll be sure to check it up and hopefully know a thing or two at the end.
You're very welcome!
Hey I was just coming here to get some info on rules.csv. Thanks!
Finally ready to dive into those waters!
EZ faction has all my factions in the campaign but in order for their backstory to be authentic and immersive I have to break into rules.csv for custom interactions and flavor dialogue.
Question:
Is is informative enough that I will be able to understand how to connect custom defined entities to the economy as a market? I am still getting a gauge on how many markets I can realistically add, but I want at least a couple directly inserted into the core worlds and they will have to be tied to the economy there.
You know I'm not entirely sure - this example switches a market but there might be some initial setup I'm not aware of. I would check some of the mods that add a system - those probably have what you want. Still, I'll look around, and maybe put this in the next one
.
Very much appreciate the tutorial -- it was a big help getting started with modding. Thanks!
You're very welcome! I'm glad it helped.
Had some time to go through this and thanks a ton for taking the time to write this up and create the mod! Its well-written, concise and provides an easy way to get started with rules that doesn't completely overwhelm you with all you can do.
Triggers seem pretty self-explanatory, but for specific conditions, am I right in what I read that there isn't any documentation other than the file itself for examples (and your mod of course)?
So if I wanted a list of the various ways you can structure conditions I just need to find something in the rules file that does something similar to what I want?
Unfortunately yes - the 'base' triggers aren't really documented and to be honest I don't know if they will be stable in the future. The good news is that the base game rules.csv is relatively straightforward - I open it in excel and search for terms like 'market' etc. What I'm planning on doing is hooking my rules into triggers at an early level (like populate all in this example) and then making the rest of the sub-menus run on my own custom triggers.
Sorry if this seems like a silly question, but looking to see if I can compare variables already present in the engine (as referenced in the API) or if 'conditions' are only predetermined booleans with presets already defined in rules itself.
I know I could probably for sure do this in the script itself too, but I'm not sure how efficient that would be compared to a condition check in rules.
Not a silly question at all: You can as long as the variable in question is stored in the memory map that rules.csv can access - but most of the data in the main SS api is not available that way. You could in another script store these variables yourself for later use - say a setup script that uses the API to get values not defined in the rules memory map by default and saves them to $Global.Modname.data1... (Uhh, wait, I don't know if the sub-dot notation works. Probably safer to use $Global.ModnameData1 or similar).
To find what values are available in vanilla takes a bit of work but isn't too bad: If you enable dev mode (in starsector-core/data/config/settings.json) and go to any menu you have the option to 'dump memory' - this will give back a giant list with all of the memory that rules.csv has access to.
For example, if I fly to Tibicena the local entries (there's a set for every key in memkeys - the local ones have no prefix) are:
If you wanted your menu option to, for example, only be available when there is market, it is friendly, and stability is high, you could write:
$hasMarket
!$isHostile
$stability >= 7
In the condition line (and yes, you need new lines between the conditions, which is why a spreadsheet editor like excel is super handy even though something like N++ is usually better).
I hope that helps.