Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5 ... 44

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

KingofstarrySkies

  • Bay Watcher
  • It's been a long time...
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #30 on: March 12, 2013, 02:59:39 pm »

OP weapons of mass destruction, here we go.
BEHOLD THE MEGASWORD
ONE SWIPE, AND THE WORLD WILL ERUPT WITH AN EXPLOSION!
LAVA WILL BURST FROM NOWHERE, AND YOU WILL TURN TO NOTHING!!!!!!! MWUHAHAHAH!
Logged
Sigtextastic
Vereor Nox.
There'll be another King, another sky, and a billion more stars...

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #31 on: March 12, 2013, 03:26:39 pm »

also the modes for inventory are:
Code: [Select]
Hauled,
      /**
       * also shield, crutch
       */
      Weapon,
      /**
       * quiver
       */
      Worn,
      InBody,
      /**
       * attached to clothing
       */
      Flask,
      /**
       * e.g. bandage
       */
      WrappedAround,
      StuckIn,
      /**
       * string descr like Worn
       */
      Unk7,
      Shouldered,
      SewnInto
taken from unit_inventory_item.h

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #32 on: March 12, 2013, 05:40:20 pm »

I updated Itemsyndrome so that it no longer works on stuckins--unless otherwise specified. The same goes for haulers--you can now specify that haulers get syndromes from certain materials.

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #33 on: March 12, 2013, 07:12:24 pm »

Thanks Putnam  :D

Lycaeon

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #34 on: March 12, 2013, 07:41:17 pm »

The script is giving me an error in the DFHack window:

itemsyndrome.lua:77: ‘then’ expected near ‘=’
      stack traceback:
      [C]: in function ‘error’

This didn't show up in the previous version.
Logged
“I want to calm the storm, but the war is in your eyes.
How can I shield you from the horror and the lies?
When all that once held meaning is shattered, ruined, bleeding
And the whispers in the darkness tell me we won’t survive?”

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #35 on: March 12, 2013, 07:51:15 pm »

ugh, I hate it when stupid errors don't show up on my end for one reason or another...

Wait, that's odd. This is line 77:

   local syndrome = getSyndrome(getMaterial(item))

I don't see an "if" in there!

EDIT: PALM APPLY FIRMLY TO FACE. I uploaded an intermediate version instead of the latest.
« Last Edit: March 12, 2013, 07:54:57 pm by Putnam »
Logged

Lycaeon

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #36 on: March 12, 2013, 08:08:15 pm »

Much thanks! :)

If possible, could you also add a tag that makes the syndrome only affect wearers of the material armor? Otherwise, wrestling enemies would be able to tear off your dwarves' armor and gain its effects from just holding it.
Logged
“I want to calm the storm, but the war is in your eyes.
How can I shield you from the horror and the lies?
When all that once held meaning is shattered, ruined, bleeding
And the whispers in the darkness tell me we won’t survive?”

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #37 on: March 12, 2013, 08:12:57 pm »

Yep. Next version! Which is out now!

EDIT: *groan*. Those of you who downloaded 1.4: I uploaded a fixed version OR you could add a single right parenthesis after "(item_inv.mode ~=1 and ItemIsWieldedOnly(item_inv)".
« Last Edit: March 13, 2013, 12:46:02 am by Putnam »
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #38 on: March 14, 2013, 02:03:00 pm »

I updated Itemsyndrome so that it no longer works on stuckins--unless otherwise specified. The same goes for haulers--you can now specify that haulers get syndromes from certain materials.

Is it possible to do *only* on stuck-ins and not on wielded/worn?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #39 on: March 14, 2013, 04:46:56 pm »

Yes. @_@

KingofstarrySkies

  • Bay Watcher
  • It's been a long time...
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #40 on: March 14, 2013, 04:51:58 pm »

Yes. @_@
is it possible to make fire that when touched makes water!?
Also, Putnam.
I see your @_@
Its transparent.
Logged
Sigtextastic
Vereor Nox.
There'll be another King, another sky, and a billion more stars...

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #41 on: March 14, 2013, 06:44:53 pm »

Yes. @_@

Right.  Um, what I meant was could you do that please :D

Quote
local function itemIsWeaponOnly(item)
   local syndrome = getSyndrome(getMaterial(item))
   for k,v in ipairs(syndrome.syn_class) do
      if v.value=="DFHACK_WIELDED_ONLY" then return true end
   end
   return false
end
   
local function itemIsInValidPosition(item_inv)
   if (item_inv.mode == 0 and not itemAffectsHauler(item_inv)) or (item_inv.mode == 7 and not itemAffectsStuckins(item_inv)) or (item_inv.mode ~= 2 and itemIsArmorOnly(item_inv)) or (item_inv.mode ~=1 and ItemIsWieldedOnly(item_inv)) then return false end
   return true
end

Should it be itemIsWeaponOnly? (or conversely the function renamed)
« Last Edit: March 14, 2013, 06:46:44 pm by smakemupagus »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #42 on: March 14, 2013, 06:47:05 pm »

Shit.

This is why I have you people :P

Uploaded new version that fixed that.
« Last Edit: March 14, 2013, 06:49:24 pm by Putnam »
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #43 on: March 14, 2013, 06:55:27 pm »

DFHACK_STUCKINS_ONLY
nice 8)

You just signed the death warrant for a lot of elves ..

Spirit of Power

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #44 on: March 14, 2013, 08:15:04 pm »

Now I feel the inexplicable urge to mod in a gigantic needle that's made of a material that will, on a stuck-in, turn elves into piles of wood, dwarves into booze, goblins into iron, and humans into fruit.
Logged
Pages: 1 2 [3] 4 5 ... 44