Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 366 367 [368] 369 370 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 992157 times)

Erkki

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5505 on: May 16, 2014, 03:21:22 pm »

FixGrowth and cleanowned basically fix and make 300-Dwarf multi-generation forts playable --> a happy long time user here. Thanks for this great tool!
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5506 on: May 16, 2014, 10:59:16 pm »

FYI: http://www.bay12forums.com/smf/index.php?topic=138609.msg5286137#msg5286137

I have a lua script there that somewhat debugs a unit which should be receiving water/food, but isn't.

misc_trait_type 0 should be called GiveWaterCooldown
misc_trait_type 1 should be called GiveFoodCooldown

FAKEEDIT: https://github.com/angavrilov/df-structures/blob/master/df.units.xml#L1182
Wow, I didn't realize some people already knew about this.
I updated the bug report here: http://www.bay12games.com/dwarves/mantisbt/view.php?id=2606

Tabithda

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5507 on: May 19, 2014, 03:02:02 pm »

Is there a currently script that marks ghosts as slabbed, or otherwise prevents ghosts from appearing?  If not, is it currently possible for such a script to be made?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5508 on: May 22, 2014, 03:35:45 pm »

I am having an interesting issue with my current upgradebuilding script. I am adding the items used in the reaction to the contained items of the new building, and everything is almost working correctly. They items are appearing in the building and they are unable to be used in other buildings/reactions, but when the building is de-constructed they do not appear on the map. Here is where it gets interesting though, you can't see the item, and it won't show in any locations, but if you try and build a new building or run a reaction that would use the item, the dwarf will go to where the building was de-constructed and grab it and use it normally.

Any ideas what might be going on there? I am thinking that since I am actually just creating the reagents over (via, df[]:new()) that there may be a flag I am missing. I am wondering now though, would it be easier to simply grab the items in the reaction itself, and if they have preserve_reagent on them, add them to the building? Is it possible to get the actual reagent from a completed reaction (e.g. <item_boulderst>)? This would save a lot of trouble.
Logged

Katie

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5509 on: May 23, 2014, 03:37:06 am »

Would it be possible to make a script that automatically changes the ownership of the mayors bedroom/office/dining room to the next mayor on election day?
It would be great if someone could make that. Many mayors have gone without rooms because I simply forgot to check.
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5510 on: May 25, 2014, 08:17:49 am »

is there a way to reduce embark size after embarking?  Like a dfhack tool that would truncate my land for me.

User2

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5511 on: May 27, 2014, 01:06:03 am »

Everyone who is mad of 30-item manager limit, has a good news. By patching the following offsets in memory:
0x6E61E5    75->EB
0x6E6301    02->03
Your job limit will be set to 999. I think it can be done using dfhack lua scripts. I am not good at lua-scripting, sorry.
PS. These offsets are for non-rebased image of the game (Base 0x400000).
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5512 on: May 27, 2014, 02:01:59 pm »

Not sure if it has been talked about, or maybe even already changed, but it would be nice if \WORKER_ID and \UNIT_ID were combined into one, so that you didn't have to distinguish between reactions and interactions when working in the raws.

EDIT: Is it possible to destroy an already constructed building using DFHack? I know I can queue a building for deconstruction, but I was hoping to be able to get rid of the building instantly instead of having to wait for it to be deconstructed in game.
« Last Edit: May 27, 2014, 07:14:19 pm by Roses »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5513 on: May 28, 2014, 10:05:51 am »

Everyone who is mad of 30-item manager limit, has a good news. By patching the following offsets in memory:
0x6E61E5    75->EB
0x6E6301    02->03
Your job limit will be set to 999. I think it can be done using dfhack lua scripts. I am not good at lua-scripting, sorry.
PS. These offsets are for non-rebased image of the game (Base 0x400000).
You should probably double-check your patches before you post them to the forum: the first line is bad because the original value is wrong (it's 7C, not 75), and the second line is bad because the address is wrong (it should be 0x6E6302, not 0x6E6301).

Also, this is obviously a Windows-only patch, so it can't be used on Linux or MacOS without further research.

[edit]

Patch for Linux:
0x5239C8 : 0F 4C -> 90 8B
0x523B08 : 02 -> 03

And for OSX:
0x5A5EDC : 0F 4C -> 90 8B
0x5A602A : 02 -> 03
« Last Edit: May 28, 2014, 10:25:26 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.

User2

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5514 on: May 28, 2014, 10:34:48 am »

You should probably double-check your patches before you post them to the forum: the first line is bad because the original value is wrong (it's 7C, not 75), and the second line is bad because the address is wrong (it should be 0x6E6302, not 0x6E6301).

Also, this is obviously a Windows-only patch, so it can't be used on Linux or MacOS without further research.
Probably should. Probably. I guess nobody has blown his computer up due to the wrong offsets.
Actual data:
0x6E61E5   7C->EB
0x6E6302   02->03

Of course windows only. Linux & MacOS users can find it themselves as a summer holydays homework.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5515 on: May 30, 2014, 01:27:55 am »

By request, a lua script with function to insert pets if they don't already exist
Note this won't add the creature to the wagon, pack, mount, minion, or exotic lists - just as a pet.
The code is rather unoptimized for CPU usage.

Code: [Select]
--comment


local function insertPet(alpha,beta,gamma)
local exists=false
for k,v in pairs(df.global.world.entities.all) do
--ENTITY TYPES
--Civilization 0
--SiteGovernment 1
--VesselCrew 2
--MigratingGroup 3
--NomadicGroup 4
--Religion 5
--MilitaryUnit 6
--Outcast 7
if v.type==0 and v.entity_raw.code==alpha then --exclude bandits
--print(k)
--printall(v.resources.animals)
for kk,vv in pairs(v.resources.animals.pet_races) do
--print(kk,vv,v.resources.animals.pet_castes[kk])
local checkrace = df.creature_raw.find(vv)
local checkcaste = checkrace.caste[v.resources.animals.pet_castes[kk]]
--print(checkrace.creature_id, checkcaste.caste_id)
if checkrace.creature_id == beta and checkcaste.caste_id == gamma then exists=true end
end
if exists==true then
print("ERROR- civilization ",alpha," has creature ", beta, gamma)
else
--the civ doesn't have the creature as a pet
--add the creature as a pet
local racenum=-1
local castenum=-1
for kk,vv in pairs(df.global.world.raws.creatures.all) do
--print(vv.creature_id)
if vv.creature_id==beta then
racenum=kk
--print(kk)
--printall(vv.caste)
for kkk,vvv in pairs(vv.caste) do
--print(vvv.caste_id)
if vvv.caste_id==gamma then castenum=kkk end
end
break
end
end
if racenum > -1 and castenum > -1 then
--print("success!!")
--print(v)
v.resources.animals.pet_races:insert('#',racenum)
v.resources.animals.pet_castes:insert('#',castenum)
print("Inserted ", beta, gamma, " in civ ",k, alpha)
else
print(beta, gamma, " not found in raws")
end
end
end
exists=false
end
end




--for example add CREATURE:DOG to ENTITY:PLAINS and CREATURE:HORSE to ENTITY:FOREST?
--As in: Humans have dogs and elves have horses

insertPet("PLAINS","DOG","MALE")
insertPet("PLAINS","DOG","FEMALE")
insertPet("FOREST","HORSE","MALE")
insertPet("FOREST","HORSE","FEMALE")
insertPet("MOUNTAIN","DRAGON","MALE")
insertPet("MOUNTAIN","DRAGON","FEMALE")

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5516 on: May 30, 2014, 04:54:10 am »

By request, a lua script with function to insert pets if they don't already exist
Note this won't add the creature to the wagon, pack, mount, minion, or exotic lists - just as a pet.
The code is rather unoptimized for CPU usage.

Code: [Select]
--comment


local function insertPet(alpha,beta,gamma)
local exists=false
for k,v in pairs(df.global.world.entities.all) do
--ENTITY TYPES
--Civilization 0
--SiteGovernment 1
--VesselCrew 2
--MigratingGroup 3
--NomadicGroup 4
--Religion 5
--MilitaryUnit 6
--Outcast 7
if v.type==0 and v.entity_raw.code==alpha then --exclude bandits
--print(k)
--printall(v.resources.animals)
for kk,vv in pairs(v.resources.animals.pet_races) do
--print(kk,vv,v.resources.animals.pet_castes[kk])
local checkrace = df.creature_raw.find(vv)
local checkcaste = checkrace.caste[v.resources.animals.pet_castes[kk]]
--print(checkrace.creature_id, checkcaste.caste_id)
if checkrace.creature_id == beta and checkcaste.caste_id == gamma then exists=true end
end
if exists==true then
print("ERROR- civilization ",alpha," has creature ", beta, gamma)
else
--the civ doesn't have the creature as a pet
--add the creature as a pet
local racenum=-1
local castenum=-1
for kk,vv in pairs(df.global.world.raws.creatures.all) do
--print(vv.creature_id)
if vv.creature_id==beta then
racenum=kk
--print(kk)
--printall(vv.caste)
for kkk,vvv in pairs(vv.caste) do
--print(vvv.caste_id)
if vvv.caste_id==gamma then castenum=kkk end
end
break
end
end
if racenum > -1 and castenum > -1 then
--print("success!!")
--print(v)
v.resources.animals.pet_races:insert('#',racenum)
v.resources.animals.pet_castes:insert('#',castenum)
print("Inserted ", beta, gamma, " in civ ",k, alpha)
else
print(beta, gamma, " not found in raws")
end
end
end
exists=false
end
end




--for example add CREATURE:DOG to ENTITY:PLAINS and CREATURE:HORSE to ENTITY:FOREST?
--As in: Humans have dogs and elves have horses

insertPet("PLAINS","DOG","MALE")
insertPet("PLAINS","DOG","FEMALE")
insertPet("FOREST","HORSE","MALE")
insertPet("FOREST","HORSE","FEMALE")
insertPet("MOUNTAIN","DRAGON","MALE")
insertPet("MOUNTAIN","DRAGON","FEMALE")
Thank you. I will do some tests today and let you know how it goes. :)

Quote
Note this won't add the creature to the wagon, pack, mount, minion, or exotic lists - just as a pet.
Wagon, Pack and Mount is clear to me. But Minion and Exotic? I assume that Minion = For example trolls in goblin sieges. And Exotic is just exotic pets, which atm does not mean a big difference.

Is it impossible to add pack or mount or wagon animals for traders, or just something that this specific script cant do, but potentially could be written?
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 :::

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5517 on: May 30, 2014, 08:56:22 am »

...
Thank you. I will do some tests today and let you know how it goes. :)

Quote
Note this won't add the creature to the wagon, pack, mount, minion, or exotic lists - just as a pet.
Wagon, Pack and Mount is clear to me. But Minion and Exotic? I assume that Minion = For example trolls in goblin sieges. And Exotic is just exotic pets, which atm does not mean a big difference.

Is it impossible to add pack or mount or wagon animals for traders, or just something that this specific script cant do, but potentially could be written?

I presume there could be something written such as "if this creature has the appropriate wagon/pack/mount tokens, also add it to those lists". See also https://github.com/angavrilov/df-structures/blob/master/df.entities.xml#L324

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5518 on: May 30, 2014, 10:44:32 am »

I assume that Minion = For example trolls in goblin sieges. And Exotic is just exotic pets, which atm does not mean a big difference.
Minion is indeed for trolls in goblin sieges. Exotic, I'm not 100% certain about.

Is it impossible to add pack or mount or wagon animals for traders, or just something that this specific script cant do, but potentially could be written?
There's no reason why it can't be done - in fact, the old "fixwagons" plugin I wrote for version 0.31.25 used this exact same method to add wagons to Human and Dwarven civilizations.  Additionally, if you add wagons to Elven civilizations, I'm pretty sure they will use them - though their ethics prevent them from being given access to wagons, they do not prevent them from using wagons if they are given access to them by other means.
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5519 on: May 30, 2014, 11:01:21 am »

Quietust: I dont know if you are aware, but my mod includes several races you can play. So my intention is to give one race access to one type of wagon, pack, pull, pet and mount animal (and now minion, since that is pretty neat). And give another race access to other types. And now the important part: Without any of the pets be available to multiple civs.

In the beginning I could use entity tags for this, use cavern, good, evil animals, but with 6 playable races (and more enemy-only ones), this has become impossible.

Maybe I should open a new thread, and ask around if anyone wants to work on the script. Its quite useful for mods with a lot of different invaders, for example Fortress Defense.
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 :::
Pages: 1 ... 366 367 [368] 369 370 ... 373