Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 13 14 [15] 16 17 ... 44

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #210 on: April 28, 2013, 07:11:33 pm »

[DFHack]# force migrant players  should be [DFHack]# force migrants. No player, but an extra s on the migrants.

Thistleknot: [DFHack]# force siege EVIL is correct, if your world has a goblin civ with entity ID EVIL. its case sensitive.

No, you need "player" now. I've fixed that, I think.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utilities
« Reply #211 on: April 28, 2013, 07:13:50 pm »

Oh, so the script changed somewhere along the lines. I just tested, yes. either MOUNTAIN or player. time to do a quick fix on the embassy then.

But its still "force migrants player", with the 's' :P

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 :::

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #212 on: April 28, 2013, 07:18:17 pm »

[DFHack]# force migrant players  should be [DFHack]# force migrants. No player, but an extra s on the migrants.

Thistleknot: [DFHack]# force siege EVIL is correct, if your world has a goblin civ with entity ID EVIL. its case sensitive.

No, you need "player" now. I've fixed that, I think.

it would help so much if you would give me a line that would result in an "evil" siege.  That's what we're discussing here, the correct syntax, and even Meph is miphed as to the proper format, so spelling it out with "quotes" would help me solve trying to get an "evil" siege showing up.

:)

I only say it this way because I just tried these
Spoiler (click to show/hide)

and then when's it figured out, to properly document the front page so other players who download it can understand how to properly utilize it.  Thanks brohonno's
« Last Edit: April 28, 2013, 07:20:04 pm by thistleknot »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Putnam's DFHack modder's utilities
« Reply #213 on: April 28, 2013, 07:23:46 pm »

You can type into dfhack this line:
force siege EVIL

This will trigger a goblin siege, if your goblin entity ID is EVIL, and you have a goblin civ in your world, and you fullfill the goblin siege triggers, either by population or wealth. You can just make a cheat reaction to spawn a few adamantine statues to ramp up fort value quickly, for your tests.

The syntax in the inorganic mat should be:

Code: [Select]
[INORGANIC:FORCE_SIEGE_EVIL]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:bug100]
[STATE_NAME_ADJ:LIQUID:bug100]
[STATE_NAME_ADJ:GAS:Declare war]
  [SYNDROME][SYN_CLASS:\COMMAND] autosyndrome command begins here
   [SYN_CLASS:force][SYN_CLASS:siege][SYN_CLASS:EVIL]
         [SYN_NAME:Declare war]
         [SYN_CONTACT][SYN_INHALED]
             [SYN_AFFECTED_CREATURE:DWARF:ALL]
[SYN_AFFECTED_CREATURE:KOBOLD_CAMP:ALL]
[SYN_AFFECTED_CREATURE:ORC_TAIGA:ALL]
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:1]
[DISPLAY_COLOR:4:4:1][TILE:'*'][MELTING_POINT:900]
[BOILING_POINT:905][SOLID_DENSITY:55520][MATERIAL_VALUE:1]

It uses the STONE_VAPOR_TEMPLATE] I have in my mods, but you have that template too, so everything should work fine.
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 utilities
« Reply #214 on: April 28, 2013, 07:25:17 pm »

just:
force siege EVIL

It's like this:

First thing is force. That's the script!

Second thing is type of event you want to force. In this case, it's siege!

Third thing is which entity type you want to force. In this case, it's EVIL. It's either a raw entity ID or "player" for the player. force siege player is a BAAAAAAAD idea.

There's nothing more.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #215 on: April 28, 2013, 07:39:52 pm »

must be my game then
Spoiler (click to show/hide)

I do have an entity:EVIL btw, and verified I have a creature:goblin to back it up with (and verified the token for said entity was creature:goblin)

Corai

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #216 on: April 28, 2013, 07:41:55 pm »

Try force siege PLAINS or force siege FOREST. See if elves or humans show up. It's working for me.

Spoiler (click to show/hide)
Logged
Jacob/Lee: you have a heart made of fluffy
Jeykab/Bee: how the fuck do you live your daily life corai
Jeykab/Bee: you seem like the person who constantly has mini heart attacks because cuuuute

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #217 on: April 28, 2013, 07:52:01 pm »

OH SHIT!

That did it... I guess that means my evil entity is broken...

thank you errorlog

expwnent

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #218 on: May 11, 2013, 03:56:41 pm »

I'm splitting autoSyndrome into autoSyndrome and syndromeTrigger. The latter triggers scripts and whatnot when syndromes are added, whether they are added because of an interaction, autoSyndrome, or any other reason.

Right now it won't work with itemsyndrome, because of the way assignSyndrome is implemented. The following trivial change should allow the two to work together:

Spoiler (click to show/hide)

I just changed it so that it correctly sets the start time of the syndrome.

This would allow scripts to be triggered by item syndromes in the next version of DFHack.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #219 on: May 11, 2013, 04:06:15 pm »

Griggity biggity whoggity wizzit that's great.

Brilliand

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #220 on: June 01, 2013, 01:30:27 am »

The itemsyndrome script errors out when it tries to handle and item that doesn't have a syndrome itself, but has syndrome contaminants (as occurs with the weapon/armor rune coatings in Masterwork Mod).  Here's how I fixed it in my copy (in patch form):

Code: [Select]
diff --git a/Dwarf Fortress/hack/scripts/itemsyndrome.lua b/Dwarf Fortress/hack/scripts/itemsyndrome.lua
--- a/Dwarf Fortress/hack/scripts/itemsyndrome.lua
+++ b/Dwarf Fortress/hack/scripts/itemsyndrome.lua
@@ -138,58 +138,43 @@
     return affected
 end
 
-local function itemAffectsHauler(item_inv)
-    local item = item_inv.item
-    local syndrome = getSyndrome(getMaterial(item))
-    if not syndrome then syndrome = itemHasSyndrome(item) end
+local function itemAffectsHauler(syndrome)
     for k,v in ipairs(syndrome.syn_class) do
         if v.value=="DFHACK_AFFECTS_HAULER" then return true end
     end
     return false
 end
 
-local function itemAffectsStuckins(item_inv)
-    local item = item_inv.item
-    local syndrome = getSyndrome(getMaterial(item))
-    if not syndrome then syndrome = itemHasSyndrome(item) end
+local function itemAffectsStuckins(syndrome)
     for k,v in ipairs(syndrome.syn_class) do
         if v.value=="DFHACK_AFFECTS_STUCKIN" then return true end
     end
     return false
 end
 
-local function itemIsArmorOnly(item_inv)
-    local item = item_inv.item
-    local syndrome = getSyndrome(getMaterial(item))
-    if not syndrome then syndrome = itemHasSyndrome(item) end
+local function itemIsArmorOnly(syndrome)
     for k,v in ipairs(syndrome.syn_class) do
         if v.value=="DFHACK_ARMOR_ONLY" then return true end
     end
     return false
 end
     
-local function itemIsWieldedOnly(item_inv)
-    local item = item_inv.item
-    local syndrome = getSyndrome(getMaterial(item))
-    if not syndrome then syndrome = itemHasSyndrome(item) end
+local function itemIsWieldedOnly(syndrome)
     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 itemOnlyAffectsStuckins(item_inv)
-    local item = item_inv.item
-    local syndrome = getSyndrome(getMaterial(item))
-    if not syndrome then syndrome = itemHasSyndrome(item) end
+local function itemOnlyAffectsStuckins(syndrome)
     for k,v in ipairs(syndrome.syn_class) do
         if v.value=="DFHACK_STUCKINS_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)) or (item_inv.mode ~=7 and itemOnlyAffectsStuckins(item_inv)) then return false end
+local function itemIsInValidPosition(item_inv, syndrome)
+    if (item_inv.mode == 0 and not itemAffectsHauler(syndrome)) or (item_inv.mode == 7 and not itemAffectsStuckins(syndrome)) or (item_inv.mode ~= 2 and itemIsArmorOnly(syndrome)) or (item_inv.mode ~=1 and itemIsWieldedOnly(syndrome)) or (item_inv.mode ~=7 and itemOnlyAffectsStuckins(syndrome)) then return false end
     return true
 end
 
@@ -231,7 +216,7 @@
                     unitInventory = rememberInventory(unit)
                     transformation = true
                 end
-                if syndromeIsDfHackSyndrome(syndrome) and creatureIsAffected(unit,syndrome) and itemIsInValidPosition(item_inv) then
+                if syndromeIsDfHackSyndrome(syndrome) and creatureIsAffected(unit,syndrome) and itemIsInValidPosition(item_inv, syndrome) then
                     assignSyndrome(unit,syndrome.id)
                     syndromeApplied = true
                 end
@@ -252,7 +237,7 @@
                             unitInventory = rememberInventory(unit)
                             transformation =true
                         end
-                        if syndromeIsDfHackSyndrome(syndrome) and creatureIsAffected(unit,syndrome) and itemIsInValidPosition(item_inv) then assignSyndrome(unit,syndrome.id) end
+                        if syndromeIsDfHackSyndrome(syndrome) and creatureIsAffected(unit,syndrome) and itemIsInValidPosition(item_inv, syndrome) then assignSyndrome(unit,syndrome.id) end
                     end
                 end
             end
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #221 on: June 01, 2013, 01:49:29 pm »

yeah i kinda have no idea what to do with that >_>

Brilliand

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #222 on: June 01, 2013, 02:09:54 pm »

yeah i kinda have no idea what to do with that >_>

Lines starting with a minus are removed lines, lines starting with a plus are added lines.  Basically, I changed some functions to accept the syndrome as a parameter instead of finding it themselves (because they were finding it wrong for contaminants).  Those functions are:

itemAffectsHauler
itemAffectsStuckins
itemIsArmorOnly
itemIsWieldedOnly
itemOnlyAffectsStuckins
itemIsInValidPosition

The only one of those functions that even needs to know what the item is is itemIsInValidPosition.

Here's the whole contents of the file after I was done with it:

Spoiler (click to show/hide)

Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #223 on: June 01, 2013, 02:31:06 pm »

Okay!

Uploaded fixed version.

Just Some Guy

  • Bay Watcher
    • View Profile
Re: Putnam's DFHack modder's utilities
« Reply #224 on: June 13, 2013, 01:41:48 pm »

Can I have some help with installation? Where do I put these scripts?
Pages: 1 ... 13 14 [15] 16 17 ... 44