Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 197 198 [199] 200 201 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457525 times)

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page
Re: DFHack 0.34.11 r2
« Reply #2970 on: February 05, 2013, 08:08:32 pm »

Right then, time to find a very simple RNG generator to embed in the script.

Also, if you want a more realistic age distribution, you can do something like this:
Code: [Select]
-- Approximate a normal (Gaussian) distribution
local menopause_age = 0
local unitcaste = df.creature_raw.find(value.race).caste[value.caste]
local mmin = (unitcaste.misc.maxage_min / 2)
local mmax = (unitcaste.misc.maxage_max / 2)
for i=1,4 do
menopause_age = menopause_age + math.random(mmin, mmax)
end
menopause_age = menopause_age / 4
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

MADMAN · Save Tools · WTF Tools · Generated Raws Extractor · Tweak for 0.31–34.xx

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2971 on: February 06, 2013, 01:26:50 am »

Right then, time to find a very simple RNG generator to embed in the script.

Also, if you want a more realistic age distribution, you can do something like this:
Code: [Select]
-- Approximate a normal (Gaussian) distribution
local menopause_age = 0
local unitcaste = df.creature_raw.find(value.race).caste[value.caste]
local mmin = (unitcaste.misc.maxage_min / 2)
local mmax = (unitcaste.misc.maxage_max / 2)
for i=1,4 do
menopause_age = menopause_age + math.random(mmin, mmax)
end
menopause_age = menopause_age / 4
Better normal distribution:
Code: [Select]
function norm()
return math.sqrt((-2)*math.log(math.random()))*math.cos(2*math.pi*math.random())
end
function normalDistributed(mean,sigma)
return mean+sigma*norm()
end

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2972 on: February 06, 2013, 04:13:30 am »

Ever since I started using DFHack, people report appearance of "granite" with a sand icon and a weight of 1 urist in food stockpile. Some time later it's gone.

From reports:

The spinning granite strikes The Vulture in the lower body, bruising the muscle and bruising the guts!

In the raws:

Code: [Select]
[CDI:MATERIAL:INORGANIC:GRANITE:SOLID_GLOB]
Apparently SOLID_GLOB creates a glob item, and those generally end up in the food stockpile. They are also erased once per season if on ground.
Logged

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2973 on: February 07, 2013, 01:05:10 am »

I want to ask if a certain application is possible. And please forgive my ignorance. (My programming is rusty and I'm not familiar yet with Lua.):

In the Units module is the dfhack.units.getPosition function to return the true x,y,z of a unit. And in the Items module is dfhack.items.getPosition(item) to return the true x,y,z of an item.

Those return values. But is it possible to change these values - to force a unit and/or an item to be instantly relocated from one position to another (such as swapping positions with an item or creature)? If so, how would one go about doing that?

Also, if the above is true, is it possible to relocate a creature and/or item instantly to a different global position? To explain, I have an example:

Say I have a utility that - in fortress mode - reads the position of one or more creatures/items and stored the values. Then I use Rumrusher's technique of "properly retiring a fort". (DFusion hack to adjust the items so they do not scatter, civ ownership of pets, etc, etc. See this thread and DFusion's thread for more.) Then I start a new embark.

Now, with the saved position(s) of the creature(s)/item(s) from the now "retired" old fort - assuming they have not moved or scattered - would it be possible to relocate them to the new embark map?

I realize that the game differentiates between global and local maps. But, after the old fort is retired, what used to be local becomes global and a new embark map becomes the new local map... right? Would that pose a problem?

I thought I'd ask before further banging my head on this problem... (I really, REALLY want to see a "Successive Embark" or let my old fort continue on while starting a new one with resources on hand. And I don't have the patience to wait for Toady to get to it one of these days. With the tools and techniques available now, I figure a hack might be within reach.)
« Last Edit: February 07, 2013, 01:07:34 am by Thundercraft »
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2974 on: February 07, 2013, 01:49:53 am »

At this point, the answer is not known and requires testing of the principle. However, perhaps the x,y,z only applies within a local map? There might be region tile coordinates stored on the unit which might also have to be changed to get them into your map.

However, on a local map level, afaik this is somewhat how autodump works.
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?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2975 on: February 07, 2013, 03:33:09 am »

I wonder to know what's your problem?.. oh wait you want migrants from a retired fort, they should move over to the new site easily in the upcoming migrant waves.
though the units are stuck in a pool of natural citizens of the civ and might take a couple sessions.

though my guess is the game keeps the global map to be the terrain and the local maps being the site, each time you get near a site the game loads up the local map data of the area.

retired forts just becomes a site with a bunch of changes DF needs to remember next time it needs to load it up.
though if you want people from another site to visit you could jump into adventure mode and walk them to the next site.
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

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r2
« Reply #2976 on: February 07, 2013, 09:33:13 am »

If those embarks are in different locations, it cannot be done - items are offloaded to the site in which they are located, so you can't actually get at them without loading the site itself. Units are offloaded to special global files (unit-*.dat), but you still can't get at them without convincing DF to load them for you.

If it's within the current site, then that's easy - DFHack is already capable of moving items and units (using autodump and fastdwarf, for example).
« Last Edit: February 07, 2013, 09:40:23 am by Quietust »
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.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2977 on: February 07, 2013, 10:44:59 am »

If flags can be set on an off-site unit, it's possible that one could be forced to load in the map.
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?

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2978 on: February 07, 2013, 10:54:15 am »

Ever since I started using DFHack, people report appearance of "granite" with a sand icon and a weight of 1 urist in food stockpile. Some time later it's gone.

From reports:

The spinning granite strikes The Vulture in the lower body, bruising the muscle and bruising the guts!

In the raws:

Code: [Select]
[CDI:MATERIAL:INORGANIC:GRANITE:SOLID_GLOB]
Apparently SOLID_GLOB creates a glob item, and those generally end up in the food stockpile. They are also erased once per season if on ground.

Oh, thanks for the explanation!
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2979 on: February 07, 2013, 12:09:25 pm »

I wonder to know what's your problem?.. oh wait you want migrants from a retired fort, they should move over to the new site easily in the upcoming migrant waves.
That's not exactly what I was talking about. I want dwarves from my old fort as the founders (not migrants) of a new embark. In addition, I want to take along a selection of pets and creatures and a sizable amount of supplies and items.

...if you want people from another site to visit you could jump into adventure mode and walk them to the next site.
I've thought of that, but can be problematic (such as surviving the trip and carrying all the stuff).

Thanks for the replies, guys. It is appreciated. My idea sounds unlikely now, but it has sparked some new ideas.

But to avoid getting too far off topic, I started a new thread on this subject:
Successive Embark (from retired, not abandoned fortresses)
Logged

Shininglight

  • Bay Watcher
  • Hi There
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2980 on: February 07, 2013, 03:54:29 pm »

I was wondering if i could get a bit of help here, i've been trying to get the dfhack for osx to work on my computer but so far nothing has worked, for whatever reason it doesn't seem to run any help would be wonderful. I can start normal df but the dfhack attachment doesn't start up when it does and specifically starting dfhack just opens a terminal that does nothing.
Logged
tl;dr: My fortress is literally powered by puppy skulls.

danaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2981 on: February 07, 2013, 04:04:01 pm »

I was wondering if i could get a bit of help here, i've been trying to get the dfhack for osx to work on my computer but so far nothing has worked, for whatever reason it doesn't seem to run any help would be wonderful. I can start normal df but the dfhack attachment doesn't start up when it does and specifically starting dfhack just opens a terminal that does nothing.

If you are running 10.6, you will need to edit the dfhack script to remove the line referencing DYLD_FORCE_FLAT_NAMESPACE.

...We should really mention somewhere prominent that 10.6 a) is not fully supported, and b) requires this change to even have a chance at working. This is at least the third person who's asked about it.
Logged

Shininglight

  • Bay Watcher
  • Hi There
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2982 on: February 07, 2013, 04:22:54 pm »

Thanks for the help danaris, it works now.
Logged
tl;dr: My fortress is literally powered by puppy skulls.

Mugtorg

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2983 on: February 08, 2013, 03:58:10 pm »

Here are some small scripts in case someone needs them.
Spoiler (click to show/hide)
This one clears the combat reports or announcements list.
Spoiler (click to show/hide)
Run this one right after the migrant wave shows up and it erases their skills, sets their profession to peasant and sets the flag on their animals so they leave the map.(Usually you won't even see them, but very rarely they show up and leave on the edge of the map immediately.)
Spoiler (click to show/hide)
Same as above but for the selected unit only.

Code may be kind of bad as i started coding in LUA only recently
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #2984 on: February 10, 2013, 05:12:00 am »

So a unit can have more than one soul.

What effect, exactly, does that have?

I made a real quickie script to test if I could do it and, sure enough, it shows the creature as having two souls after using it:

Code: [Select]
-- It's a test!

function getMaxId()
local maxid = 0
  local units = df.global.world.units.all
  for _uid,unit in ipairs(df.global.world.units.all) do
    maxid = maxid + 1
end
return maxid
end

local selectedUnit = dfhack.gui.getSelectedUnit()

local maxid = getMaxId()+1

selectedUnit.status.souls:insert('#',
{
new = df.unit_soul,
unit_id = maxid,
race = 894, --this is Lord English in Fortbent, shouldn't cause any problems in vanilla etc. AFAIK. If it does, just change it to 1  or something.
sex = 1,
caste = 0,
unk1 = -1,
unk2 = -1,
unk3 = -1,
unk4 = -1,
anon_1 = 0,
anon_2 = 0,
anon_3 = -1,
anon_4 = -1,

}
)
Pages: 1 ... 197 198 [199] 200 201 ... 373