Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Using DFHack or other to mod preferences/personality  (Read 4220 times)

Dekon

  • Bay Watcher
    • View Profile
Using DFHack or other to mod preferences/personality
« on: May 20, 2014, 10:30:59 am »

Quietest told me this was possible, but I would have to be careful.

Does anyone have instructions, or link to instructions, that would inform a novice on how to edit an individual dwarf's preferences and personality, using either DFHack or another program?
« Last Edit: May 20, 2014, 10:49:33 am by Dekon »
Logged

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #1 on: May 20, 2014, 02:01:32 pm »

Well, I have not been able to edit preferences, and would still like help with this.  However, I -have- managed to figure out personality.  For anyone interested, I borrowed data from the brainwash script from Vjek at : http://dl.dropboxusercontent.com/u/1339319/df_scripts/34.10/brainwash.lua

Basically, I went into the Lua in DFHack, typed in 'unit=dfhack.gui.getSelectedUnit()' with my k cursor on a unit, and then typed in 'unit.status.current_soul.traits.ANXIETY=1'.  Vjek's script, unfortunately, is not very versatile.  It seems to be a manner of 'either you want your dwarf to be as he/she is, or the best dwarf ever!'   If anyone ever enjoys writing scripts, you may wish to create a DFHack script that allows for more controlled augmentation ('select dwarf, type in stat, type in value') with some help and menu items.

Anyway, I'll keep trying with preferences...
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #2 on: May 20, 2014, 04:57:47 pm »

Select your dwarf, then type gui\gm-editor, then you will have a graphical interface that allows for changing of values of the dwarf.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #3 on: May 20, 2014, 05:20:14 pm »

Preferences are really difficult to pull off. Personality is a single number per trait, easy enough, but preferences are a pain that will crash your game every time you get it wrong.

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #4 on: May 20, 2014, 07:04:00 pm »

Select your dwarf, then type gui\gm-editor, then you will have a graphical interface that allows for changing of values of the dwarf.

Well, that is helpful.  And indeed, it would seem to do most things I would like..  Unfortunately, preferences looks like it will be difficult..

Preferences are really difficult to pull off. Personality is a single number per trait, easy enough, but preferences are a pain that will crash your game every time you get it wrong.

Yeah, this looks surprisingly difficult..  I need something to reference on how this is supposed to work.
Logged

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #5 on: May 20, 2014, 07:16:51 pm »

Well yay, I was able to change the stone someone likes.  That's a good start... and actually no crashes yet.  Apparently every possible thing in the game has a number, starting with 1 which is 'gold'.   Changing the MatinDex seems to be most of what is necessary to change this, though I imagine itemtypes and id's will need to be changed for certain things, else crashes.

So here's the big next question :  Can I -add- a vector?  I don't see any option for this.  This would mean my dwarves are limited to however many vectors they start with, which would restrict my ability. 
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #6 on: May 20, 2014, 07:34:03 pm »

It actually starts with 0, which is iron.

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #7 on: May 20, 2014, 07:50:03 pm »

It actually starts with 0, which is iron.

Yeah... I see that now.  It follows through the raws, then, starting from there.

I don't suppose there's a preexisting list that lists all objects based on 0 for iron?  I'm creating one in an excel right now, but it's a lot of work... especially since I'm avoiding functions, which I really shouldn't. 

And again, still hoping to figure out if I can add vectors. 
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #8 on: May 20, 2014, 08:00:18 pm »

Just use dfhack.matinfo.find('IRON').mat_index and such.

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #9 on: May 21, 2014, 08:22:36 am »

That command is just returning errors in DFHack - how am I supposed to use it?

Also, is there a way to find furniture and such?  Clearly it's type 4, but the itemtype seems to be almost utterly random.  I don't know if there's a list somewhere of all these things in the raws.  With bars and stones and such, it all follows the listing of inorganic_type, and follows that order quite well.  Furniture seems mixed in with generic things like 'armor', 'weapons', 'footwear', 'crowns', etc. 
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Using DFHack or other to mod preferences/personality
« Reply #10 on: May 21, 2014, 12:49:10 pm »

Item types can be found here and can either be specified by number or by name (e.g. "df.item_type.WINDOW"), and preference types are part of this list (though, since the enum isn't global, you probably won't be able to enter the actual names).
« Last Edit: May 21, 2014, 12:51:39 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.

Dekon

  • Bay Watcher
    • View Profile
Re: Using DFHack or other to mod preferences/personality
« Reply #11 on: May 21, 2014, 01:21:04 pm »

Item types can be found here and can either be specified by number or by name (e.g. "df.item_type.WINDOW"), and preference types are part of this list (though, since the enum isn't global, you probably won't be able to enter the actual names).

Thanks Quietust.  You win the helpful award, sir.   
Logged