Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 34 35 [36] 37 38 ... 44

Author Topic: Putnam's DFHack scripts  (Read 119941 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #525 on: March 14, 2014, 12:29:51 pm »

It's a script, so it needs to be activated in dfhack.init

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: Putnam's DFHack scripts
« Reply #526 on: March 14, 2014, 01:57:33 pm »

I've observed this too, the gods not appearing. It is activated in dfhack.init
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #527 on: March 14, 2014, 02:47:47 pm »

Something recent, maybe? I'll check it out.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Putnam's DFHack scripts
« Reply #528 on: March 14, 2014, 03:54:24 pm »

I have the script in moddableGods.lua in dfhack/scripts/, and I have the line "moddableGods" in dfhack.init. What else should I do? I would really love to get it working :).
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #529 on: March 14, 2014, 03:59:31 pm »

Shouldn't require anything.

But try the new version anyway. I removed a couple of redundant things, one of which was actually doing something (nothing good, may have been breaking it):

https://gist.github.com/Putnam3145/7005768

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Putnam's DFHack scripts
« Reply #530 on: March 15, 2014, 04:25:50 am »

Thank you :). I think iI just misunderstood that you have to load a world NOT in legends mode to get the gods.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #531 on: April 09, 2014, 08:21:15 pm »

https://gist.github.com/Putnam3145/10335380

Code: [Select]
do
    local function thoughtIsNegative(thought)
        return df.unit_thought_type.attrs[thought.type].value:sub(1,1)=='-' and df.unit_thought_type[thought.type]~='LackChairs'
    end
    local function write_gamelog_and_announce(msg,color)
        dfhack.gui.showAnnouncement(msg,color)
        local log = io.open('gamelog.txt', 'a')
        log:write(msg.."\n")
        log:close()
    end
    local function checkForBadThoughts()
        local thoughts={}
        local mostPopularNegativeThought={cur_amount=0,thought_type=-1}
        for _,unit in ipairs(df.global.world.units.active) do
            if dfhack.units.isCitizen(unit) then
                for __,thought in ipairs(unit.status.recent_events) do
                    if thoughtIsNegative(thought) then
                        thoughts[thought.type]=thoughts[thought.type] or 0
                        thoughts[thought.type]=thoughts[thought.type]+1
                        if thoughts[thought.type]>mostPopularNegativeThought.cur_amount then
                            mostPopularNegativeThought.cur_amount=thoughts[thought.type]
                            mostPopularNegativeThought.thought_type=thought.type
                        end
                    end
                end
            end
        end
        if df.unit_thought_type[mostPopularNegativeThought.thought_type] then
            write_gamelog_and_announce('Your dwarves are most complaining about this: "' .. df.unit_thought_type.attrs[mostPopularNegativeThought.thought_type].caption..'".',COLOR_CYAN)
        end
    end
    checkForBadThoughts()
end

Looks through all negative thoughts, gives you the most common one.

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: Putnam's DFHack scripts
« Reply #532 on: April 17, 2014, 02:24:46 am »

I have a question about spawnunit.

DF seem to cache the creatures list to use in the fort's animals screen. Obviously when you have a birth or a death the screen is refreshed. But when using spawnunit to create a pet, the new create does not appear there until the save is reloaded.

This seems to cause trouble to players who cannot figure out how to train them. Did we find a way to enforce a cache reload like we did for enemies?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #533 on: June 05, 2014, 06:04:35 pm »

Question about itemsyndrome:

Do invaders that spawn with weapons and armor trigger itemSyndrome? Or do they have to unequip and then re-equip the items?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #534 on: June 05, 2014, 06:13:12 pm »

I don't know if itemsyndrome corrects for it or not, but the equipment change event in EventManager does not trigger for new units.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #535 on: June 05, 2014, 06:15:42 pm »

Hmm, I didn't see any correction for it in the script, but it is very possible that I missed something.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #536 on: June 05, 2014, 06:27:39 pm »

There is no correction and I should probably handle it in some way.

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #537 on: June 05, 2014, 08:45:15 pm »

If you could that would be awesome. Planning an invading race and would like them to be able to benefit from itemSyndrome.
Logged

whitecold

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #538 on: June 06, 2014, 03:11:15 am »

I'm trying the force script and I'm getting an error here:
:57: '}' expected (to close '{' at line 52) near 'migrants'
Logged

Foton

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #539 on: June 11, 2014, 05:14:18 pm »

I encountered the same problem.

You can download older version here: http://dffd.wimbli.com/file.php?id=7367
It seems to work.
Logged
Actually, drinking magma is completely harmless.
Pages: 1 ... 34 35 [36] 37 38 ... 44