Bay 12 Games Forum

Please login or register.

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

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #495 on: January 11, 2014, 01:46:18 pm »

Nah, if I change the parentheses there it never returns false, only nil. I guess that's not too bad, but it's not that different.


But yeah I'll change the = to == :X

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #496 on: January 11, 2014, 02:17:31 pm »

Quote
Nah, if I change the parentheses there it never returns false, only nil. I guess that's not too bad, but it's not that different.
What exactly does that mean?
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 :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #497 on: January 11, 2014, 02:41:10 pm »

My version is functionally identical to yours, except mine will return false when all of the things are false instead of returning nothing (which I assume will be nil but may be other things, which I could cause problems)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #498 on: January 11, 2014, 02:46:07 pm »

Ok, thank you. In that case I will undo the (). I wasnt sure what caused the error, the brackets or the '=', so I did both.
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 :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #499 on: January 11, 2014, 03:05:13 pm »

One last revision: using a reaction that contains DFHACK_WISH will now activate the script regardless of reagent or product as long as "hackwish startup" is a line in dfhack.init.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #500 on: January 11, 2014, 03:11:12 pm »

I rather run it by autosyndrome. That way I can hook it up with ProbabilitySyndrome and have a chance for a wish, or something horrible. :)
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 :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #501 on: January 11, 2014, 03:12:57 pm »

Since it's a new page, let me amend that by saying it also needs to start with LUA_HOOK_.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #502 on: January 12, 2014, 11:33:08 pm »

Updated hackwish again, this time making it 35% the size, 100 times faster, 5 times easier to use and 33% more functional. Oh yes.

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #503 on: January 13, 2014, 12:06:12 am »

Just looked over your new hackwish script. May I borrow your createitem function for some spells I am working on?

Also, was looking over your skillroll script and wanting to make a similar one for stats, I know I need to change dfhack.units.getEffectiveSkill to dfhack.units.getPhysicalAttrValue, but what is the corresponding df.job_skill[args[2]] for attributes? I couldn't find it in any of the DFHack documentation.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #504 on: January 13, 2014, 12:07:46 am »

Oh, of course. I made that createitem function so that others may use it.

The corresponding whosit isn't really necessary, I don't think.

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #505 on: January 13, 2014, 12:12:29 am »

Sweet I'll give the statroll a try tomorrow, although I guess I will need to think about what the normalization should be (skills are so easy since they are 1-20).

From what I read in the Lua API, changing the last line of the createitem function to dfhack.items.moveToInventory(item,unit,use_mode,body_part) will put the item in the units inventory instead of the ground, but they don't really specify what use_mode or body_part is. I assume the body_part is the numbered part you want it to be equipped on, but do you know the values for use_mode?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #506 on: January 13, 2014, 12:20:12 am »

Yes.

Code: [Select]
        <enum base-type='int16_t' name='mode'>
            <enum-item name='Hauled'/>
            <enum-item name='Weapon' comment='also shield, crutch'/>
            <enum-item name='Worn' comment='quiver'/>
            <enum-item name='InBody'/>
            <enum-item name='Flask' comment='attached to clothing'/>
            <enum-item name='WrappedAround' comment='e.g. bandage'/>
            <enum-item name='StuckIn'/>
            <enum-item name='InMouth' comment='string descr like Worn'/>
            <enum-item name='Shouldered'/>
            <enum-item name='SewnInto'/>
        </enum>

Hauled is 0, Weapon is 1 etc.

found here.

Roses

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #507 on: January 13, 2014, 12:26:44 am »

Ah wonderful, haven't seen that page before. Lots of new information to read!
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #508 on: January 28, 2014, 02:21:00 pm »

When using the itemsyndrome for R4 you have on your github, I get these:

Code: [Select]
...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:190: Cannot read field string.find: not found.stack traceback:
        [C]: in function '__index'
        ...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:190: in function 'getValidPositions'
        ...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:202: in function 'itemIsInValidPosition'
        ...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:232: in function 'addOrRemoveSyndromeDepending'
        ...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:272: in function 'checkAndAddSyndrome'
        ...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:295: in function <...\Dwarf Fortress\hack\scripts/itemsyndrome.lua:294>

I am trying to use these inorganics/items:
Code: [Select]
[INORGANIC:DFHACK_ITEMSYNDROME_MATERIAL_WARLOCKSTAFF]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[SYNDROME]
[SYN_NAME:warlock staff]
[SYN_CLASS:DFHACK_ITEM_SYNDROME]
[SYN_CLASS:DFHACK_WIELDED_ONLY]
[SYN_AFFECTED_CLASS:WARLOCK_M]
[SYN_AFFECTED_CLASS:WARLOCK_F]
[CE_CAN_DO_INTERACTION:START:0]
[CDI:INTERACTION:MATERIAL_EMISSION]
[CDI:ADV_NAME:conjure slade boulder]
[CDI:USAGE_HINT:ATTACK]
[CDI:MATERIAL:INORGANIC:SLADE:SOLID_GLOB]
[CDI:VERB:conjure and shoot a slade boulder:conjures and shoots a slade boulder:NA]
[CDI:TARGET:C:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:C:15]
[CDI:MAX_TARGET_NUMBER:C:1]
[CDI:WAIT_PERIOD:250]


[INORGANIC:DFHACK_ITEMSYNDROME_MATERIAL_WARLOCKBLADE]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[SYNDROME]
[SYN_NAME:wraithblade]
[SYN_CLASS:DFHACK_ITEM_SYNDROME]
[SYN_CLASS:DFHACK_WIELDED_ONLY]
[SYN_AFFECTED_CLASS:WARLOCK_M]
[SYN_AFFECTED_CLASS:WARLOCK_F]
[CE_CAN_DO_INTERACTION:START:0]
[CDI:INTERACTION:SLOW_SPELL]
[CDI:USAGE_HINT:ATTACK]
[CDI:VERB:bug:points his wraithblade at the opponent:NA]
[CDI:TARGET_VERB:bug:is slowed down]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:7]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:WAIT_PERIOD:450]
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 :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack scripts
« Reply #509 on: January 28, 2014, 02:36:28 pm »

...You sure you're using the latest version? I'm pretty sure I fixed that bug.
Pages: 1 ... 32 33 [34] 35 36 ... 44