Bay 12 Games Forum

Please login or register.

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

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #45 on: March 14, 2013, 08:15:54 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.

Right now, the script only applies the first syndrome in a creature's syndromes.

EDIT: Ah--I think this won't work with r3 due to a little thing in r3, but I'm not sure:

Renamed syn_affected_creature_2 to the more accurate syn_affected_caste.

Checking.

EDIT: Yep. Fixed.
« Last Edit: March 14, 2013, 09:10:32 pm by Putnam »
Logged

Lycaeon

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #46 on: March 14, 2013, 11:19:57 pm »

The script isn’t working in r3, with these errors displayed (Only after you embark):

itemsyndrome.lua:120: attempt to call global ‘ItemIsWieldedOnly’ (a nil value)
stack traceback: itemsyndrome.lua:120: in function ‘itemIsInValidPosition’
itemsyndrome.lua:130: in function ‘findItems’
itemsyndrome.lua:144: in function <itemsyndrome.lua:143>
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 #47 on: March 14, 2013, 11:26:46 pm »

...THIS IS WHAT HAPPENS WHEN YOU CAPITALIZE INCORRECTLY KIDS.

Fixed.
« Last Edit: March 14, 2013, 11:29:22 pm by Putnam »
Logged

Lycaeon

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #48 on: March 14, 2013, 11:39:33 pm »

I think you uploaded the previous version by accident (I was still getting errors so I compared them in Notepad++).
« Last Edit: March 14, 2013, 11:45:40 pm by Lycaeon »
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 #49 on: March 14, 2013, 11:47:13 pm »

Okay try again.

Lycaeon

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #50 on: March 14, 2013, 11:50:50 pm »

It works now. Thanks! :)
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?”

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utility
« Reply #51 on: March 15, 2013, 02:40:09 am »

Stupid question: Does this run with r3? :) I know falconne has to rewrite his scripts...
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 modder's utility
« Reply #52 on: March 15, 2013, 03:50:19 am »

I updated it for r3; falconne's plugins are a bit more complex than this script, so I only had to make two changes:

1. Replaced all instances of "creature_1" with "creature"

2. Replaced all instances of "creature_2" with "caste".

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utility
« Reply #53 on: March 15, 2013, 09:58:14 am »

I just tested it. It applies the syndrome just fine, but after the person drops the item, the syndrome persists. Am I correct that people should just use syndromes with short times, Start:0:End:100 ? And while they wear the item, the syndrome is applied constantly, even if the 100 ticks are already gone?
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 :::

Gaybarowner

  • Bay Watcher
  • [SLOW_LEARNER] [VERMIN_HATEABLE]
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #54 on: March 15, 2013, 11:31:19 am »

I love you putnam now my idea can be put into motion
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utility
« Reply #55 on: March 15, 2013, 01:22:01 pm »

I just tested it. It applies the syndrome just fine, but after the person drops the item, the syndrome persists. Am I correct that people should just use syndromes with short times, Start:0:End:100 ? And while they wear the item, the syndrome is applied constantly, even if the 100 ticks are already gone?

It should have an end time of at least 150, but no more than... oh, 200.

Putnam

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

Updated. It now tracks spatters, too.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utility
« Reply #57 on: March 18, 2013, 09:08:15 am »

I have a little problem... these are the materials for the steampowered armor, a flamethrower and a fireball-throwing cannon. I can create these items ingame, dwarves equip them, but the dwarves are not affected with the syndromes. Is there anything I am doing wrong, syntax-wise?

EDIT: Could it be because I only use syn_affected_class, and not [SYN_AFFECTED_CREATURE:DWARF:ALL] ? I will do a test.
EDIT2: I added the syn_affected_creature:dwarf:all, but still, no effect.
EDTI3: Did a last test with no end to the syndrome, because I thought it might only be applied once... but it didnt help. I'll wait for now.
Edit4: Nothing works. :( I tried haulers and stuckins, coatings and armor... nothing. Redownloaded, copied again into hack/scripts, nothing.

I do have the line "itemsyndrome" in the dfhack init, and dont know what else could be wrong.

Code: [Select]
// iron grade
[INORGANIC:STEAMPOWER]
[USE_MATERIAL_TEMPLATE:METAL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:steampower]
[STATE_NAME_ADJ:LIQUID:steampower]
[STATE_NAME_ADJ:GAS:steampower]

[DISPLAY_COLOR:0:7:1]
[BUILD_COLOR:0:7:1]
[MATERIAL_VALUE:8]
[SPEC_HEAT:450]
[MELTING_POINT:12768]
[BOILING_POINT:15150]
[SOLID_DENSITY:7850]
[LIQUID_DENSITY:6980]
[MOLAR_MASS:55845]
[IMPACT_YIELD:542500]
[IMPACT_FRACTURE:1085000]
[IMPACT_STRAIN_AT_YIELD:319]
[COMPRESSIVE_YIELD:542500]
[COMPRESSIVE_FRACTURE:1085000]
[COMPRESSIVE_STRAIN_AT_YIELD:319]
[TENSILE_YIELD:155000]
[TENSILE_FRACTURE:310000]
[TENSILE_STRAIN_AT_YIELD:73]
[TORSION_YIELD:155000]
[TORSION_FRACTURE:310000]
[TORSION_STRAIN_AT_YIELD:189]
[SHEAR_YIELD:155000]
[SHEAR_FRACTURE:310000]
[SHEAR_STRAIN_AT_YIELD:189]
[BENDING_YIELD:155000]
[BENDING_FRACTURE:310000]
[BENDING_STRAIN_AT_YIELD:73]
[MAX_EDGE:10000]

[SYNDROME]
         [SYN_NAME:technology is awesome]
         [SYN_CONTACT] [SYN_INHALED]
[SYN_CLASS:DFHACK_ITEM_SYNDROME]
[SYN_AFFECTED_CLASS:ALL_CREATURES]
[CE_PHYS_ATT_CHANGE:STRENGTH:5000:5000:START:0:END:200]



[INORGANIC:FIRECANNON]
[USE_MATERIAL_TEMPLATE:METAL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:steampowered]
[STATE_NAME_ADJ:LIQUID:steampowered]
[STATE_NAME_ADJ:GAS:steampowered]

[DISPLAY_COLOR:6:4:0]
[BUILD_COLOR:6:4:0]
[MATERIAL_VALUE:4]
[SPEC_HEAT:435]
[MELTING_POINT:11868]
[BOILING_POINT:14140]
[SOLID_DENSITY:8250]
[LIQUID_DENSITY:8020]
[MOLAR_MASS:80000]
[IMPACT_YIELD:602000]
[IMPACT_FRACTURE:843500]
[IMPACT_STRAIN_AT_YIELD:547]
[COMPRESSIVE_YIELD:602000]
[COMPRESSIVE_FRACTURE:843500]
[COMPRESSIVE_STRAIN_AT_YIELD:547] no data, used 110
[TENSILE_YIELD:172000]
[TENSILE_FRACTURE:241000]
[TENSILE_STRAIN_AT_YIELD:156] 110
[TORSION_YIELD:172000]
[TORSION_FRACTURE:241000]
[TORSION_STRAIN_AT_YIELD:156]
[SHEAR_YIELD:172000]
[SHEAR_FRACTURE:241000]
[SHEAR_STRAIN_AT_YIELD:156] no data, used 110
[BENDING_YIELD:172000]
[BENDING_FRACTURE:241000]
[BENDING_STRAIN_AT_YIELD:156]
[MAX_EDGE:10000]
[SYNDROME]
         [SYN_CONTACT] [SYN_INHALED]
[SYN_CLASS:DFHACK_ITEM_SYNDROME]
[SYN_AFFECTED_CLASS:ALL_CREATURES]
    [CE_CAN_DO_INTERACTION:PROB:100:START:0:END:200]
    [CDI:INTERACTION:MATERIAL_EMISSION]
    [CDI:ADV_NAME:firecannon]
    [CDI:USAGE_HINT:ATTACK]
    [CDI:BP_REQUIRED:BY_CATEGORY:HAND]
         [CDI:FLOW:FIREBALL]
         [CDI:TARGET:A:LINE_OF_SIGHT]
         [CDI:TARGET_RANGE:A:20]
         [CDI:MAX_TARGET_NUMBER:A:1]
         [CDI:VERB:shoot fireballs with the firecannon:shoots fireballs with the firecannon:NA]
         [CDI:WAIT_PERIOD:151]



[INORGANIC:FLAMETHROWER]
[USE_MATERIAL_TEMPLATE:METAL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:steampowered]
[STATE_NAME_ADJ:LIQUID:steampowered]
[STATE_NAME_ADJ:GAS:steampowered]

[DISPLAY_COLOR:6:4:0]
[BUILD_COLOR:6:4:0]
[MATERIAL_VALUE:4]
[SPEC_HEAT:435]
[MELTING_POINT:11868]
[BOILING_POINT:14140]
[SOLID_DENSITY:8250]
[LIQUID_DENSITY:8020]
[MOLAR_MASS:80000]
[IMPACT_YIELD:602000]
[IMPACT_FRACTURE:843500]
[IMPACT_STRAIN_AT_YIELD:547]
[COMPRESSIVE_YIELD:602000]
[COMPRESSIVE_FRACTURE:843500]
[COMPRESSIVE_STRAIN_AT_YIELD:547] no data, used 110
[TENSILE_YIELD:172000]
[TENSILE_FRACTURE:241000]
[TENSILE_STRAIN_AT_YIELD:156] 110
[TORSION_YIELD:172000]
[TORSION_FRACTURE:241000]
[TORSION_STRAIN_AT_YIELD:156]
[SHEAR_YIELD:172000]
[SHEAR_FRACTURE:241000]
[SHEAR_STRAIN_AT_YIELD:156] no data, used 110
[BENDING_YIELD:172000]
[BENDING_FRACTURE:241000]
[BENDING_STRAIN_AT_YIELD:156]
[MAX_EDGE:10000]
[SYNDROME]
         [SYN_CONTACT] [SYN_INHALED]
[SYN_CLASS:DFHACK_ITEM_SYNDROME]
[SYN_AFFECTED_CLASS:ALL_CREATURES]
    [CE_CAN_DO_INTERACTION:PROB:100:START:0:END:200]
    [CDI:INTERACTION:MATERIAL_EMISSION]
    [CDI:ADV_NAME:flamethrower]
    [CDI:USAGE_HINT:ATTACK]
    [CDI:BP_REQUIRED:BY_CATEGORY:HAND]
         [CDI:FLOW:FIREJET]
         [CDI:TARGET:A:LINE_OF_SIGHT]
         [CDI:TARGET_RANGE:A:10]
         [CDI:MAX_TARGET_NUMBER:A:2]
         [CDI:VERB:shoot flames with the flamethrower:shoots flames with the flamethrower:NA]
         [CDI:WAIT_PERIOD:151]
« Last Edit: March 18, 2013, 02:00:36 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 modder's utility
« Reply #58 on: March 18, 2013, 02:47:10 pm »

Try removing the affected class entirely; it automatically work on all creatures then.

Also, DWARF:ALL won't work; you need to count each individual caste. I recommend a new class for dwarves specifically.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utility
« Reply #59 on: March 18, 2013, 03:07:56 pm »

What now? Remove the SYN_AFFECTED_CLASS, or add a SYN_AFFECTED_CLASS:DWARVES ? ^^
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 2 3 [4] 5 6 ... 44