Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 340 341 [342] 343 344 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1459163 times)

Re: DFHack 0.34.11 r3
« Reply #5115 on: January 17, 2014, 09:08:31 pm »

What does Dfusion's power up command do? It appears to be both opaque to googling, as well as not listed in the readme.
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5116 on: January 17, 2014, 09:13:50 pm »

What does Dfusion's power up command do? It appears to be both opaque to googling, as well as not listed in the readme.

Boosts the selected dwarf's skills to legendary. All of their skills, even ones they don't have any experience in.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5117 on: January 18, 2014, 01:50:57 am »

Does anyone know if simply changing an items material index will change all of the combat calculations and such, or is there more that needs to be changed?
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5118 on: January 18, 2014, 04:41:10 pm »

Does anyone know if simply changing an items material index will change all of the combat calculations and such, or is there more that needs to be changed?

The item's weight and sharpness don't auto-update, which matters if the new material has a different density or max_edge.




On another topic, can I call non-script DFHack commands, specifically "cls" (clear screen) from within a (lua) script?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5119 on: January 18, 2014, 04:44:48 pm »

No, or at least not that i know.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: DFHack 0.34.11 r3
« Reply #5120 on: January 19, 2014, 11:23:47 am »

I'm having some trouble with structures and enums...

Can someone explain how to do 2 things (in lua, preferably):
1. Determine the death cause of a creature.  I've found df.global.world.deaths.all, but how do I use it?  Preferably finding out if it was a slaughtered animal,
2. Set an enum item - specifically, I'm trying to set RevertWildTimer, found in misc_trait_type in the units file.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5121 on: January 19, 2014, 11:27:32 am »

I dont know if you know the script, but there is a "deathcause.rb" included. (not lua, yes, but maybe it helps.)

Spoiler (click to show/hide)
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 :::

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: DFHack 0.34.11 r3
« Reply #5122 on: January 19, 2014, 11:31:35 am »

I dont know if you know the script, but there is a "deathcause.rb" included. (not lua, yes, but maybe it helps.)

Spoiler (click to show/hide)
I looked at that.  Doesn't help me, I need to get the variables into lua, and I can't figure out how to find them.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5123 on: January 19, 2014, 11:47:42 am »

warning untested code ahead:
Code: [Select]
function getSlaugthered()
  local ret={}
  for _, d in ipairs(df.glboal.world.deaths.all) do
    if d.death_cause==df.death_type.SLAUGHTER then
      table.insert(ret,d)
    end
  end
  return ret
end
for other one use: "df.misc_trait_type.RevertWildTimer" not sure on details though...

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: DFHack 0.34.11 r3
« Reply #5124 on: January 19, 2014, 12:00:33 pm »

warning untested code ahead:
Code: [Select]
function getSlaugthered()
  local ret={}
  for _, d in ipairs(df.glboal.world.deaths.all) do
    if d.death_cause==df.death_type.SLAUGHTER then
      table.insert(ret,d)
    end
  end
  return ret
end
for other one use: "df.misc_trait_type.RevertWildTimer" not sure on details though...

Um, so how would I go about using this?  I'm asking in more of a general sense, I'm looking for the death type in general, slaughter was just an example.
Basically I'm trying to make a system that goes over your fort's history and judges how nice you are to your pets, and make it easier or harder to attract and train animals based on that.  So (for example) if an animal is killed by invaders that's bad, if it dies of starvation that's worse, and if you slaughter it that's the worst.  I know how to iterate over all the animals in the fort's history and check if they're dead, but how would I check the cause of their death?

EDIT: Oh, I found the problem - slaughtered animals don't show up in the death list, probably because they don't run the usual process of go missing - found dead.  Well, then I could just check and see if they were marked for slaughter at the time of death instead.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5125 on: January 19, 2014, 02:34:10 pm »

Code: [Select]
[SYNDROME]
[SYN_CLASS:\COMMAND]
[SYN_CLASS:createitem][SYN_CLASS:GOBLET][SYN_CLASS:SLADE][SYN_CLASS:1][SYN_CLASS:\UNIT_ID]
I tried to create items with interactions, but it doesnt work. The command should just be "createitem GOBLET SLADE 1", while marking a unit. So that above should work with SyndromeTrigger, but it doesnt.  :-\
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5126 on: January 19, 2014, 02:43:37 pm »

You need an item type (like TOY, TOOL, WEAPON, etc...). GOBLET is not a valid item type (at least thats what I gathered from reading this)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5127 on: January 19, 2014, 02:58:36 pm »

Goblet works. I can type that in and spawn a mug. I needed something that has no subtype, because cant use ':' in the syn-classes. DF itself reads the ':' and breaks the syn-class.
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5128 on: January 19, 2014, 03:07:10 pm »

Hmm, then I have no idea. It could be that it isn't configured to take the ID from \UNIT_ID, does it give you an error?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5129 on: January 19, 2014, 03:21:54 pm »

It doesnt give an error, which is the weird part. Everything seems fine... but it doesnt create a unit. I guess it expects the pointer, and doesnt like the unit id.
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 ... 340 341 [342] 343 344 ... 373