Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 260 261 [262] 263 264 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1398615 times)

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #3915 on: June 02, 2013, 02:25:00 am »


able_stand was renamed to limbs_stand_max and able_stand_impair was renamed to limbs_stand_count

Thanks. Is there somewhere I can see a list of these values?
Cheers, I can confirm this script fixes lost ability to stand
Code: [Select]
repairhim = lambda { |u|
    # dirty
    if u.body.wounds.count > 0 then
      u.body.wounds = []
      puts "supermedic: cleared all wounds."
    end
    if u.status2.limbs_stand_max < 2 then
      u.status2.limbs_stand_max = 2
      puts "supermedic: repaired lost stand ability."
    end
    if u.status2.limbs_stand_count < 2 then
      u.status2.limbs_stand_count = 2
      puts "supermedic: repaired impaired stand ability."
    end
    # maybe dirty
    if u.job.current_job.job_type == :Rest then
      u.job.current_job.job_type = :CleanSelf
      puts "supermedic: released from 'Rest' job."
    end
}

if him = df.unit_find then
  repairhim[him]
end
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3916 on: June 02, 2013, 03:46:01 am »

Does the DFusion empregnate script make eggs fertile?
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?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3917 on: June 02, 2013, 03:58:37 am »

Does the DFusion empregnate script make eggs fertile?
Nope.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3918 on: June 02, 2013, 04:13:45 am »

What about applying a transformation into the male caste on some random creature, even if it resets after a tick? Will the eggs fertilize then?
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?

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3919 on: June 03, 2013, 12:26:45 am »

In trying to solve the "Babies and children don't grow" bug ( http://www.bay12forums.com/smf/index.php?topic=126558.0 ), I found that unit.flags3.unk1 ( https://github.com/angavrilov/df-structures/blob/master/df.units.xml#L95 ) may be involved. The flag is set to false in most of the population, but it is set to true in the rare few children who are growing normally. The flag is also set to true in dwarves who are over 100 years old, and I don't understand why.

...
If you can figure out more about these fields, it can be updated and made even better ;)
...
See my post above - the fields appear to be volume, contact area, and length/height.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3920 on: June 03, 2013, 02:30:59 am »

Have you tried setting the flag yourself and seeing if it had any effect on growth?  Possibly set it to true and wait until a critter's birthday to see if it causes their size to be recalculated?

I must admit I'm at a loss on precisely what the definition of the flag could mean.  It might have something to do with age checking, such as whether the thing needs to have events like growing into a peasant or dying of old age checked on its next birthday?
Logged
Through pain, I find wisdom.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3921 on: June 03, 2013, 08:59:04 am »

Have you tried setting the flag yourself and seeing if it had any effect on growth?  Possibly set it to true and wait until a critter's birthday to see if it causes their size to be recalculated?

I must admit I'm at a loss on precisely what the definition of the flag could mean.  It might have something to do with age checking, such as whether the thing needs to have events like growing into a peasant or dying of old age checked on its next birthday?

If I change the flag, the game changes it back a few ticks later without changing the creature size.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #3922 on: June 04, 2013, 03:36:55 am »


able_stand was renamed to limbs_stand_max and able_stand_impair was renamed to limbs_stand_count

Thanks. Is there somewhere I can see a list of these values?
Cheers, I can confirm this script fixes lost ability to stand
Code: [Select]
repairhim = lambda { |u|
    # dirty
    if u.body.wounds.count > 0 then
      u.body.wounds = []
      puts "supermedic: cleared all wounds."
    end
    if u.status2.limbs_stand_max < 2 then
      u.status2.limbs_stand_max = 2
      puts "supermedic: repaired lost stand ability."
    end
    if u.status2.limbs_stand_count < 2 then
      u.status2.limbs_stand_count = 2
      puts "supermedic: repaired impaired stand ability."
    end
    # maybe dirty
    if u.job.current_job.job_type == :Rest then
      u.job.current_job.job_type = :CleanSelf
      puts "supermedic: released from 'Rest' job."
    end
}

if him = df.unit_find then
  repairhim[him]
end

Hmm strangeness. I've applied this to two dwarves, one a military guy one a migrant who showed up with an inexplicable broken back.

The migrant is fine. But the military dwarf loses the ability to stand every time I load the game.
His description says he sustained major wounds recently, but his wound screen is empty, nothing missing, and his health screen shows no injuries.

Any idea why he'd keep having this lost ability to stand on load?

When i run the script on him though, it does something weird. It fixes the lost ability to stand but then throws a
Code: [Select]
DFHack is ready. Have a nice day!
Type in '?' or 'help' for general help, 'ls' to see all commands.
[DFHack]# supermedic
supermedic: repaired impaired stand ability.
E: NoMethodError: undefined method `job_type' for nil:NilClass
 ./hack/scripts/supermedic.rb:16
 ./hack/scripts/supermedic.rb:23:in `[]'
 ./hack/scripts/supermedic.rb:23
 (eval):1:in `load'
 (eval):1
 (eval):1:in `catch'
 (eval):1
[DFHack]#

When i ran it on the migrant I didn't get that kind of error.
« Last Edit: June 04, 2013, 03:43:09 am by crossmr »
Logged

Njals

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3923 on: June 04, 2013, 01:53:22 pm »

Hi! I need to read grass density values for some tiles as 'probe' plugin does (specifically what this line https://github.com/peterix/dfhack/blob/master/plugins/probe.cpp#L349 does). Is it possible to do the same thing via lua (ruby?)

I'd be grateful for help of at least for some helpful documentation on lua/C++ mapping (I haven't found any but existent scripts examples).
« Last Edit: June 04, 2013, 03:16:47 pm by Njals »
Logged

Njals

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3925 on: June 04, 2013, 03:15:19 pm »

https://github.com/peterix/dfhack/blob/master/Lua%20API.rst
Well, I've found this one but it's of little help. Could you please tell how to get current absolute cursor coordinates, at least? The manual you referenced has nothing on this topic (or it's just very obscured).

EDIT:
Ok, finally found a missing part: https://github.com/peterix/df-structures Now the cursor thing became clear:
Code: [Select]
df.global.cursor
You probably should put a link to it somewhere in the Lua API docs, though.
« Last Edit: June 04, 2013, 11:25:18 pm by Njals »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3926 on: June 05, 2013, 04:38:18 am »

remind me to wake up tomorrow and make this more coherent:

i'm in a bit of a bind because I just remembered that Fortbent still uses separate creatures for all of the citizens (when they get a COMBATHARDNESS of 100) and I haven't tested that far yet but Sparking shows me that that probably means that they'll be "too injured" to work but they can still be ordered around militarily. The problem is that I first included DFHack in Fortbent for friendship for this situation but friendship is no longer in fortbent but fortbent relies on the latest version of DFHack for other things and I for the life of me can't figure out friendship so...

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #3927 on: June 05, 2013, 04:46:02 am »



Thanks. Is there somewhere I can see a list of these values?
Cheers, I can confirm this script fixes lost ability to stand
Code: [Select]
repairhim = lambda { |u|
    # dirty
    if u.body.wounds.count > 0 then
      u.body.wounds = []
      puts "supermedic: cleared all wounds."
    end
    if u.status2.limbs_stand_max < 2 then
      u.status2.limbs_stand_max = 2
      puts "supermedic: repaired lost stand ability."
    end
    if u.status2.limbs_stand_count < 2 then
      u.status2.limbs_stand_count = 2
      puts "supermedic: repaired impaired stand ability."
    end
    # maybe dirty
    if u.job.current_job.job_type == :Rest then
      u.job.current_job.job_type = :CleanSelf
      puts "supermedic: released from 'Rest' job."
    end
}

if him = df.unit_find then
  repairhim[him]
end

Hmm strangeness. I've applied this to two dwarves, one a military guy one a migrant who showed up with an inexplicable broken back.

The migrant is fine. But the military dwarf loses the ability to stand every time I load the game.
His description says he sustained major wounds recently, but his wound screen is empty, nothing missing, and his health screen shows no injuries.

Any idea why he'd keep having this lost ability to stand on load?


Another follow-up on this. Despite showing no wounds, no missing limbs and nothing listed in the health screen, after some time, both dwarves seem to revert to ability to stand lost. Their descriptions don't indicate any kind of injury or missing limb that would cause this. How can I dump the full details on a dwarf to really see into the nitty gritty and what might be causing this?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3928 on: June 05, 2013, 04:48:31 am »

remind me to wake up tomorrow and make this more coherent:

i'm in a bit of a bind because I just remembered that Fortbent still uses separate creatures for all of the citizens (when they get a COMBATHARDNESS of 100) and I haven't tested that far yet but Sparking shows me that that probably means that they'll be "too injured" to work but they can still be ordered around militarily. The problem is that I first included DFHack in Fortbent for friendship for this situation but friendship is no longer in fortbent but fortbent relies on the latest version of DFHack for other things and I for the life of me can't figure out friendship so...
It's quite easy to use friendship, but only on windows and only from lua (due to me not getting around to make gui and allow reconfiguration - now it needs a full df restart to change what species are in the friendship list). This should work (use it in save specific script file - "raw/init.lua" - for best effect):
Code: [Select]
plug=require"plugins.dfusion.friendship"
plug.Friendship:install{"DWARF","ELF","GOBLIN"}
same for embark
Code: [Select]
plug=require"plugins.dfusion.embark"
plug.Embark:install{{"DWARF",0},{"ELF",0},{"GOBLIN",1},{"DWARF",1},{"DWARF",1},{"DWARF",1},{"GOBLIN",1}}

EDIT: just noticed that there is a bug that ignores the first entry in Friendship, so to workaround:
Code: [Select]
plug=require"plugins.dfusion.friendship"
plug.Friendship:install{"DWARF","ELF","GOBLIN","DWARF"}
« Last Edit: June 05, 2013, 04:55:06 am by Warmist »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3929 on: June 05, 2013, 05:08:21 am »

Hmm has anyone here ask for something off ball yet? Like setting up a sport in fort mode which causes people from other cities to visit to watch? so far we could set up wrestling matches but the sport of getting 2 people to fight each other is easy, getting a horde of goblins to rush in for PPV to see "Cold Boulder Steel Anvil" face off "The Cackling" in a Slade in a Shade match is tricky.
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
Pages: 1 ... 260 261 [262] 263 264 ... 373