Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 356 357 [358] 359 360 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1456819 times)

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5355 on: March 22, 2014, 09:10:09 am »

I'm having a problem with simulateInput: OPTIONS, HELP, and MOVIES don't work at all. This section turned up when I was looking through the code - does anyone know of a way to get these keys to work?

Also, is there a way to convert key presses (e.g. Shift-X) to the corresponding keycodes (e.g. CUSTOM_SHIFT_X) other than parsing interface.txt? (That could work, but it would be hard unless there's a Lua raw-parsing library that I'm not aware of).
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5356 on: March 22, 2014, 10:19:18 am »

I'm having a problem with simulateInput: OPTIONS, HELP, and MOVIES don't work at all. This section turned up when I was looking through the code - does anyone know of a way to get these keys to work?
It is not possible, because those keycodes are handled within DF itself and are filtered out before they even get to the active viewscreen (which is why viewscreen has vmethods "movies_okay", "is_option_screen", "is_save_screen", and "help").

Also, is there a way to convert key presses (e.g. Shift-X) to the corresponding keycodes (e.g. CUSTOM_SHIFT_X) other than parsing interface.txt? (That could work, but it would be hard unless there's a Lua raw-parsing library that I'm not aware of).
The input configuration info currently isn't available to DFHack.
« Last Edit: March 22, 2014, 10:21:59 am 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.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5357 on: March 22, 2014, 11:07:41 am »

I'm having a problem with simulateInput: OPTIONS, HELP, and MOVIES don't work at all. This section turned up when I was looking through the code - does anyone know of a way to get these keys to work?

Also, is there a way to convert key presses (e.g. Shift-X) to the corresponding keycodes (e.g. CUSTOM_SHIFT_X) other than parsing interface.txt? (That could work, but it would be hard unless there's a Lua raw-parsing library that I'm not aware of).
I usually create a simple lua-screen that prints(all) the keys in function on_input.
Re: DFHack 0.34.11 r3
« Reply #5358 on: March 23, 2014, 12:14:00 am »

I don't suppose there is a plugin that will instantly perform the actions I have designated through the 'd' menu, is there?
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5359 on: March 23, 2014, 04:50:47 am »

I seem to recall a script called magic shovel, but I don't know if it works...
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5360 on: March 26, 2014, 02:18:02 am »

creature_raw.tissue (i.e. world.raws.creatures.all[123].tissue) - which currently has USERDATA listed
https://github.com/angavrilov/df-structures/blob/master/df.creature-raws.xml#L1100

Current tissue_template struct (for reference)
https://github.com/angavrilov/df-structures/blob/master/df.creature-raws.xml#L1272

We sort of guessed that the creature-specific tissue info was stored in creature_raw. The format of the data currently covered by the USERDATA is very similar to tissue_template, except that it is 0x120 long instead of 0x110. The extra 0x10 in length is inserted as follows:
Code: [Select]
offset size field type field name
0xf0 0x2 int16_t tissue_mat_state (unchanged from tissue_template)
0xf4 0x2 int16_t UNK?
0xf6 0x2 int16_t HEATDAM_POINT
0xf8 0x2 int16_t COLDDAM_POINT
0xfa 0x2 int16_t IGNITE_POINT
0xfc 0x2 int16_t MELTING_POINT
0xfe 0x2 int16_t BOILING_POINT
0x100 0x2 int16_t SPEC_HEAT
0x102 0x2 int16_t UNK?
0xf4 0x1c stl-string tissue_shape_str (offset increased by 0x10 from tissue_template)

Otherwise the data is a straight copy of the format of tissue_template (from 0x0 to 0xf0)

Dapper Dan

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5361 on: March 26, 2014, 04:32:42 am »

I used createitem to make bituminous coal once but now i've forgotten how i did it. could you guys help me, please?


EDIT: never mind. figured it out. it was createitem BOULDER INORGANIC:COAL_BITUMINOUS for those of you who also want to know this.
« Last Edit: March 26, 2014, 04:47:10 am by Dapper Dan »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5362 on: March 26, 2014, 10:03:53 am »

Is it possible to trigger PRESERVE_REAGENT depending on if a script was successful or not?

I'm guessing the answer is no, so a follow up. Can you read a reactions reagents and then re-create them depending on the script?
Logged

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5363 on: March 26, 2014, 12:21:19 pm »

Is it possible to trigger PRESERVE_REAGENT depending on if a script was successful or not?

I'm guessing the answer is no, so a follow up. Can you read a reactions reagents and then re-create them depending on the script?

Using a reaction lua hook, you can capture the reaction execution and set a reagent flag to true to conserve it. There is an exemple in the 'hire guard' mod on dffd.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5364 on: March 26, 2014, 08:32:01 pm »

It would be easier to have PRESERVE_REAGENT on by default, then have the script delete the items if successful.
Logged

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5365 on: March 27, 2014, 03:59:36 pm »

A quick query, has anyone done any work on creating a unit outfitted with specific equipement (weapons/armor) either in script or as a plugin

SpawnUnit script can create a unit.
Example scripts to set desired skills.
CreateItem script/plugin can create a new item.

Would assume that instead of ending item.MoveToGround(...) would need to write a method to equip the item as there does not seem to be a item.Equip(...) vmethod. E.g. Add to unit inventory, set the correct item worn flags, add an appropiate new unit_inventory_item to the unit etc.   It is the etc that i am concerned about  ;)

A second related question, what it needed to make a newly spawned unit act with different ai modes (e.g. thief, ambusher, seiger attack, seiger camp). Is it just setting the unit_flags1/2 appropiatly? Worst case i suppose could just directly update the unit.path/unit.enemy periodically.)

Aim to update SpawnUnit.lua to set skills and equiped items, and support creating custom squads of invaders.
« Last Edit: March 27, 2014, 04:02:34 pm by drayath »
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5366 on: March 28, 2014, 11:03:14 am »

Would assume that instead of ending item.MoveToGround(...) would need to write a method to equip the item as there does not seem to be a item.Equip(...) vmethod.

you shouldn't be using vmethods for that at all--you want dhack.items.moveToGround and dfhack.items.moveToInventory.

greycat

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5367 on: March 28, 2014, 03:12:28 pm »

I've been using DFHack with the LFR mod successfully on my home machine for some time now.  As some of you may remember, I built this using an incredibly baroque procedure involving a 32-bit chrooted old version of Debian and compiled gcc 4.5 from source code.

After doing all that, someone told me "Oh, you can just remove the libstdc++.so.6 file that comes with DF."

Well, today I decided to try that approach on a different machine (at work).  This is another Debian 7 64-bit system.  This time, instead of doing the chrooted build as I did at home, I tried moving the DF-supplied libstdc++.so.6 library out of the way, and then building everything with the gcc 4.7 toolchain provided in Debian 7.

I am using the DFHack source code from https://github.com/DFHack/dfhack with the one-line patch that is required to make it compile (adding #include <stdexception> in plugins/eventful.cpp).

After a few minor false starts, I was able to get this to build, and start up.  I generated a world, and embarked, and was able to play about a month before the game locked up.  Totally CPU-bound.  I had to kill it.  I tried reloading the save, but I had weird and inconsistent results.  Sometimes it would segfault.  Sometimes it would lock up before even displaying the embark.  Once it got far enough to display the embark, and then segfaulted.

I started a second worldgen, thinking that maybe it was some weird glitch with just that one world.  The second worldgen completed, and I embarked... and got the same lock-up.  I played around with various things, including "./dfhack -g" but didn't really get anywhere.

So, then I decided to copy the entire hack/ subdirectory from my home computer (containing the DFHack stuff that I built with gcc 4.5) to the work computer.  I moved the gcc-4.7-compiled hack/ subdirectory aside, and dropped the gcc-4.5-compiled hack/ subdirectory in its place.  Then I moved the DF-supplied libstdc++.so.6 library back into place.  I did not change anything else at all.  Then I reran ./dfhack and loaded the second fortress (autosaved upon embark).  This time I was able to play all the way through the spring, with no lock-ups or segfaults.
« Last Edit: March 28, 2014, 03:14:14 pm by greycat »
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5368 on: March 28, 2014, 07:28:15 pm »

Ta, moveToInventory was what i was looking for. Searching on that finds the companion-orders.lua script that then has all the code i need for wielding the items appropiatly.
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

catvanbrian

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5369 on: March 29, 2014, 03:16:44 pm »

how do I spawn units with certain castes like a ant man worker or a black dragon from masterwork dwarffortress which I am play right now
Logged
Pages: 1 ... 356 357 [358] 359 360 ... 373