Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 102 103 [104] 105 106 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457948 times)

Tierre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1545 on: May 22, 2012, 04:07:37 am »

Is there some manual on how to do it? I know the basics of python and PL/SQL programming but i had no practice with lua in dfhack:) Some tips and links maybe:) I would really be glad just to learn how to do it;)

PS in fact i suspected that it has to be here already, but i wasn't sure. Also some kind of utility in dfhack helping newbies doing it can be a good idea.
Logged

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1546 on: May 22, 2012, 04:09:30 am »

It could already be there in dfusion actually - Rumrusher in particular likes that kind of stuff  ;)
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1547 on: May 22, 2012, 04:22:03 am »

Changing attributes and traits in game (aside from creature definitions trait changes) and checking flags - like invader. Changing strange mood type. Resurrecting creatures. Making them pregnant (well runesmith didn't have that but that's i want :) ).
So a little tutorial:
  • first you need to start lua, this is done by typing "lua" in dfhack window (some stuff that i don't get around to integrating into main thing still resides in dfusion, so if you need it type "dfuse" first or "dfusion" for a little more user friendly menu based system). it should say [lua]
  • now select a unit in the game e.g. with [v]iew
  • type "unit=dfhack.gui.getSelectedUnit()" (for more of these uber helpfull commands see Lua api
  • checking flags is trivial: type "printall(unit.flags1)", "printall(unit.flags2)", "printall(unit.flags3)", changing them also easy: "unit.flags1.dead=true"
  • for a list of unit fields (with values) type "printall(unit)"
  • some things may hide in substructures e.g. "printall(unit.status)"
Bonus:
making a creature pregnant is not trivial, but there is already a script in dfusion, (again, activated with "dfuse" to be used in lua, or "dfusion" for a menu gui) so you can do "tools.empregnate()" with a cursor on (or [v]iewing a creature) or if you already have written "unit=dfhack.gui.getSelectedUnit()", you can do "tools.empregnate(unit)".
Bonus Bonus:
try this (with something you are not afraid to lose, destroy etc...):
Code: [Select]
for k,v in pairs(df.global.world.units.all) do tools.empregnate(v) end

Also for a more complete Lua guide, please search the internet, the syntax is very easy (compared to all other languages) there are some strange things (like "almost everything is a table" ) but it's very easy to learn and should not take a lot of time.

Happy hacking.
« Last Edit: May 22, 2012, 04:23:58 am by Warmist »
Logged

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1548 on: May 22, 2012, 04:34:54 am »

  • checking flags is trivial: type "printall(unit.flags1)", "printall(unit.flags2)", "printall(unit.flags3)", changing them also easy: "unit.flags1.dead=true"
  • for a list of unit fields (with values) type "printall(unit)"
  • some things may hide in substructures e.g. "printall(unit.status)"

Some time recently I've added '~' as an alias for printall at toplevel, so just "~unit.flags1" etc should work. The complete set of magic prefix characters now is:

  • '!' to print all values returned by an expression.
  • '~' to do '!', and then call printall with the first one.
  • '=' to assign all values to automatically named variables, and print them.

And to make some lua code behave almost like a native dfhack command, put it into a file in hack/scripts/ - see scripts already in there for examples. Scripts in subdirectories are still usable as e.g. "fix/item-occupancy", but invisible to the 'ls' command. Note: these scripts cannot use dfusion code yet.
« Last Edit: May 22, 2012, 07:48:05 am by ag »
Logged

Tierre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1549 on: May 22, 2012, 06:26:11 am »

Wow. Thanks a lot. I will start digging in it then i return home:) (Can't play at work - any exe file opened on a pc is logged and then security will start asking questions like what am i doing at worktime....). This will make it much easier than waiting for Runesmith as i can search for all things myself and do some !SCIENCE!.

Prepare dwarfs... you are up for some really nasty experiments.
Logged

Rubberneck

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1550 on: May 22, 2012, 07:09:03 am »

Does Stonesense work with the current (0.34.10) release? Since 0.34.07 my computer completely freezes whenever I try to initialize it, forcing me to reboot.
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: DFHack 0.34.10 r1
« Reply #1551 on: May 22, 2012, 07:41:38 am »

That might have to do with the new dwarf-sprites.

You can try two things:
1) Go into the stonesense folder and open init.txt
Try to find the second to last option, it should say renderer=ANY, change that to OPENGL
Check if stonesense works for you. If it doesn't, go to step two.

2)Open the index.txt in stonesense/creatures.
find the sentence 'large_256/index.txt', put a '#' infront of it, or remove the line entirely. Save. Test out stonesense.
If this doesn't work, then there's something wrong there's no solution for yet.

There's HD content now, but if your computer hasn't got a decent amount of ram...
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1552 on: May 22, 2012, 08:39:17 am »

I made some changes to dwarfexport.cpp, but I have no idea how to build it within visual studios 2010.

f6 doesn't do anything, nor do I see an option to build.  I also don't see a project file to open to work with, although I don't think I need it, because this is supposed to compile as a dll, anyhelp would be appreciated.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1553 on: May 22, 2012, 08:52:36 am »

follow the build instructions. you need cmake for one, but there's a bunch else.
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1554 on: May 22, 2012, 08:56:47 am »

I see a build folder, where are the build instructions?

I found some instructions on the 1st page

but... if anyone is interested in helping me, I get this when I try to build-release.bat

Spoiler (click to show/hide)
« Last Edit: May 22, 2012, 09:02:42 am by thistleknot »
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1556 on: May 22, 2012, 09:44:40 am »

https://github.com/peterix/dfhack/blob/master/COMPILE.rst

THANKS, got the solution file generated, hopefully I'll have my new dwarfexport up tonight, it's some real simple changes.  I'm hoping to do this for some dwarf therapist research.

Here's a preview of what I did to traits, simple stuff really.  I'm hoping that if I do the same for labors and skills, that it will auto generate the columns one at a time... I'm not sure how that will work.  I may have to generate EVERY skill column prior, and do a loop.  Which would suck.

Spoiler (click to show/hide)

Update:

I just realized, am I wasting my time if I can generate this stuff within dfhack's console via lua scripting?

If so, any suggestions on how I can export dwarf names, attributes, traits, skills, labors assigned for each dwarf as one record/row per dwarf in a csv format?
« Last Edit: May 22, 2012, 10:23:06 am by thistleknot »
Logged

ClkWrkJester

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1557 on: May 22, 2012, 03:56:55 pm »

I've been watching this thread in confusion... are we past the point where DFHack is something nice and simple for idiots like me to just drop in and go with?
Logged
Carve out a massive pit and construct a copper block tower! Challenge those goblin bastards with your phallus of justice!

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.34.10 r1
« Reply #1558 on: May 22, 2012, 04:15:35 pm »

I've been watching this thread in confusion... are we past the point where DFHack is something nice and simple for idiots like me to just drop in and go with?
And why would that be the case?  DFHack is just a lot more than it was before, but that doesn't mean all the old stuff isn't still there :)

ClkWrkJester

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.10 r1
« Reply #1559 on: May 22, 2012, 06:40:15 pm »

I just watched all this talk of lua and branches and compiling... and my liberal arts brain popped, but seeing a new proper release makes me feel better. >.>
Logged
Carve out a massive pit and construct a copper block tower! Challenge those goblin bastards with your phallus of justice!
Pages: 1 ... 102 103 [104] 105 106 ... 373