Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 362 363 [364] 365 366 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1398749 times)

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5445 on: April 22, 2014, 04:44:36 pm »

As far as I know, it is more trouble than it is worth. You'd have to muck around with world map data in complicated ways.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5446 on: April 22, 2014, 11:53:05 pm »

As far as I know, it is more trouble than it is worth. You'd have to muck around with world map data in complicated ways.

More trouble indeed. All I really wanted was to change the temperature of specific tiles and I can already do that, was just thinking of other manipulations I could include.

On a related note. Is it possible to make constructions of different materials with DFHack?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5447 on: April 22, 2014, 11:58:56 pm »

As far as I know, it is more trouble than it is worth. You'd have to muck around with world map data in complicated ways.

More trouble indeed. All I really wanted was to change the temperature of specific tiles and I can already do that, was just thinking of other manipulations I could include.

On a related note. Is it possible to make constructions of different materials with DFHack?
Constructions are more difficult (i think). Setting a tile material to inorganic one can be done by creating a new (or expanding an old one) vein. I use that to build unminable/undeconstructable towers. Will share the script when i get home.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5448 on: April 23, 2014, 06:33:17 am »

The API for working with the map is mostly only available in C++, and since r4 it supports setting a tile to an arbitrary stone material using the vein method. It is used by the 3dveins plugin, and also exposed in the tiletypes command.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5449 on: April 23, 2014, 09:45:40 am »

Here is the script: linky

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5450 on: April 23, 2014, 10:50:14 am »

Here is the script: linky

Awesome. And thanks for all the help everyone.

EDIT: That works beautifully. Two comments
1. Multiple calls using the same materials will do nothing unless you clear the block_events_mineralst associated with the material. For example if I ran a reaction that changed the floor into silver, then one that changed it to gold, then again tried to change it to silver it would stay gold.
2. Some walls for some reason have a tiletype not associated with a wall, even though they are called walls in game. This means that they will not take any change effect you run. For example, I had a rough conglomerate wall section I was attempting to change to slade, 4 of the 6 pieces of wall segment changed, but two had the tiletype associated with an upward ramp. No idea how that happens, but manually changing the tiletype to that of the others caused them to behave correctly.

Overall, it works fairly well. Note that if you want to change a grassy square into a mineral you also need to change its tiletype (just like in 2), not sure if doing this will have any unintended consequences.
« Last Edit: April 23, 2014, 02:22:41 pm by Roses »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5451 on: April 24, 2014, 12:19:44 am »

Map editing in general is a very complicated procedure, this is because: simple tiles are just tile type + material lookup to current strata (e.g. soil/ granite etc...) , trees/shrubs look up into plants list, grasses i think uses events, mineral veins have events for them and should not overlap, constructions have yet another system and i think i missed a few... So if you want "just place a wall" you need to take into account ALL of this what you are replacing. That could involve removing one tile from block_events_mineralst or world constructions or removing tree etc... So yeah, my script is very minimal and if you want to do it "the right way" there is a lot involved.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5452 on: April 24, 2014, 11:00:58 am »

Yeah, I am beginning to understand that, but as it stands your script does very well, even for being so simple.

One last question, I have been looking at http://dwarffortresswiki.org/index.php/DF2012:Tile_types_in_DF_memory and was wondering if there is a list in actual numbers somewhere. I am interested in playing around a bit with tile types, but I would rather not go through and figure out which each one is.
Logged

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page
Re: DFHack 0.34.11 r3
« Reply #5453 on: April 24, 2014, 05:51:00 pm »

Here's a rough list I put together while working on MADMAN:

Spoiler: big ugly list (click to show/hide)

Note that it's missing the numbers for minecart tracks (and possibly other things I've forgotten about).
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

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

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #5454 on: April 24, 2014, 09:12:18 pm »

There's actually a "showmood" command in DFHack which will tell you exactly what your moody dwarf wants.

"Urist McGoth wants a hug."
Pop into adventure mode, use this dfusion script
Code: [Select]
function spar(unit)
if unit==nil then
unit=getCreatureAtPos(getxyz())
entry=getline()
targ=getCreatureAtPos(getxyz())
end
unit.flags2.sparring=true
targ.flags2.sparring=true
unit.job.hunt_target=targ
targ.job.hunt_target=unit
end
adv_tools.menu:add("spar another",spar)
To set spar flag on urist Mcgoth and current unit you're playing, walk up and wrestle both arms over Mcgoth.

So I've been trying my best to implement this script, and had no success doing so on my own.

Can somebody please let me know where exactly it's supposed to go?
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.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5455 on: April 25, 2014, 01:22:29 pm »

You could add a "hug" interaction to the dwarf race and have an associated announcement with its usage.
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5456 on: April 25, 2014, 01:29:40 pm »

Oh. no, I wasn't looking to hug anybody, I was interested in using the sparring script to spar with companions and others.
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.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5457 on: April 25, 2014, 03:14:22 pm »

Oh. no, I wasn't looking to hug anybody, I was interested in using the sparring script to spar with companions and others.
oh that goes into dfusion looks tricky but the "adv_tools.menu:add("spar another",spar)" was a clear give away.
also 'interaction hugs' doesn't give you the ability to snatch stuff off folks with out being pegged hostile.
just shove the code into the adv...wait you don't need adv_tools.menu if you shove it in the adv_tools file?
it looks like an old ass dfusion file
hell you don't need to do that just plop the code into companion order and copy and edit the menu set up.

that's a two year old script uhh you could activate sparring by diving into gm-editor and slapping the spar flag on both units... but getting them to fight each other is slightly bit more.
Code: [Select]
function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end
function getCreatureAtPos(x,y,z) -- gets the creature index @ x,y,z coord
--local x,y,z=getxyz() --get 'X' coords
local vector=df.global.world.units.all -- load all creatures
for i = 0, #vector-1 do -- look into all creatures offsets
local curpos=vector[i].pos --get its coordinates
local cx=curpos.x
local cy=curpos.y
local cz=curpos.z
if cx==x and cy==y and cz==z then --compare them
return vector[i] --return index
end
end
--print("Creature not found!")
return nil

end

function Attack(unit)
Fig={}
if unit==nil then
unit=getCreatureAtPos(getxyz())
end
local adv=df.global.world.units.active[0]
for k,v in pairs(df.global.world.units.active) do
if v.relations.group_leader_id==adv.id or v.relations.following==adv.id then
v.job.hunt_target=unit
v.job.hunt_target=Fig
unit.job.hunt_target=v
end
table.insert(Fig,unit)
end
end


don't know if this still works but here's the stuff you need for pitting fights.
« Last Edit: April 25, 2014, 03:27:37 pm by Rumrusher »
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

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5458 on: April 25, 2014, 03:24:21 pm »

adv_tools.lua? In which folder? There's like three of the damn things so far as I've found, and it didn't work when simply copy/pasted into any one of them.
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.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5459 on: April 25, 2014, 03:31:21 pm »

adv_tools.lua? In which folder? There's like three of the damn things so far as I've found, and it didn't work when simply copy/pasted into any one of them.
it should be in lua scripting folder where dfusion is. also the script is 2 years old.
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
Pages: 1 ... 362 363 [364] 365 366 ... 373