Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.43.03-r1  (Read 1087181 times)

TechnoScrabble

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4665 on: September 12, 2016, 11:15:53 pm »

Can you check an item's ID after you create it (the "id" field), unpause, wait for it to disappear, and run ":lua ~df.item.find(ITEM_ID)"? (Replace ITEM_ID with the ID of the item you found earlier.)

That brought up a whole mess of stuff into the dfHack window, which I think is mostly the same things that I saw in gm-editor? Which bits of information do I need to keep an eye on?

Spoiler (click to show/hide)

Thank you for the help and patience with this, I haven't played DF since 2012 and I'm new to DFHack and the LNP.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4666 on: September 13, 2016, 12:58:22 am »

Okay, so the item still exists. Try checking the pos field (":lua ~df.item.find(ITEM_ID).pos"). Then you can move the cursor to where the item is by setting the three fields of df.global.cursor (e.g. run "lua", then at the lua prompt, run "df.global.cursor.x = df.item.find(ITEM_ID).pos.x", then again with y and z). You might need to press up/down in DF after doing that to get the window to recenter properly.

Also, you can copy text from the console on Windows by right-clicking the title bar, or right-clicking in the console, depending on your system. It's a lot easier for us to read than full screenshots.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

TechnoScrabble

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4667 on: September 13, 2016, 01:45:21 pm »

Okay, so the item still exists. Try checking the pos field (":lua ~df.item.find(ITEM_ID).pos"). Then you can move the cursor to where the item is by setting the three fields of df.global.cursor (e.g. run "lua", then at the lua prompt, run "df.global.cursor.x = df.item.find(ITEM_ID).pos.x", then again with y and z). You might need to press up/down in DF after doing that to get the window to recenter properly.

Also, you can copy text from the console on Windows by right-clicking the title bar, or right-clicking in the console, depending on your system. It's a lot easier for us to read than full screenshots.

That took me deep underground, to an area I have not dug to yet. So, we know they're teleporting down for some reason on unpause (skip a step does not teleport), but we don't know why or how...
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4668 on: September 13, 2016, 02:17:49 pm »

It wasn't x/y/z = -30000 was it? That's the default cursor location when it isn't present, I discovered that when I ran launch without a target the first time, since I aimed it at the cursor to give a speed/direction control via in-game methods, this meant I hurled myself at the lower northwest corner of the map at light speed and blew up.
Logged

malvado

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4669 on: September 13, 2016, 02:19:24 pm »

How is the project going?
I've usually been running Dfhack through Lazy and can't say I've used a lot of time trying to configure what is beeing run as default through Dfhack , will there ever been some sort of manageable gui where we could dump / add things we want dfhack to run?
Logged

TechnoScrabble

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4670 on: September 13, 2016, 02:26:44 pm »

It wasn't x/y/z = -30000 was it? That's the default cursor location when it isn't present, I discovered that when I ran launch without a target the first time, since I aimed it at the cursor to give a speed/direction control via in-game methods, this meant I hurled myself at the lower northwest corner of the map at light speed and blew up.

Nope!

[DFHack]# createitem BLOCKS INORGANIC:OLIVINE 50
[DFHack]# gui/gm-editor
[DFHack]# :lua ~df.item.find(13001).pos
<coord: 0x08fe4f04>
x                        = 36
y                        = 60
z                        = 103

EDIT: That's the position BEFORE it moves. Afterwards, it becomes:
x                        = 36
y                        = 60
z                        = 76
« Last Edit: September 13, 2016, 03:02:58 pm by TechnoScrabble »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4671 on: September 13, 2016, 02:30:02 pm »

I've usually been running Dfhack through Lazy and can't say I've used a lot of time trying to configure what is beeing run as default through Dfhack , will there ever been some sort of manageable gui where we could dump / add things we want dfhack to run?
Well, there's dfhack.init, where you can specify whatever you want to run on startup, plus a variety of other options for running things when a world or map is (un)loaded. Some LNP launchers have a tab that lets you configure specific DFHack tools, but those are typically limited. The most powerful option for now is editing dfhack.init. I guess a GUI in DF would be possible, but it could be tricky to re-run things as they're changed (without restarting DF, which isn't really desirable).
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

malvado

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4672 on: September 13, 2016, 07:20:34 pm »

I've usually been running Dfhack through Lazy and can't say I've used a lot of time trying to configure what is beeing run as default through Dfhack , will there ever been some sort of manageable gui where we could dump / add things we want dfhack to run?
Well, there's dfhack.init, where you can specify whatever you want to run on startup, plus a variety of other options for running things when a world or map is (un)loaded. Some LNP launchers have a tab that lets you configure specific DFHack tools, but those are typically limited. The most powerful option for now is editing dfhack.init. I guess a GUI in DF would be possible, but it could be tricky to re-run things as they're changed (without restarting DF, which isn't really desirable).

Thanks! Will definitely try to understand the .ini later on when it works with 05 or later. Kids keeping me busy lately so I can wait for new version of dfhack :)
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4673 on: September 13, 2016, 07:26:23 pm »

I've usually been running Dfhack through Lazy and can't say I've used a lot of time trying to configure what is being run as default through Dfhack , will there ever been some sort of manageable gui where we could dump / add things we want dfhack to run?

https://dfhack.readthedocs.io/en/stable/docs/Core.html#init-files
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

malvado

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4674 on: September 14, 2016, 07:05:22 am »

I've usually been running Dfhack through Lazy and can't say I've used a lot of time trying to configure what is being run as default through Dfhack , will there ever been some sort of manageable gui where we could dump / add things we want dfhack to run?

https://dfhack.readthedocs.io/en/stable/docs/Core.html#init-files

Thank you, that should help me understand a little better how things work :)
Logged

Hesperid

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4675 on: September 14, 2016, 09:54:56 am »

It wasn't x/y/z = -30000 was it? That's the default cursor location when it isn't present, I discovered that when I ran launch without a target the first time, since I aimed it at the cursor to give a speed/direction control via in-game methods, this meant I hurled myself at the lower northwest corner of the map at light speed and blew up.

Nope!

[DFHack]# createitem BLOCKS INORGANIC:OLIVINE 50
[DFHack]# gui/gm-editor
[DFHack]# :lua ~df.item.find(13001).pos
<coord: 0x08fe4f04>
x                        = 36
y                        = 60
z                        = 103

EDIT: That's the position BEFORE it moves. Afterwards, it becomes:
x                        = 36
y                        = 60
z                        = 76

So it falls a bunch of Z-levels and stops. After it falls no further, what happens if you set its position back to the surface? Note that just adjusting the Z value for an item's position is not the correct way to move items because it leaves other flags and data structures un-updated, but works for this one experiment. I just want to see if it starts falling again after you bring it to the surface.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4676 on: September 14, 2016, 10:00:02 am »

There is a bit of a disconnect between cursor coordinates and the "real" coordinates used by the game.

Your map will have a value in df.global.world.map.region_z that works as an offset.  My guess is that you'll find it holds 27 (i.e., 103 - 76).  Depending on what you're trying to do, you may need to add that offset to your z-coordinate.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Hesperid

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4677 on: September 14, 2016, 12:16:55 pm »

He already has a valid Z-coordinate from before the object falls, why would he need to do this arithmetic you're talking about instead of just using that?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4678 on: September 14, 2016, 12:25:29 pm »

For teleporting units and items, the cursor coordinates have always worked for me.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4679 on: September 14, 2016, 12:57:04 pm »

I said the offset may be needed, I haven't noticed a real pattern of what is in "cursor space" and what is in "map space".

Try adding that term and see if things show up where they are supposed to.  If not, then obviously it's something else.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map
Pages: 1 ... 310 311 [312] 313 314 ... 360