Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.34.11 r3  (Read 1456097 times)

CaptainArchmage

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

It depends on what you mean by "go through the list of items on the map" - there's checks for updating temperature, increasing item age (and applying stuff like rot and possibly also fire damage), generating hauling jobs, and other various operations, and those are all done on completely separate intervals (and I believe some have the same interval but different offsets). Changing those isn't as simple as you might think.

Even if they could be changed, how exactly would you define "when necessary"?

If you really want to reduce FPS drop related to large item counts, then just destroy the extra items so the game doesn't have to deal with them - we already have "autodump" to do that with garbage, and (as angavrilov mentioned in a post earlier) it should also be possible to 'free up' the items used by constructions.

[edit] I've just written a new plugin (which will be called "cleanconst") which gets rid of construction materials and marks them to be recreated on disassembly.

By go through all the items on the map, I mean run a search through every single one for something or to edit something.

"When necessary" is defined as:
-When you look through the items with "look" or on the stocks screen (maybe).
-When a dwarf or other creature gets a job that requires an item.
-When you want to build something.
-After a certain interval, to calculate age and rotting and so on.

The "hack" to reduce the search interval is related to the last one.

When creatures look for items to carry out jobs, the check needs to be done but these events are not frequent enough to cause massive FPS decay on the scale that we are seeing.

The idea is to ensure the check for ageing and decay is only carried out every few ticks, i.e. once per day or once per week depending on how much you have in the game. The interval set depends on personal preferences and the state of FPS for the user. While the interval should be user-defined, but I am OK with increasing the length of time to say, 10x what it is now just to start out with. I know this will change the way the game behaves, but it will be a good compromise to keep the game playable.

If we have to keep the item count as low as it needs to be now, we keep ending up with trouble playing forts longer than ten years. If we even get to ten years, or five years, that is.
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 #4066 on: June 17, 2013, 02:05:40 pm »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?

that script does use getSelectedUnit so you will have to select the unit in one of its supported methods.  I haven't played around with makeown myself so I don't know how feasible it would be to make the script look for any incomplete citizens with which to add historical figure data. 

A thought off the top of my head about why these units can't be placed into a noble position might have to do with a lack of recorded events such as arriving at the fort, birth, or some such.  I might look into that later if no one else does.

sonerohi

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4067 on: June 17, 2013, 02:27:49 pm »

Sorry if I'm missing something frustratingly obvious, but I am having issues with the hack to fix fortress born critters growing. First off, I have to be honest and say I'm not comfortable or competent with lua. Whenever I try to run lua files, I get that windows prompt to select the program to open it with. Is there something I'm needing to get? Or is this something that someone could just put up as a download for those of us who are not quite so savvy?
Logged
I picked up the stone and carved my name into the wind.

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4068 on: June 17, 2013, 03:03:41 pm »

Sorry if I'm missing something frustratingly obvious, but I am having issues with the hack to fix fortress born critters growing. First off, I have to be honest and say I'm not comfortable or competent with lua. Whenever I try to run lua files, I get that windows prompt to select the program to open it with. Is there something I'm needing to get? Or is this something that someone could just put up as a download for those of us who are not quite so savvy?

Just type "lua" in the DFHack window, then paste this part of the script in:

Code: [Select]
    for _,unit in ipairs(df.global.world.units.active) do
        r = unit.relations.birth_time - 10 * math.modf(unit.relations.birth_time / 10) --Kurik Amudnil's code; if it's not clear, it sets a creature's birth_time to the nearest multiple of 10 of the previous one.
        if r > 0 then
            unit.relations.birth_time = unit.relations.birth_time - r
        end
    end

That'll fix every creature currently on the map.

Then type "quit" to get out of lua mode and back to where you type DFHack commands.
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

sonerohi

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4069 on: June 17, 2013, 03:40:50 pm »

And then apply that every immigrant wave and birth?
Logged
I picked up the stone and carved my name into the wind.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4070 on: June 17, 2013, 03:47:53 pm »

A few pages back there was a script that runs that every so often.
Logged

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4071 on: June 17, 2013, 04:26:23 pm »

And then apply that every immigrant wave and birth?

Personally, I'm satisfied with just running it once shortly after setting up a military, to guarantee that my military is the right size.  If you're continually butchering animals raised in the fortress, then that might not work so well.

To fix it permanently, you'll need to put the aforementioned script in the hack/scripts directory, then put the command to enable the script ("growthbug enable", I think) in your dfhack.init file (probably at the end).
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4072 on: June 17, 2013, 06:19:04 pm »

The .lua script Putnam wrote should go in your raw folder at the top level, and will silently run the fix every month.

For anything but succession games, use Kurik's ruby script - it goes in the usual hack/scripts/fix spot, and add 'fix/growthbug enable' to dfhack.init.  It'll run at a configurable interval (defaults to monthly) and pop up a notification of what it fixed each time.

I've included this one in the LNP in my sig. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4073 on: June 17, 2013, 10:58:43 pm »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?

that script does use getSelectedUnit so you will have to select the unit in one of its supported methods.  I haven't played around with makeown myself so I don't know how feasible it would be to make the script look for any incomplete citizens with which to add historical figure data. 

A thought off the top of my head about why these units can't be placed into a noble position might have to do with a lack of recorded events such as arriving at the fort, birth, or some such.  I might look into that later if no one else does.

The events are probably unimportant, but for completeness we could add a history_event_add_hf_entity_linkst and a history_event_change_hf_statest. 

To get the noble positions working I found that the unit needs a nemesis entry.
Spoiler: fixmakeown.lua (click to show/hide)

changes:
  • new_hist_fig.appeared_year = df.global.cur_year.  Probably irrelevant but this field is usually the year they arrived or created not birth year.
  • new_hist_fig.died_seconds = -1. Also likely to be irrelevant, but = 1 was probably a typo.
  • create and insert nemesis entries.
  • searches for all relevant units instead of only the currently selected unit
still missing and perhaps not needed:
  • history_event_add_hf_entity_linkst and history_event_change_hf_statest events.
  • historical_figure.info, historical_figure.info.skills, historical_figure.info.unk_14.
script to add nemesis to units that have already had historical figures added with the previous version of the fixmakeown or fixhistfig script:
Spoiler: fixnemesis.lua (click to show/hide)

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4074 on: June 18, 2013, 01:12:30 am »

you are a scholar and a gentleman.
Logged

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4075 on: June 18, 2013, 05:01:16 am »

Hey memory editing types,

I found a bug(?) with [SHELL] having different physical properties in play from the ones defined in the raws. The properties I investigated were attack properties, but I'm pretty sure, anecdotally, that shell is also weaker for defense than its raws would indicate. Can one of y'all who knows how to navigate the whole "investigating memory while the game is running" thing check out what's going on?
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4076 on: June 18, 2013, 07:18:30 am »

I wrote this to autoresume suspended building constructions.
Makes cracking aquifers 500% less annoying.
Spoiler (click to show/hide)
My question is, can I make DF exit the 'q' menu when the script starts running?  That would make it work smoother.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4077 on: June 18, 2013, 07:46:12 am »

My question is, can I make DF exit the 'q' menu when the script starts running?  That would make it work smoother.

i think this would do that:
Code: [Select]
dfhack.screen.dismiss(dfhack.gui.getCurViewscreen())

kingubu

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4078 on: June 18, 2013, 08:02:55 am »

i think this would do that:
Code: [Select]
dfhack.screen.dismiss(dfhack.gui.getCurViewscreen())
Thanks, but that closes DF entirely.
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4079 on: June 18, 2013, 09:35:13 am »

There is already a ruby autounsuspend script released with dfhack r3.  Turn it on 'autounsuspend enable' when working on the aquifer, turn it off 'autounsuspend disable' when done.

as for exiting q screen from script, I think you would need something like.

Code: (lua) [Select]
gui = require 'gui'
gui.simulateInput(dfhack.gui.getCurViewscreen(), 'LEAVESCREEN')

EDIT: identify code as lua code
« Last Edit: June 18, 2013, 09:41:02 am by Kurik Amudnil »
Logged
Pages: 1 ... 270 271 [272] 273 274 ... 373