Bay 12 Games Forum

Please login or register.

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

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

Cocoprimate

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack scripts
« Reply #480 on: December 30, 2013, 01:04:05 am »

Yeah I've checked beforehand in legends and there's plenty of megabeasts. I also have 4 million in fortress wealth and 145 population, so that is not the issue.

I've submitted "force megabeast" 3 or 4 times. The dwarven caravan and liaison have come and gone. The queen arrived too. Also had a goblin ambush, but no megabeasts.

I mean, I know I have the plug-in installed because when I type force event, I get the list of things that can be chosen and stuff. Could it be that megabeast spawning doesn't work, or that I have an old version? I have Peridexis Errant LNP r43, I downloaded it maybe a week ago.
Logged
The story of Aban Diamondtowns the Charms of Society, dwarf legend, and his descent into the depths. (SPOILER)
http://www.bay12forums.com/smf/index.php?topic=79229.0

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #481 on: December 30, 2013, 11:14:14 pm »

Say, is this syntax still correct? Its been a while since I looked at projectileExpansion, and dont know if r4 changed it.

Code: [Select]
[REACTION_CLASS:DFHACK_GAS_UNDIRECTED]
[REACTION_CLASS:DFHACK_FLOW_SIZE]
[REACTION_CLASS:50]
[REACTION_CLASS:DFHACK_SPECIFIC_MAT]
[REACTION_CLASS:CREATURE_MATERIAL_DRAGON_WHITE]
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 #482 on: December 30, 2013, 11:14:37 pm »

I try to keep syntax the same between versions. It should still work.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #483 on: December 30, 2013, 11:15:51 pm »

Perfect. :)
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 #484 on: January 01, 2014, 07:11:25 am »

Added hackWish.lua.

Just to give a simple example:

Code: [Select]
[REACTION:LUA_HOOK_DFHACK_WISH_SET_ZELDA]
[NAME:Make a wish on the Triforce]
[BUILDING:TRIFORCE_SHRINE_ZELDA:CUSTOM_W]
[REAGENT:A:1:TOOL:TRIFORCE:NONE:NONE][PRESERVE_REAGENT]
[PRODUCT:100:1:TOOL:TRIFORCE_WISH_THING:NONE:NONE]

[REACTION:DFHACK_WISH_GIVE_ZELDA]
[NAME:]
[BUILDING:TRIFORCE_SHRINE_ZELDA:NONE]
[REAGENT:A:1:TOOL:TRIFORCE:NONE:NONE]
[REAGENT:B:1:TOOL:TRIFORCE_WISH_THING:NONE:NONE]
[PRODUCT:100:1:BACKPACK:NONE:NONE:NONE]
[AUTOMATIC]

DFHACK_WISH_GIVE is required for the giving reaction and LUA_HOOK_ and DFHACK_WISH_SET are both required for the setting reaction. Both setting and giving reactions are required.

Basically, it's a Nethackish wand of wishing. You wish for a "long sword" with material "adamantine" and you get an adamantine long sword, simple as that. You could also wish for a human skin long sword, I guess, if you want that.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #485 on: January 01, 2014, 10:45:36 pm »

Oh nice, a new toy. :) I will give it a try.

I also tried to make another metal with itemsyndrome, but I get the same errorlog that thistleknot already reported. I am using the latest MDF release, which includes the itemsyndrome version from the studded with patches release.

Code: [Select]
...ess-unified\Dwarf Fortress\hack\scripts/itemsyndrome.lua:274: attempt to inde
x local 'item' (a nil value)
stack traceback:
        ...ess-unified\Dwarf Fortress\hack\scripts/itemsyndrome.lua:274: in func
tion 'checkAndAddSyndrome'
        ...ess-unified\Dwarf Fortress\hack\scripts/itemsyndrome.lua:294: in func
tion <...ess-unified\Dwarf Fortress\hack\scripts/itemsyndrome.lua:293>
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 #486 on: January 01, 2014, 10:49:01 pm »

Oh my. I forgot to check if there was actually an item involved. Fixed.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #487 on: January 03, 2014, 11:35:52 am »

I tried that hackwish script. Works as advertised, but it crashes now and then. Once when I entered "pick", the other time when I typed in a invalid material and pressed 'y' to try again.

I dont know why, but the second, AUTOMATIC reaction is never queued automatically. I had to do it manually, even if I generate the reagent for it in the first reaction.

It would fit quite well with a "sell soul to devil" bargain. I will do further tests later, I am hoping the 2 crashes were a fluke. I got no error messages in the dfhack window.

EDIT: Started it up again, first try, crash. Or to be more precise: It freezes. I tried nestbox, "invalid item", try again:Y, then "nest box", which caused the freezing.
« Last Edit: January 03, 2014, 12:10:24 pm by Meph »
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 #488 on: January 03, 2014, 01:58:41 pm »

Ah hmm. Better check that out.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #489 on: January 06, 2014, 06:53:10 am »

Did you find any problems with it on your end?

It would be nice if it could fail, depending on the value of the created item. Value 0-1000 = 100% success rate, and the higher you go, the smaller it gets. Adamantine Sword is only 5% or so. This way people can ask for normal items and get them, or can gamble and ask for something nice.

If it fails, it runs "spawnunit DEMON_1 0 Horned-Reaper". ;)
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 #490 on: January 10, 2014, 03:14:53 pm »

I fixed hackwish's crashing issues and removed the need for reactions to use it.

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

New syntax is hackWish x,y,z or hackWish unitID. In, say, syndromeTrigger or autoSyndrome this would be [SYN_CLASS:hackWish][SYN_CLASS:\WORKER_ID] or [SYN_CLASS:hackWish][SYN_CLASS:\LOCATION].

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #491 on: January 10, 2014, 03:37:59 pm »

I fixed hackwish's crashing issues and removed the need for reactions to use it.

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

New syntax is hackWish x,y,z or hackWish unitID. In, say, syndromeTrigger or autoSyndrome this would be [SYN_CLASS:hackWish][SYN_CLASS:\WORKER_ID] or [SYN_CLASS:hackWish][SYN_CLASS:\LOCATION].
Brilliant, thanks. :) I will make good use of it for dark pacts with the underworld. :)
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 :::

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #492 on: January 11, 2014, 07:15:24 am »

Tested, I do get an error.  ???

Code: [Select]
[DFHack]# hackwish
...\MDF\MasterworkDF V4f\Dwarf Fortress\hack\lua\dfhack.lua:354: ...asterworkDF
V4f\Dwarf Fortress\hack\scripts/hackwish.lua:127: ')' expected near '=' stack traceback:
        [C]: in function 'error'
        ...\MDF\MasterworkDF V4f\Dwarf Fortress\hack\lua\dfhack.lua:354: in function <...\MDF\MasterworkDF V4f\Dwarf Fortress\hack\lua\dfhack.lua:344>

There seems to be an issue with the 'itemTypeIsNotSupported(itemtype)' function.

EDIT: Writing it like this seems to fix it:
Code: [Select]
return (itemType==df.item_type.EGG) or (itemtype==df.item_type.CORPSE) or (itemtype==df.item_type.CORPSEPIECE) or (itemtype==df.item_type.REMAINS) or (itemtype==df.item_type.FISH) or (itemtype==df.item_type.FISH_RAW) or (itemtype==df.item_type.VERMIN) or (itemtype==df.item_type.PET)
EDIT2: I got it to work in reactions with WORKER_ID. LOCATION does not seem to cut it. But the biggest problem: When I entered an invalid material and pressed 'Y' to try again, it crashed.

I will do more tests.

EDIT3: Invalid items seem to be fine, but it crashes when you enter an invalid material and then press 'Y' to try again. Could it be that it actually tries to create it, and DF just dies because the material does not exist?

It also crashed when I created an "instrument slade" item. Guess CRAFTS, TOY, TOOL and INSTRUMENT should be an option? Edit again: Yep, "toy iron" also crashes. All item types without subtypes seem to crash it. (Tested again with "weapon iron", crashes as well)

EDIT4: Full list:
FOOD
TRAPCOMP
WEAPON
HELM
ARMOR
PANTS
SHOES
GLOVES
SIEGEAMMO
AMMO
SHIELD
TOY
INSTRUMENT
TOOL

In short: Every item type that can possible have a sub-type crashes the game, if you just ask for the item type, instead of the sub-type.
« Last Edit: January 11, 2014, 07:44:36 am by Meph »
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 #493 on: January 11, 2014, 12:45:06 pm »

Makes sense. I figure I may be able to just give it a random subtype if you do that for some reason or another.

EDIT: there, should have fixed both those issues.
« Last Edit: January 11, 2014, 12:54:04 pm by Putnam »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack scripts
« Reply #494 on: January 11, 2014, 01:15:35 pm »

You still have to change this line:
Code: [Select]
  return (itemType==df.item_type.EGG or itemtype==df.item_type.CORPSE or itemtype=df.item_type.CORPSEPIECE or itemtype==df.item_type.REMAINS or itemtype=df.item_type.FISH or itemtype=df.item_type.FISH_RAW or itemtype==df.item_type.VERMIN or itemtype==df.item_type.PET)
to this:
Code: [Select]
    return (itemType==df.item_type.EGG) or (itemtype==df.item_type.CORPSE) or (itemtype==df.item_type.CORPSEPIECE) or (itemtype==df.item_type.REMAINS) or (itemtype==df.item_type.FISH) or (itemtype==df.item_type.FISH_RAW) or (itemtype==df.item_type.VERMIN) or (itemtype==df.item_type.PET) Just adding a few () and three of the = have to be a ==.

And with this it works. Thanks Putnam, I could not cause any crashes, and the random sub-type output works. :)
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 ... 31 32 [33] 34 35 ... 44