Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 199 200 [201] 202 203 ... 360

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

Nopenope

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3000 on: August 18, 2015, 11:16:10 am »

It's worked fine for me. I really can't understand why the prompt would hang when running that command, since it does so little. Does DF still respond? What happens if you run "lua ~df.global.enabler.renderer"?

DF still responds, only DFHack hangs. Here's the output from the lua command:
Spoiler (click to show/hide)
Logged

Marza

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3001 on: August 18, 2015, 06:03:53 pm »

Hey all, I'm trying to write a script that would force all underground tree variants to start growing as discovering three cavern layers is not a guarantee to obtaining all the underground tree types. I'm not a very script savvy person, so I looked around and tried to copy and adapt this code for starting Nethercap growth:

Code: [Select]
feat = df.global.world.cur_savegame.map_features[2]
num = #feat.feature.population
feat.feature.population:insert('#', { new = df.world_population, type = df.world_population_type.Tree, plant = dfhack.matinfo.find('PLANT:NETHER_CAP').index });
for i,j in pairs(df.global.world.populations) do if (j.population.cave_id == feat.layer and j.population.population_idx == num - 1) then df.global.world.populations:insert('#', { new = df.local_population, type = df.world_population_type.Tree, plant = dfhack.matinfo.find('PLANT:NETHER_CAP').index, population = {region_x = j.population.region_x, region_y = j.population.region_y, population_idx = num, cave_id = feat.layer, depth = feat.start_depth, unk_28 = -1 } } ) end end

However running that particular script returns the following error from DFHack:

Cannot read field world.T_cur_savegame.map_features: not found.
stack traceback:
[C]: in function '_index'
TreeScript.lua:1: in main chunk
[C]: in function 'safecall'
...DF/hack/scripts/lua.lua:11: in function 'f'
...DF\hack\lua\dfhack.lua:461: in function <...DF\hack\lua\dfhack.lua:425>
(...tail calls...)

It's all greek to me, but I guess DFHack doesn't like this script written from over a year and a half ago. Anyone point me in the right direction?
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3002 on: August 19, 2015, 07:38:43 am »

Spoiler (click to show/hide)
Didn't know this either, thanks!

Spoiler (click to show/hide)
At first glance,
Code: [Select]
feat = df.global.world.cur_savegame.map_features[2] is outdated and needs to be changed to
Code: [Select]
feat = df.global.world.features.map_features[2]
That should at least get rid of the error.
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Marza

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3003 on: August 19, 2015, 03:55:22 pm »

That fixed it, thanks!
Logged

Morcaster

  • Bay Watcher
    • View Profile
Getting started.
« Reply #3004 on: August 19, 2015, 10:10:09 pm »

I'm looking forward to creating a GUI like dwarf therapist, where should I get started?
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Getting started.
« Reply #3005 on: August 19, 2015, 11:54:00 pm »

I'm looking forward to creating a GUI like dwarf therapist, where should I get started?

Study Dwarf Therapist's code and learn how it works, then join the project or begin your own.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Getting started.
« Reply #3006 on: August 20, 2015, 12:03:26 am »

I'm looking forward to creating a GUI like dwarf therapist, where should I get started?

Study Dwarf Therapist's code and learn how it works, then join the project or begin your own.
Note- there is also dwarf manipulator in dfhack. Two versions even (one C++ and other lua). You can study them too.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3007 on: August 20, 2015, 11:51:25 am »

By any chance, is there a script or function to fill in all of the ancillary values when you change a creature's size?  Something to keep the surface area, blood volume, etc. in sync.  Or is there a size adjustment function buried in DF itself that causes all of these to recalculate?
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

Geltor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3008 on: August 20, 2015, 12:57:31 pm »

is it possible to hack a plugin where dfhack handles adventure mode's drinking and eating needs without any player intervention? all the player has to do is supply them of course
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3009 on: August 21, 2015, 09:47:38 pm »

If someone makes it and doesn't name it lifesupport I will KILL.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3010 on: August 21, 2015, 09:48:42 pm »

By any chance, is there a script or function to fill in all of the ancillary values when you change a creature's size?  Something to keep the surface area, blood volume, etc. in sync.  Or is there a size adjustment function buried in DF itself that causes all of these to recalculate?
Uhhhh.

I know the body part modifiers under appearance do a lot of that stuff smoothly.
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3011 on: August 22, 2015, 05:08:44 am »

Was there a reliable way to obtain the x,y,z coordinates of the target LOCATION of an interaction (considering that you are not targeting a unit)?
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3012 on: August 24, 2015, 10:54:57 am »

Anyone know what happens when you try and use the function dfhack.items.createItem() without a creator? Can't run DF right now so can't check myself. If it crashes, is there anyway to make it so that it doesn't crash?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3013 on: August 24, 2015, 10:58:01 am »

Anyone know what happens when you try and use the function dfhack.items.createItem() without a creator? Can't run DF right now so can't check myself. If it crashes, is there anyway to make it so that it doesn't crash?
Either it crashes or it does not work at all (i.e. emits an error message).
This is because it uses df own functions (namely reaction products IIRC) and it needs unit for it to work. You can make your own createItem for subset of items (e.g. I did one for heart tearing out script, just because these reactions do not support body parts). For a general use case it would be lot's of work...

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3014 on: August 24, 2015, 11:02:31 am »

Anyone know what happens when you try and use the function dfhack.items.createItem() without a creator? Can't run DF right now so can't check myself. If it crashes, is there anyway to make it so that it doesn't crash?
Either it crashes or it does not work at all (i.e. emits an error message).
This is because it uses df own functions (namely reaction products IIRC) and it needs unit for it to work. You can make your own createItem for subset of items (e.g. I did one for heart tearing out script, just because these reactions do not support body parts). For a general use case it would be lot's of work...

Good to know. I suppose it would be possible to select a random creator and then set the created_by flag (or whatever it is called) to -1. I actually don't think it is a big deal as I will almost always have a creator, was just wondering what would happen if I didn't.
Logged
Pages: 1 ... 199 200 [201] 202 203 ... 360