Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 332 333 [334] 335 336 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1459356 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #4995 on: December 20, 2013, 04:59:52 am »

Just checking: Can the catsplosion.plug.dll be changed for another creature, like civ-members? Lets say a civ that is otherwise sterile? So you never have kids, but do a magic ritual and the workshop triggers catsplosion once, and all your civ-members pop out a kid?
AFAIR yes you can do that. Though more research into genetics might be needed.
I was hoping for a lua script and I can just replace CAT with another creature id, but its a compiled plugin, not a script. Thats why I would need help. Otherwise I use spawnunit, but if the creature is lacking a history, they cant be nobles/soldiers, which is a big handycap. Any plans to add an automated history to the script in r4?
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 :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4996 on: December 20, 2013, 06:26:45 am »

What does not allow it to be assigned as military/noble is two part: first missing nemesis record (which we had success in creating without corrupting your saves, but it still needs testing imho) and other one is adding your then created historical figure to your civ entity (easy task). I could see if there is a up-to-date script for that at home.
As for catsplosion lua file:
Code: [Select]
df::unit_genes *preg = new df::unit_genes;
preg->appearance = female->appearance.genes.appearance;
preg->colors = female->appearance.genes.colors;
female->relations.pregnancy_genes = preg;
female->relations.pregnancy_timer = rand() % 100 + 1;
female->relations.pregnancy_caste = 1;
this is the main idea which translates to:
Code: [Select]
local female=dfhack.gui.getSelectedUnit()
--[
local preg=df.unit_genes.new()
preg.appearance=female.appearance.genes.appearance
preg.colors=female.appearance.genes.colors
--] if the next line fails use this block...
female.relations.pregnancy_genes = {new=true,appearance=female.appearance.genes.appearance,colors=female.appearance.genes.colors}
female.relations.pregnancy_timer =10 --yeah i know fancy random timings, i'm too lazy to look up the lua api for that
female.relations.pregnancy_caste = 1 -- caste of born unit, should be set according to your race etc...

Zammer990

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4997 on: December 21, 2013, 09:00:43 am »

I just fullscreened the dfhack window and now I can't window it again, anyone know the key to do that?
Logged
If your animals aren't expendable, you could always station a dwarf or two out there?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4998 on: December 21, 2013, 01:48:24 pm »

This is what I used on my last test. Without the BLOODSUCKER. I think you are right and its the NO_AGING. Wouldnt have guessed, to be honest. NOT_LIVING would have made a lot more sense, but I am just happy that it works. :)

Since NO_AGING is not a valid creature token (I think), I give each civ member a self-targetted interaction. The first 1 second ingame there is a bit of infighting between opposed to life civ-members and alive civ-members, but if I cant get the opposed to life dudes to actually do work, I will get rid of them anyway.

Code: [Select]
[INTERACTION:MAKE_VAMPIRE]
   [I_SOURCE:CREATURE_ACTION]
   [I_TARGET:A:CREATURE]
   [IT_LOCATION:CONTEXT_CREATURE]
[IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
   [I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[IE_ARENA_NAME:Test undead behaviour]
[SYNDROME]
[SYN_CLASS:VAMPCURSE]
[CE_ADD_TAG:NO_AGING:STERILE:NOT_LIVING:START:0]

Now I just have to figure out a nice way to make the Warlocks/Mages look differently from the Skeleton/Undead civ part. I want skeletons as workers, but currently they look the same. ALT_TILE doesnt work, because the creatures use sprites.
oh wait that would explain why elves/goblins are listed okay to walk into necrotowers I guess they had the no aging factor on them cause the undead to ignore them completely.
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

laularukyrumo

  • Bay Watcher
  • Needs More Socks
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4999 on: December 21, 2013, 01:57:17 pm »

I'm having a weirdass problem with Kurik's script to fix the growth bug.

Stuck "fix/growthbug.rb enable" in my init file and....

onupdate cb String can't be coerced into Fixnum
./hack/ruby/ruby.rb:42:in `+'
./hack/ruby/ruby.rb:42:in `check_run'
./hack/ruby/ruby.rb:100:in `onupdate'
./hack/ruby/ruby.rb:99:in `each'
./hack/ruby/ruby.rb:99:in `onupdate'
(eval):42
onupdate cb String can't be coerced into Fixnum
./hack/ruby/ruby.rb:42:in `+'
./hack/ruby/ruby.rb:42:in `check_run'
./hack/ruby/ruby.rb:100:in `onupdate'
./hack/ruby/ruby.rb:99:in `each'
./hack/ruby/ruby.rb:99:in `onupdate'
(eval):42
onupdate cb String can't be coerced into Fixnum
./hack/ruby/ruby.rb:42:in `+'
./hack/ruby/ruby.rb:42:in `check_run'
./hack/ruby/ruby.rb:100:in `onupdate'
./hack/ruby/ruby.rb:99:in `each'
./hack/ruby/ruby.rb:99:in `onupdate'
(eval):42

etc etc etc..... Literally it repeats hundreds of times. Not even exaggerating. What did I do wrong?
Logged
Quote from: Dwarfotaur
Everytime one of my militia has given birth in the Danger Room, it's lead to instant baby smoothies for everyone.

Gotta Catch 'Em All!

Dat Sig Thread

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5000 on: December 22, 2013, 06:36:12 pm »

What does
Code: [Select]
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
do?

I've been fooling around with one of those dwarves who's been injured and subsequently ignored, and my initial method of doing so was to pare down the fullheal script and force the dwarf unconscious for a while. This seemed to work, so I set about removing the mysterious parts of fullheal that I'd previously ignored. Doing this resulted in a script that KO'd the dwarf as before (allowing them to be fed and watered), but who went right back to lying about once they regained consciousness.

A script that's just
Spoiler (click to show/hide)
gets the layabout dwarf up and eating and drinking and sleeping, but due to her injuries she was still crawling around. An attempt to reinjure her by standing her on a raising bridge resulted in the old wounds vanishing and being replaced by the bruising caused by the bridge throw.

So, I'm guessing that that bit of code erases all wounds, but doesn't actually do anything about the consequences of those wounds until a round of combat happens.

What I'm really trying for here is a script that either makes the dwarf take a Rest job, or gets another dwarf to rescue them. One thing I picked up on is that dwarves in this state have a negative unconsciousness count... I think.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5001 on: December 22, 2013, 08:17:16 pm »

What does
Code: [Select]
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
do?

I've been fooling around with one of those dwarves who's been injured and subsequently ignored, and my initial method of doing so was to pare down the fullheal script and force the dwarf unconscious for a while. This seemed to work, so I set about removing the mysterious parts of fullheal that I'd previously ignored. Doing this resulted in a script that KO'd the dwarf as before (allowing them to be fed and watered), but who went right back to lying about once they regained consciousness.

A script that's just
Spoiler (click to show/hide)
gets the layabout dwarf up and eating and drinking and sleeping, but due to her injuries she was still crawling around. An attempt to reinjure her by standing her on a raising bridge resulted in the old wounds vanishing and being replaced by the bruising caused by the bridge throw.

So, I'm guessing that that bit of code erases all wounds, but doesn't actually do anything about the consequences of those wounds until a round of combat happens.

What I'm really trying for here is a script that either makes the dwarf take a Rest job, or gets another dwarf to rescue them. One thing I picked up on is that dwarves in this state have a negative unconsciousness count... I think.

I'm away from my DFHack resources, but recall that the status stuff is tracked in several places - both a wound and some body component data would record a severed part, for example. There are some unit flags to get the game to recalculate the body, nerve, insulation, etc. structures.

Would it be better to go into each unit.body.wound entry and heal the wounds rather than erasing them?

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5002 on: December 22, 2013, 09:36:53 pm »

I don't want them healed directly, I just want them to Rest so they can get medical treatment. There's an occasional issue with dwarves who are injured but don't fall unconscious and don't make their own way to a hospital bed. They're sort of active, since they'll climb out of water and respond to civilian alerts, but otherwise they'll lie around with No Job until they starve or dehydrate.

As I said above, knocking them out allows for Give Food / Give Water jobs. I haven't run the save for long after each script attempt to be sure, but I think a simple KO script will change the cause of death from starvation or dehydration to drowniness-induced insanity.

I've seen discussion of the issue a few times on the forums, but I can't find any of the topics or conversations about it. The usual method of solving it is to drop things on top of the dwarf until they get a hospital-worthy injury.

A script that runs once a month and makes creatures with <0 unconsciousness (this would seem to be the way of targeting only affected creatures) take a Rest job would be the neatest way of doing it, but I can't reverse-engineer the basic function from the 'Wake up -> Clean self' part of the fullheal script.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5003 on: December 23, 2013, 08:44:21 am »

Based on research I've done on older versions, adding the unit ID of a wounded dwarf to ui.unk230c might generate a "Rescue Wounded" job to bring them to bed and/or make them Rest. No guarantee that it'll work, but it's worth a try.
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.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5004 on: December 23, 2013, 09:24:51 am »

I've fixed that a couple of times by knocking a dwarf out by setting the unconscious timer to some huge number, then toggling a few of the healthcare flags off and on.  I think it was the rq_diagnosis and needs_recovery flags.  I seem to recall this was somewhat unreliable, and might depend on setting the flags in a certain order or stepping the game between flag sets or unsets.
Logged
Through pain, I find wisdom.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5005 on: December 23, 2013, 02:13:50 pm »

Can anyone point me to the docs for trueTransform? I can't seem to find anything, and I really need to use it for the guild system I want to add to Better Dorfs.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5006 on: December 23, 2013, 03:42:03 pm »

Can anyone point me to the docs for trueTransform? I can't seem to find anything, and I really need to use it for the guild system I want to add to Better Dorfs.

https://github.com/peterix/dfhack#true-transformation

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5007 on: December 23, 2013, 04:17:16 pm »

Exactly what I wanted...

BTW: How come my version of the DFHack r3 readme lacks that? It came with trueTransform (at least I think it did)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5008 on: December 23, 2013, 07:43:47 pm »

Back to the healthcare script...

Spoiler (click to show/hide)
This seems to work, though I did have to remove the barracks bed the desired dwarf had been plonked in. Apart from the desired dwarf, it also catches a few other units: an armourer who was wounded in the same attack but received a crutch, a baby, and some animals. The armourer was brought to a bed after being knocked out.

I'd like to exclude the babies at least, just in case it messes with their healthcare once they grow into children. I've got the profession number for babies (97), but I can't figure out how to use it. I don't know what the script does with wounded invaders, so limiting it to the currently-played race would be good too.

There's a minor display issue in that it gives the red 'no unit selected in UI' message if it's run twice in succession. Not sure whether it's because there are no dwarves affected, or because there are no creatures affected. I can probably work that out by picking apart the fat-dwarves script.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5009 on: December 23, 2013, 07:47:36 pm »

It's because you included a completely superfluous local unit=dfhack.gui.getSelectedUnit() at the top.
Pages: 1 ... 332 333 [334] 335 336 ... 373