not sure if good place to ask this, if there is better place let me know and i can move it there.
I've modded a custom race and screwed up a bit in the entity so that my equivelent of militia captains cannot be assigned (forgot to change ID of assigner from dwarfs)
...
I thought I would just need to figure out what the assignment ID was and insert something to the units entity_links, but it seems [SITE] nobles don't show up searching through the entity list and extrapolating a number from nobles without [SITE] gives no result.
If I'm understanding this correctly, this is a position that you want to be able to assign from the "n" screen, but can't due to a mistake in the raws, yes? If that's the case, I would actually suggest trying to change this on the entity level, to allow the position to be assigned, rather than trying to forcibly assign a position that can't be assigned. I think it would be easier and less error-prone to leave the actual position assignment logic to DF.
The relevant data is probably stored at the entity level (e.g. "df.historical_entity.find(unit.civ_id)") but might be stored in the entity raws only instead ("df.entity_raw.find(unit.civ_id)"). Changes to raws (technically the in-memory versions of raws in this case) typically only affect new entities/objects, so I would recommend looking at the entity itself first.
I would recommend making a backup of your save first, in case you corrupt something irreversibly.
As a side note, you can actually drop the "df.global." prefix in both the "lua" interpreter and "gui/gm-editor" for convenience, e.g. "gui/gm-editor world" will work.
For example, if I want to find for what values of df.global.ui.xxx xxx is valid, what is best place to look?
That depends on quite a lot - what type(s) are you asking about here? My best answer is for enums, which would typically show up as numbers in Lua. Editing an enum field in gui/gm-editor would bring up a dialog with each (known) valid value, along with their names, and the enum name itself at the top. You could also track down the field in df-structures, like PatrikLundell mentioned. For scripting, you should
always use the name ("df.enum_name.ValueName"), never the number, because the raw numbers can change. Valid values for other fields can vary greatly, and df-structures might have more relevant information on a case-by-case basis.
I can even print the nemesis record and entity_link (or values for each index since it is array) but it just gives some text that gives nothing useful... EDIT: and some hex, which is even less useful than the text
Try printall() (shorthand: "~" in the "lua" interpreter). I'm guessing you were just getting something like "<nemesis_record: 0x25f25a0>", but if not, an example of what you are seeing would be helpful. Note that gui/gm-editor would also make it a bit easier to browse structures.
As for what a nemesis record
is, I suppose that is something that could be documented. I would need to track down past discussions on it. Many structures don't have documentation outside of the XML files, because as of 0.47.05, there are 1721 of them, and both writing the documentation and keeping it up-to-date would be a massive undertaking.