Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 272 273 [274] 275 276 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1398277 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4095 on: June 19, 2013, 09:08:16 pm »

...
You can also use this:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.motor_nerve_severed=false
v.sensory_nerve_severed=false
end
or similar ruby code to repair all nerve damage stored at this location.

ah-ha. Okay. According to that, He has organ loss and organ damage to his lower spine. That would explain it. Anyway to restore that organ?

Tracked down that migrant, and he has the same thing.

Maybe this?:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.organ_loss=false
v.organ_damage=false
end

The organ_loss is probably the cause, it is the cyan color where the organ has lost function, in this case sending nervous signals.

CaptainArchmage

  • Bay Watcher
  • Profile Pic has Changed! Sorry for the Delay.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4096 on: June 19, 2013, 09:35:07 pm »

Is there any list of flags that can be set when making plugins? I'm interested in being able to put cleaning jobs on tiles.

Also is there anyway to stop large unit lists from reducing migration wave size? This is beginning to affect the Moltenchannels succession game - it basically means the fortress won't be getting any massive migrant wave !!FUN!! any longer.
Logged
Given current events, I've altered my profile pic and I'm sorry it took so long to fix. If you find the old one on any of my accounts elsewhere on the internet, let me know by message (along with the specific site) and I'll fix. Can't link the revised avatar for some reason.

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4097 on: June 19, 2013, 10:17:16 pm »

Is there any list of flags that can be set when making plugins? I'm interested in being able to put cleaning jobs on tiles.

Also is there anyway to stop large unit lists from reducing migration wave size? This is beginning to affect the Moltenchannels succession game - it basically means the fortress won't be getting any massive migrant wave !!FUN!! any longer.

scripts/fix/dead-units.lua
Removes "uninteresting" dead units from the active units.  I hear that  migrants stop coming when this list gets over 3000 or something like that.  Some have said that it is more aggressive than they would like in what it considers uninteresting, but I think this is what you are looking for.

scripts/fix/population-cap.lua
Quote from: From the file
-- Communicates current population to mountainhomes to avoid cap overshooting.

-- The reason for population cap problems is that the population value it
-- is compared against comes from the last dwarven caravan that successfully
-- left for mountainhomes. This script instantly updates it.
-- Note that a migration wave can still overshoot the limit by 1-2 dwarves because
-- of the last migrant bringing his family. Likewise, king arrival ignores cap.

As for designating cleaning jobs, that is something I have been trying to do the past couple of days too.  I have created cleaning jobs which nobody will be assigned to, and created "stagnant water" items with the hope that with no_auto_clean == false would auto make a clean job but doesn't.  I have also tried creating the ice boulder which when melted becomes stagnant water and hence the auto clean job, but the created boulder when melted did not do so.  My next attempt will involve associating the created clean jobs with a building to see if that will get them to assign somebody.

CaptainArchmage

  • Bay Watcher
  • Profile Pic has Changed! Sorry for the Delay.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4098 on: June 19, 2013, 11:02:04 pm »

I meant a plugin that would clean up the reduction in immigration without clearing the "dead units" list.

Have you tried to designate a cleaning job like a mining job, so it will be performed on a specific tile and wait for an available dwarf with cleaning enabled to assign the task to?
Logged
Given current events, I've altered my profile pic and I'm sorry it took so long to fix. If you find the old one on any of my accounts elsewhere on the internet, let me know by message (along with the specific site) and I'll fix. Can't link the revised avatar for some reason.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4099 on: June 19, 2013, 11:37:59 pm »

I meant a plugin that would clean up the reduction in immigration without clearing the "dead units" list.

I think that would require digging into DF's code, instead of just the data structures.  You'd have to find and disable the actual test(s) that check for the limit, and then apply a patch to force the test to always take the branch that allows immigrants.
Logged

mithosaurion

  • Bay Watcher
    • View Profile
I have no idea how to code
« Reply #4100 on: June 19, 2013, 11:38:31 pm »

Hello all, I was wondering if anyone would know how to code a dfusion lua command to make a selected unit twice as strong as a dragon.
I need it for reasons.
Also try to make the advice idiot proof, I have messed up adding commands before.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4101 on: June 19, 2013, 11:56:36 pm »

First "twice as strong as a dragon" would have to be defined.

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4102 on: June 20, 2013, 12:12:39 am »

...
Have you tried to designate a cleaning job like a mining job, so it will be performed on a specific tile and wait for an available dwarf with cleaning enabled to assign the task to?

I hadn't thought to look up how those designations work in memory.  Looking at them now, there isn't one for clean, but maybe one of the ones for liquid will get the created liquid object to spawn the clean job.

CaptainArchmage

  • Bay Watcher
  • Profile Pic has Changed! Sorry for the Delay.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4103 on: June 20, 2013, 02:15:11 am »

...
Have you tried to designate a cleaning job like a mining job, so it will be performed on a specific tile and wait for an available dwarf with cleaning enabled to assign the task to?

I hadn't thought to look up how those designations work in memory.  Looking at them now, there isn't one for clean, but maybe one of the ones for liquid will get the created liquid object to spawn the clean job.

Someone made a digging invaders hack that forced the "dig" or "dig channel" or "dig staircase" job upon a certain invader unit. That job shows up in the jobs list, too. You can probably do the same with cleaning.

There isn't a designation for "clean", but we're talking about the dispatching of the job to the jobs list through DFHack. If there were a designation, we wouldn't have that much trouble with cleaning stuff up. #Townbrush #Any other fortress with colossal contamination.
Logged
Given current events, I've altered my profile pic and I'm sorry it took so long to fix. If you find the old one on any of my accounts elsewhere on the internet, let me know by message (along with the specific site) and I'll fix. Can't link the revised avatar for some reason.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4104 on: June 20, 2013, 03:04:05 am »



Maybe this?:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.organ_loss=false
v.organ_damage=false
end

The organ_loss is probably the cause, it is the cyan color where the organ has lost function, in this case sending nervous signals.
I tried creating a script with that, but it doesn't seem to work..it just blows up with an EOF error. I made this an rb file as you indicated.

Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return

for k,v in pairs(unit.body.components.body_part_status) do
    v.organ_loss=false
    v.organ_damage=false
end

Code: [Select]
E: SyntaxError: (eval):2:in `load': ./hack/scripts/organfix.rb:9: syntax error,
unexpected $end, expecting kEND
 (eval):2
 (eval):2
 (eval):2:in `catch'

Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4105 on: June 20, 2013, 03:08:30 am »

That's because you saved lua into an .rb file.

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4106 on: June 20, 2013, 03:27:29 am »



Maybe this?:
Code: [Select]
for k,v in pairs(unit.body.components.body_part_status) do
v.organ_loss=false
v.organ_damage=false
end

The organ_loss is probably the cause, it is the cyan color where the organ has lost function, in this case sending nervous signals.
I tried creating a script with that, but it doesn't seem to work..it just blows up with an EOF error. I made this an rb file as you indicated.

Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return

for k,v in pairs(unit.body.components.body_part_status) do
    v.organ_loss=false
    v.organ_damage=false
end

Code: [Select]
E: SyntaxError: (eval):2:in `load': ./hack/scripts/organfix.rb:9: syntax error,
unexpected $end, expecting kEND
 (eval):2
 (eval):2
 (eval):2:in `catch'

Looks like lua to me, though I'm not very familiar with ruby.  If it's lua, you're gonna need an "end" on the line after the "return".  Since that seems to be what the error is saying too, I suppose ruby and lua are pretty much equivalent for this purpose...
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4107 on: June 20, 2013, 03:31:07 am »

No, not at all. Ruby has different syntax in a lot of ways and that's pretty obviously lua. Let me fix that for you (commenting what's fixed):

Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return nil --need to return something, I'm pretty sure
end --end is needed for if then in lua

for k,v in ipairs(unit.body.components.body_part_status) do --note ipairs instead of pairs
    v.organ_loss=false
    v.organ_damage=false
end

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4108 on: June 20, 2013, 03:36:41 am »

--note ipairs instead of pairs

Why?  "pairs" and "ipairs" seem to do the same thing if you don't care what the key is.
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4109 on: June 20, 2013, 03:38:41 am »

No, not at all. Ruby has different syntax in a lot of ways and that's pretty obviously lua. Let me fix that for you (commenting what's fixed):

Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting with extreme prejudice.")
return nil --need to return something, I'm pretty sure
end --end is needed for if then in lua

for k,v in ipairs(unit.body.components.body_part_status) do --note ipairs instead of pairs
    v.organ_loss=false
    v.organ_damage=false
end

Thanks. the finer points are still all new to me here. He had mentioned using it as "ruby code" so I saved it as an RB file.

After running this, then rerunning body check the spine damage isn't listed anymore. I ran the supermedic script I have to fix the "ability to stand lost" tag and we'll see if it stays gone now.
Logged
Pages: 1 ... 272 273 [274] 275 276 ... 373