I have recently discovered the gm-editor, and it's excellent. It is however, a little confusing, especially to those who are not fluent in coding etc, and I could only find 2 posts other than my own in search about it, neither of which seemed to explain anything on its use.
So, I figured I would share what I have learned, and ask here for input from others, for posterity's sake, and also to help others discover a brilliant DFHack tool.
So please, if you know something about the GM-editor post it here so others can find it.
quick note to use gm-editor type 'gui\gm-editor' into the DFHack console, while (v)iewing a creature.
I do have some things to offer:
Moods
The mood setting in the GM-Editor is by default -1. -1 is for every non-baby dwarf in your fort.
You can change the value on the line though and induce moods. This is what values do what:
mood 0 - has the aspect of one fey
mood 1 - particularly secretive
mood 2 - possessed by unknown forces
mood 3 - brooding darkly
mood 4 - has a horrible fell look
mood 5 - stricken with melancholy
mood 6 - running around babbling
mood 7 - berserk rage
mood 8 - baby insanity
mood 9 - staring off into space
These can be changed at will; so that if you accidentally make a dwarf the wrong mood, resetting it to -1 will clear them of all mood effects.
NOTE: you can 'fix' melancholic dwarves, crazy dwarves and even berserk dwarves like this - although, any dwarves attacking a berserking dwarf will continue their attacks after the berserk dwarf has been 'fixed'.
There are 2 more mood related options found in the 'flags1' options on the GM-editor.
These are 'has_mood', and 'had_mood'. Has_mood seems to be the trigger for the dwarf being in a 'mood'. And the had_mood seems to be the games way of tracking whether a dwarf has had his/her ONE allotted mood - presumably, changing had_mood from true to false after a dwarf has already made an artifact would allow the dwarf to make another artifact, but I am yet to test this.
There is a 'artifact_name' option found in gm-editor>status. It would seem obvious that this decides an artifacts name, but I am yet to test this section.
The final mood related section I have found is found in the 'job' section. In the job section, there is 2 options entitled 'mood_skill' and 'mood_timeout'. These seem to define what skill the moody dwarf will use for his/her artifact, and the timeout value seems to be a countdown for the dwarf to successfully complete the artifact, or the dwarf goes insane.
I am still trying to figure out/record what values equal what skills. 27 seems to be weapon smithing, and 5 seems to be engraving.
So far however, I haven't been able to force a dwarf to make an artifact, but it may be because of the mood requirements, such as amount of discovered tiles, fort value, population etc.
If anyone more knowledgeable can help me with this, I would be most grateful.
Misc., needs & health related uses
Under the 'counters' and 'counters2' options in the gm-editors gui, you can set various states, such as winded, stunned, webbed etc, as well as change how hungry, sleepy, thirsty, full, and fat a dwarf is.
It seems that higher values set here = a longer duration in that state for the health related conditions. Whereas, higher numbers on the hunger, sleepiness, exhaustion, and thirstiness counters makes a creature more hungry/thirsty/drowsy etc.
Values of 50,000-60,000 seem to trigger the flashing downward coloured arrows dwarves display, denoting hunger, thirst, and drowsiness.
INTERESTINGLY, I have used this on grazing pets that were starving indoors, and set the value to -1, and this seems to make the creature not need to eat.
Entity control and 'spawnunit' workarounds
Using DFHacks 'spawnunit' command creates a friendly creature, often treated as 'tame', that is a 1 year old adult. Meaning you can spawn friendly goblins and dragons etc. The GMeditor allows you to set these as hostile or make any wild/invader that was not spawned by DFHack a friendly, tame member of your civ.
(V)iewing the creature you want to edit, open the GM-editor and look for the 'civ_id' 'population_id' and 'invader_id' lines.
These values control whether a creature is a member of your fort/civ, an actual citizen as opposed to a tame creature, and whether or not the creature is a hostile invader.
There is some buggy behaviour when trying to make a wild creature a citizen of your fort, as opposed to just a member of your civ (like livestock etc).
But if you check one of your dwarves, you will find the number allocated in their civ_id, this number is your current forts citizen id.
You can use that number to make other creatures a part of your fort, by setting their civ_id to that value.
Your dwarves will also have a population_id. This seems to define the creature as a citizen. So you can use the value you find here to make a creature a citizen. This can be very buggy, and has made my game crash, but I haven't tested it much.
Making creatures 'wild', as opposed to hostile, is as simple as making all 3 of the ids set to -1.
To set a creature as an invader, they need to have a valid civ-id, and the same value found in their civ-id should be in their invader-id.
NOTE: It doesn't seem to be possible to set a creature as your civ AND an invader.
Spawnunit's spawned creatures are not historical figures, meaning when they die, if you cannot bury their corpse, they will come back as ghosts. Not a problem right? But you cannot engrave a slab for them as they are not historical figures, and thus are not tracked by the game. You will not find their names in the list of dead when trying to engrave a memorial slab.
This means you CAN be left with a fort dangerously haunted by ghosts you cannot put to rest. Fear not: GM-editor can help you!
Simply (V)iew the ghost, go to 'flags3' and change 'ghostly - true', to 'ghostly - false'. The ghost will become an alive, solid form again, but be missing its upperbody, and therefore die of suffocation shortly after.
At which point you can bury the creatures corpse and be rid of an otherwise solvable ghost problem.
If this is in the wrong place, I apologise. Please share anything you can about using gm-editor.