Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 312 313 [314] 315 316 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1441018 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4695 on: October 04, 2013, 07:27:23 pm »

I love how the units for marriage are called victim in the script. ^^ Maybe people can build a chapel and use a reaction to marry civ-members. ;)
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 :::

chronomad

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4696 on: October 05, 2013, 07:41:21 pm »

New user here, bear with me :)

I've been trying to change the caste of an existing dwarf in masterwork using dfhack by changing its caste property like so:

unit.caste = 37

37 being an example. This is the casteid I found for a wrestler caste (querying other units with unit.caste as well). When I change it, I see the change reflected in the "thoughts" screen for the unit in the game. However, as soon as I unpause the game, I get an announcement "Dwarf_Name, Profession has transformed into a dwarf!" and if I check the thoughts screen, the caste is no longer there.

Any help appreciated, thank you :)
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4697 on: October 05, 2013, 07:52:46 pm »

You'll want to change unit.enemy.normal_caste; doing this will cause a transformation message, but the transformation is permanent and works perfectly.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4698 on: October 05, 2013, 07:59:57 pm »

Does that work for race as well?
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4699 on: October 05, 2013, 08:01:41 pm »

Yeah.

chronomad

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4700 on: October 05, 2013, 08:06:26 pm »

You'll want to change unit.enemy.normal_caste; doing this will cause a transformation message, but the transformation is permanent and works perfectly.

Works like a charm. Much appreciated. Odd how it works. If I wanted to find more info on unit properties where could I go? Thanks again :)
Logged

ElenaRoan

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4702 on: October 05, 2013, 11:45:15 pm »

no response to my question? not even an "impossible"?
Logged
Someone, get the bug zapper! What do you mean that won't work on a bug the size of a house which glows? No, I don't want to hear it. Just get the damn zapper.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4703 on: October 06, 2013, 10:45:16 pm »

Some things I discovered when examining the combat calculations:
https://github.com/angavrilov/df-structures/blob/master/df.items.xml#L164

Code: [Select]
"item::vtable","1","0x148","0x4","vmethod","getVolume","int32_t","" <- the total volume of the piece of armor is also used as the armor's thickness (weapon penetration distance)

"item::vtable","1","0x304","0x4","vmethod","getBaseWeight","int32_t","" <- actually appears to get the SIZE/10 of the item. This is used along with the stack size by getVolume to calculate volume. Density only comes into play in code outside of the vmethod.

"item::vtable","1","0x360","0x4","vmethod","vmethod216","",""  <- determines the volume of armor being struck (i.e. the volume under the contact area of the weapon)

"item::vtable","1","0x364","0x4","vmethod","vmethod217","",""  <- checks an armor item for STRUCTURAL_ELASTICITY_* related flexibility (i.e. mail, clothing)

"item::vtable","1","0x368","0x4","vmethod","vmethod218","",""  <- checks an armor item for STRUCTURAL_ELASTICITY_WOVEN_THREAD related capping of SHEAR values (i.e. clothing)

Also re-discovered (as was found in that bolt properties thread) how armor thickness scales with volume, but body part thickness scales with the cube root of volume. It looks unintended on Toady's part, since armor and clothing for giant creatures is absurdly thick and massive.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4704 on: October 08, 2013, 03:18:06 am »

Can Lua coroutines be used in user scripts (scripts directory, or game save init.lua)?

Everything called from the console actually already runs in a coroutine. Also:

https://github.com/peterix/dfhack/blob/master/library/lua/gui/script.lua

uh

error loading module 'gui.script' from file '..\hack\lua\gui\script.lua':
        ..\hack\lua\gui\script.lua:157: ')' expected (to close '(' at line 156) near '='


which is caused by this:

function showMaterialPrompt(title, prompt)
    require('gui.materials').MaterialDialog{
        frame_title = title,
        prompt = prompt,
        on_select = mkresume(true,
        on_cancel = mkresume(false),
        on_close = qresume(nil)
    }:show()

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4705 on: October 08, 2013, 01:56:53 pm »


Behold the fancy way for adventurers to move around on their mounts. the script comes with 7 controls and one that sets the mount for control.  You need the mount script to be able to use this properly, also to get off the mount you just need to travel.
warning if you mount say a ghost you will ride through solid rock and beware of magma also flyers are kinda crazy with pathing and will fly high and low also mount might run to fight wild animals or run from them.
edit: or you could use this mount script.
« Last Edit: October 09, 2013, 11:19:16 am by Rumrusher »
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4706 on: October 08, 2013, 11:45:04 pm »

In light of dfterm3 looking pretty stable...  Is it possible to pass dfhack commands from a GUI popup in DF itself? 

There are search bars and so on which can take text, and I imagine it's possible to somehow pass this back to run as a command - displaying the some output as the console would be cool but plain input is enough to open up new horizons for dfterm.  As it stands, you can't (eg) enable workflow or use autodump without having set up keybindings for them beforehand; and while Falconne's keybinding list plugin is cool I don't binding everything possible is a good answer. 

Is this even possible?
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4707 on: October 09, 2013, 12:18:05 am »

It's possible to run scripts, but I don't know about plugins.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4708 on: October 09, 2013, 01:02:39 am »

The problem with using df itself for input is that plugins expect that they are running on a different thread and using a completely separate input system, so some may do stuff like lock the game state mutex and wait for input. This is a big deadlock hazard.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4709 on: October 10, 2013, 05:04:20 pm »

I'm assuming you were thinking of running commands through the web interface. This wouldn't necessarily require running them through the DF interface - a separate prompt could be set up fairly easily to run simple commands from the web interface, but I don't know if interactive I/O would be possible (basically, commands using the command line like "tiletypes" would be tricky).
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.
Pages: 1 ... 312 313 [314] 315 316 ... 373