Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 57 58 [59] 60 61

Author Topic: [SUGGESTIONS] for DFhack plugins  (Read 143345 times)

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #870 on: March 12, 2017, 02:05:44 am »

Would it be possible to make a reaction to repair items while maintaining item quality, decorations, etc.?

I was thinking maybe a hacked improve item job that resets the item's wear while optionally adding a negative value decoration. It would probably require a repair kit item (made of wood and metal), which is created in large stack sizes and used for the decoration.

Not sure how much of it is possible.
« Last Edit: March 12, 2017, 02:07:33 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

soul4hdwn

  • Bay Watcher
  • make due with what you have
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #871 on: March 12, 2017, 09:59:15 pm »

is it too annoying to request a setting that disables teledwarves when a siege or strange mood happens in-game?  or slightly less direct, a reminder mentioning.
Logged

scourge728

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #872 on: June 28, 2017, 01:37:45 pm »

Could somebody make me a script that could remove smoke from the world (I kinda broke a save trying to kill dwarves with exterminate, and now there's smoke everywhere (despite the fact that it SHOULDN'T be doing that, as the dwarves weren't undead))

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #873 on: June 28, 2017, 04:56:30 pm »

Could somebody make me a script that could remove smoke from the world (I kinda broke a save trying to kill dwarves with exterminate, and now there's smoke everywhere (despite the fact that it SHOULDN'T be doing that, as the dwarves weren't undead))

I was inspired by your post a few days ago and wrote a script already:

Code: [Select]
flows = df.global.flows
for i = #flows - 1, 0, -1 do
    if flows[i].type == df.flow_type.Smoke then
        flows:erase(i)
    end
end

Let me know if you have any issues with it. Originally it just erased everything in flows, but that caused dragonfire to stop working too (not necessarily a bad thing, I suppose, but not right either).
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.

scourge728

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #874 on: June 28, 2017, 06:25:59 pm »

Okay... turns out I have no idea how to use the script.... I tried shoving it into a .txt, using notepad++ to turn into into lua and then renaming the file into a .lua, only for... it to not work

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #875 on: June 28, 2017, 06:35:44 pm »

Is it in the hack/scripts folder? Are you sure you changed the extension to exactly ".lua"? ".lua.txt" won't work.
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.

scourge728

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #876 on: June 28, 2017, 07:52:57 pm »

is flows = df.global.flows supposed to be outside of the section where things turn blue

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #877 on: June 28, 2017, 08:46:10 pm »

I don't know what blue you're referring to. All of the code in my code block should go in one file. I named mine clear-smoke.lua, so I can run clear-smoke in the DFHack console.
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.

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #879 on: June 29, 2017, 07:48:47 am »

I think so. Are you sure it doesn't have a .txt extension too? Where are you saving it?
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.

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #881 on: June 29, 2017, 10:53:27 am »

Okay, and what exactly happens when you run "nosmoke"?
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.

scourge728

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #882 on: June 29, 2017, 11:31:30 am »

the smoke turns invisible, but doesn't actually go away, pressing k still shows smoke and the game still has massive lag problems (I know the lag is related to the smoke because I've reclaimed this fort before, with no lag problem until I got back up to massive populations

lethosor

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #883 on: June 29, 2017, 12:11:56 pm »

Okay, when you said it didn't "work", I assumed you meant that it didn't work at all. It really helps if you can specify exactly why it doesn't work so I don't have to make sure it's in the right place (which it is).

Anyway, it looks like flows are also tracked in map blocks, so I'll have to handle that too.

Edit: try this:

Code: [Select]

function clearSmoke(flows)
    for i = #flows - 1, 0, -1 do
        if flows[i].type == df.flow_type.Smoke then
            flows:erase(i)
        end
    end
end

clearSmoke(df.global.flows)

for _, block in pairs(df.global.world.map.map_blocks) do
    clearSmoke(block.flows)
end

Be warned that it could be slow for large maps.
« Last Edit: June 29, 2017, 12:21:20 pm by lethosor »
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.

scourge728

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #884 on: June 29, 2017, 02:00:48 pm »

Thank you, that seems to work perfectly
Pages: 1 ... 57 58 [59] 60 61