Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.34.11 r3  (Read 1455883 times)

SeelenJägerTee

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4665 on: September 26, 2013, 12:54:00 pm »

The bodysize of a dwarf determines what weapons he can use one-handed/two-handed.
DT tells me all dwarfes were 60000.
So where do I find the body size of the dwarf.
I guess i'd find it somewhere under "gui/gm-editor -> body" but I can't find it.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4666 on: September 26, 2013, 02:00:25 pm »

blood_max and physical_attr_tissues.AGILITY are both body size in decimeters.

SeelenJägerTee

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4667 on: September 26, 2013, 02:20:17 pm »

Thanks a lot.
Logged

IRIS_EYE_AZURE

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4668 on: September 27, 2013, 04:44:34 pm »

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

Potential use would be limit computation time per game tick for scripts such as Putnam's itemsyndrome.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4669 on: September 27, 2013, 04:59:15 pm »

Eh, why not. I'll try it out.

EDIT: Itemsyndrome kinda requires access to a single gamestate for the duration of operation. Having it yield after every single unit would be awkward-appearing in-game. However, it would be pretty nice in different scripts, like my various Fortbent ones.
« Last Edit: September 27, 2013, 08:13:27 pm by Putnam »
Logged

Pink Photon

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4670 on: September 27, 2013, 09:46:01 pm »

I'm trying to change a log into a tower-cap log. When I use the command

changeitem here m PLANT:TOWER_CAP

it says

change denied:subtype doesn't match. use 'force' to override.

Doing so results in a "tower-cap plant log". How would I make a regular "tower-cap log"?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4671 on: September 27, 2013, 10:21:19 pm »

You forgot WOOD.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #4672 on: September 27, 2013, 10:24:30 pm »

I'm trying to change a log into a tower-cap log. When I use the command

changeitem here m PLANT:TOWER_CAP

it says

change denied:subtype doesn't match. use 'force' to override.

Doing so results in a "tower-cap plant log". How would I make a regular "tower-cap log"?

You forgot WOOD.
Specifically, you want PLANT_MAT:TOWER_CAP:WOOD.
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4673 on: September 28, 2013, 12:31:22 am »

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

Potential use would be limit computation time per game tick for scripts such as Putnam's itemsyndrome.

Sorta related:

Code: [Select]
local function checkAllUnitsForIdleMagicExperienceAndGiveThemMagicSpells() --long-ass function name
local delayCounter = 1
for k,unit in ipairs(df.global.world.units.active) do
if unitHasMagicSkill(unit) then
dfhack.timeout(delayCounter,"ticks",function() iterateSkill(unit) end)
dfhack.timeout(delayCounter+1,"ticks",function() assignSpells(unit) end)
delayCounter = delayCounter+2
end
end
end

This function gives each unit 2 ticks to do its thing. I think this should minimize the FPS impact, or at least reduce noticeable lag. I'm warming up to itemsyndrome using a similar system, since I realized that you're probably not going too many units in active to work with within, say, 150 ticks if you give each tick 5-10 units.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4674 on: September 28, 2013, 01:08:48 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
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4675 on: September 28, 2013, 01:54:26 am »

I've been having an issue with migrants from other players' forts (on a succession game) showing up in awful moods and/or already being insane. Using the 'ls' command in the dfhack console I was able to find a plugin that removes the bad thoughts, leaving some of the dwarves healthy and happy once again, but I couldn't find a command that allows one to "cure" insanity. Is there no such command in there, or did I just gloss over it 2-3 times?

If there isn't already a command for it, does anyone have a script that will work as a plugin?
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4676 on: September 28, 2013, 03:03:34 am »

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

Potential use would be limit computation time per game tick for scripts such as Putnam's itemsyndrome.

Since I took interest, warmed up, then immediately worked on it and loved the results, thank you and here's the implementation:

Code: [Select]
local function findItems()
    local unitDelay=1
    local numberOfUnitsToWorkOnAtOnce = math.ceil((#df.global.world.units.active*2)/delayTicks) --should end up so that it takes slightly less than half the delayTicks to work on every unit
    if itemsyndromedebug then print(numberOfUnitsToWorkOnAtOnce) end
    if numberOfUnitsToWorkOnAtOnce~=0 then --an "index out of bounds" error happens without this
        for _uid=0,#df.global.world.units.active-1 do --note that this for loop runs all at once; the syndrome assignment is delayed until later, but the assignment of ticks on which they happen is all in one tick
            local unit=df.global.world.units.active[_uid]
            dfhack.timeout(unitDelay,"ticks",function()
                for i=1,numberOfUnitsToWorkOnAtOnce do --this is the meat of it; without this, it could cause a situation where every tick involves a unit being checked, as opposed to ~20-50% as it is now.
                    applySyndromesBasedOnItems(_uid,unit)
                    _uid=_uid+1
                end
            end
            )
            unitDelay=unitDelay+1
        end
    end
end

The FPS losses as number of units increase is minimal; diminishing returns makes it a moot point past delayTicks*1.5 active units.
« Last Edit: September 28, 2013, 03:05:26 am by Putnam »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4677 on: September 28, 2013, 05:40:58 am »

okay back from civ messing to release a script to allow you to play as any civ, which means you could start a bandit camp, gobbo fort, elven resort, kobold cave, batman den, snake pit, Demon fort. though you have to reapply the script each time you want to play that civ, and depending on the entity raws you could end up with scrapping for supplies with no trade option and no military. play now nets you folks from the civ than created ones so if you parked a bunch of zombies in Town of Ghoulville and you play as them expect zombies as citizens, oh and the game doesn't crash if your entire group is consider a pet though you need to give orders via dwarf manipulator.

Code: [Select]
function addaciv()
  require("utils").insert_sorted(dfhack.gui.getCurViewscreen().parent.available_civs,df.global.world.entities.all[112],"id")
end
To use this you need to be on the world map where you can choose your civ, this will add an additional civ to that list.
now to change the civ you need to edit 112 to any number you want.
well off to struggle playing a hamlet civ.
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

IRIS_EYE_AZURE

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4678 on: September 28, 2013, 01:06:02 pm »

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

Potential use would be limit computation time per game tick for scripts such as Putnam's itemsyndrome.

Since I took interest, warmed up, then immediately worked on it and loved the results, thank you and here's the implementation:

... code deleted ...

The FPS losses as number of units increase is minimal; diminishing returns makes it a moot point past delayTicks*1.5 active units.

Glad I was able to spark an idea...

And ag, thanks for the pointer to script.lua
Logged

tofof

  • Escaped Lunatic
    • View Profile
Cleaning map tiles
« Reply #4679 on: September 28, 2013, 11:49:53 pm »

I noticed that spotclean doesn't actually clean up the 'debris' graphic (left by broken arrows, bolts, catapult shots, etc), but that clean map does.

This struck me as odd, given that the help claims that spotclean "Works like 'clean map snow mud', but only for the tile under the cursor."

Investigating the behavior, I noticed that the spotclean function sets spatter amounts to zero, whereas the cleanmap function erases all 'events' on the block.  From the indexing, I'm guessing cleanmap operates on a 256-tile block at a time.

Is the different functionality by design?  If so, it'd be great to be able to spotclean ammunition debris. If not, perhaps the documentation should be updated.

Logged
Pages: 1 ... 310 311 [312] 313 314 ... 373