Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 6

Author Topic: [GM-EDITOR] Questions, info, and uses.  (Read 25471 times)

TheOnlySolitaire

  • Bay Watcher
  • [BRAG_ON_KILL]
    • View Profile
[GM-EDITOR] Questions, info, and uses.
« on: January 09, 2014, 12:38:21 pm »

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.
 
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #1 on: January 09, 2014, 12:44:03 pm »

Also please post your annoyances and possible improvements. Some things that might be not obvious:
  • 'x' - will allow to filter by either key or value in the lists (string.find(k,'created')  when typed in the dialog will leave only items containing 'created' in them)
  • alt-i - allows to insert new values into lists. BUT sometimes the list must be sorted so that might not work (e.g. unit skills!)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #2 on: January 09, 2014, 01:00:53 pm »

First thing I did after reading this was this:

Code: [Select]
[INORGANIC:EDITOR_TEST]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL:TEST]
[SYNDROME][SYN_CLASS:\AUTO_SYNDROME][SYN_CLASS:\COMMAND]
[SYN_CLASS:"gui\gm-editor"][SYN_CLASS:mood][SYN_CLASS:4][SYN_CLASS:\WORKER_ID]

Obviously, this did not work, as activating the gui\gm-editor does open the gui ingame, and does not accept further dfhack commands as input. Otherwise it would have been possible to use autosyndrome, syndrometrigger and probabilitysyndrome to affect creatures ingame, by interactions or reactions, without the need for use input.

A mood inducing drink, a psychiatrist that heals babbling and melancholic dwarves, a mage that kills enemies by making them hunger, thirst and age to death, a druid that converts wildlife to pets, a ghost-related workshop... these were the things that came to mind.

Take this feedback as both a piece of info (Gm-Editor can not be used by dwarves themselves), and a suggestion. (It would be nice, if Gm-Editor could be used by dwarves)

Solid work on the How-To. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #3 on: January 09, 2014, 01:13:26 pm »

Granted I know nothing of gm-editor, but it seems that if the possibilities exist in the gui, then it should be able to make a command line argument that runs the required script.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #4 on: January 09, 2014, 01:20:30 pm »

naah you can already do that, try this and report back:
Code: [Select]
[SYN_CLASS:":lua df.unit.find("][SYN_CLASS:\WORKER_ID][SYN_CLASS:").mood=4"]

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #5 on: January 09, 2014, 01:37:02 pm »

I tried it, the errormessage I get is: " is not a recognized command.

I tried [SYN_CLASS:lua] [SYN_CLASS:df.unit.find(][SYN_CLASS:\WORKER_ID][SYN_CLASS:).mood=4] next - It gives "(lua command):1: unexpected symbol near <eof>.

Next try was: [SYN_CLASS::lua] [SYN_CLASS:df.unit.find(][SYN_CLASS:\WORKER_ID][SYN_CLASS:).mood=4]. Only different is the extra ';' in front of the lua.

Result: df.unit.find( is not a recognized command. Apparently the double :: stops the syn-class from registering properly.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #6 on: January 09, 2014, 01:44:32 pm »

xlua.lua file:
Code: [Select]
local args={...}
local f,err=load (table.concat (args," "))
if not f then qerror(err) end
f()
and then
Code: [Select]
[SYN_CLASS:xlua] [SYN_CLASS:df.unit.find(][SYN_CLASS:\WORKER_ID][SYN_CLASS:).mood=4]

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #7 on: January 09, 2014, 01:51:32 pm »

Works.

I will do some science on it once I find the time, and see what gm-editor + autosyndrome + fov-command can do. I am fairly certain that melancholic-dwarf-healing and wildlife-converting can be done.

How stable is all this? Does meddling with these unit flags do any harm, cause crashes? And somehow related: Can this be used to make creatures a historic figure? Because I really, really need that for spawnunit. It makes no sense to make a race of undead warlords, if your ghouls and skeletons cant join your army.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #8 on: January 09, 2014, 01:55:04 pm »

Is there a list of things that can be changed along with mood in this way?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #9 on: January 09, 2014, 01:57:51 pm »

There is a GUI that opens in DF when you use it, so you can have a look and play around. I guess if there ever will be a full list, this is the place to post it.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #10 on: January 09, 2014, 02:00:10 pm »

There is no list, except for looking over a unit in fort mode and typing 'gui/gm-editor' to see fields that are editable. Also if you access field by entering another structure then you can edit it by placing '.' e.g. if i want to change blood count (fastest way to kill unit) i can access it with ".body.blood_count=0"

There is around 500 accessible fields in unit alone (more if indirectly accessible). So no, i think lists would not do any help.

TheOnlySolitaire

  • Bay Watcher
  • [BRAG_ON_KILL]
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #11 on: January 09, 2014, 02:05:51 pm »

Works.

I will do some science on it once I find the time, and see what gm-editor + autosyndrome + fov-command can do. I am fairly certain that melancholic-dwarf-healing and wildlife-converting can be done.

How stable is all this? Does meddling with these unit flags do any harm, cause crashes? And somehow related: Can this be used to make creatures a historic figure? Because I really, really need that for spawnunit. It makes no sense to make a race of undead warlords, if your ghouls and skeletons cant join your army.

AWESOME! I'm so glad I made this thread, I thought it would just get ignored to be honest. Glad something came of it all. :)

As far as I have tested, there haven't been any crashes, so it seems stable - things don't always work though, but I think it may be a case of figuring out the variables, or missing a relevant line on the editor: there is a lot buried there.

- there have been a few issues regarding moods - the mood doesn't seem to trigger, or transitions straight into failure, causing berserking/melancholy/babbling, but this is fixable so far.

messing with unit flags is something I'm testing at the moment, will post again once I have some more thoroughly tested results, but so far it doesn't seem to cause issues. I've regularly messed with the thirst/hunger/sleep counters, the creatures fat values, and conditions such as stunned/nauseous etc. Webbed doesn't seem to work though.


There IS some defining options for historic figures, 2 id values that seem to need to be the same, and a flag that lists the creature as historical - will test now. But I think this is what I tried the other week when using spawnunit too, iirc it caused a crash, but we will see...

On a related note for your zombies/skeletons - there are flags that seem to be able to be changed to make a creature a zombie or skeleton, again I will test these briefly now.

Is there a list of things that can be changed along with mood in this way?

what sort of things do you have in mind?

I mean, the GM-editor is DEEEP. There are options such as rider and ridden, which I assume to be how the game handles mounted creatures, but it has a LOT of values/flags/counters which can be changed, and a lot more I can't understand with my coding illiterate brain lol

EDIT: Ninja'd by Warmist :)
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #12 on: January 09, 2014, 02:08:04 pm »

There is no list, except for looking over a unit in fort mode and typing 'gui/gm-editor' to see fields that are editable. Also if you access field by entering another structure then you can edit it by placing '.' e.g. if i want to change blood count (fastest way to kill unit) i can access it with ".body.blood_count=0"

There is around 500 accessible fields in unit alone (more if indirectly accessible). So no, i think lists would not do any help.

Wow, I didn't realize. I thought it was just a couple things.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #13 on: January 09, 2014, 02:08:42 pm »

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'.
The only values that will have any direct effect on behavior are the "insanity" values - setting a sane dwarf to any of the "strange mood" values will not induce a strange mood.


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.
The "mood_skill" value is just a skill ID which you can look up in the df.job_skill enum.

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.
The reason you cannot make a dwarf create an artifact is because you need to create a Strange Mood job (just like "Forge Anvil" or "Brew Drink", there are thirteen different Strange Mood jobs, one for each skill category) and populate it with the list of items you want the dwarf to collect. When the game itself starts a strange mood, it does a bunch of individual steps which include creating the Strange Mood job, setting the mood_type, setting the mood_skill, and printing the announcement message.
« Last Edit: January 09, 2014, 02:10:14 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [GM-EDITOR] Questions, info, and uses.
« Reply #14 on: January 09, 2014, 02:14:37 pm »

TheOnlySolitaire: If you could do more science and find out what can be done and what cant be done, I am more then willing to contribute reactions, workshops, inorganics and putting it all into a bundle for players to use, without the need to touch dfhack themselves.

Quote
On a related note for your zombies/skeletons - there are flags that seem to be able to be changed to make a creature a zombie or skeleton, again I will test these briefly now.
Thats not necessary. The skeletons are actually caste members and do labors. I dont want them to be actual undeads. The problem I face is simply that I spawn these civ-members with spawnunit, and they cant join squads.

I would be very interested in setting a flag that makes the unit disappear or make them 'friendly' and leave the map, like diplomats or merchants do. In short: I want to tell dwarves to leave the fort. An alternative to get rid of migrants and unhappy dwarves, send them back to the mountainhomes.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::
Pages: [1] 2 3 ... 6