Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 178 179 [180] 181 182 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 892736 times)

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2685 on: November 15, 2020, 12:41:27 am »

We've only included timestream.lua since 0.47.04-r3, which is currently the latest version. It is a heavily modified version of a script originally by IndigoFenix, though - were you using that? I didn't think it worked in 0.47.04 as-is. If not, where did you get timestream.lua from previously?

We could try adding that feature, but since I'm not aware of it being intentionally removed, I'm not really sure where to look. Are you asking for something like "-rate 0.25" to work? From looking through the code briefly, I think that should work as-is (at least, I don't see anything actively preventing it from working).
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2686 on: November 16, 2020, 11:21:48 am »

We've only included timestream.lua since 0.47.04-r3, which is currently the latest version. It is a heavily modified version of a script originally by IndigoFenix, though - were you using that? I didn't think it worked in 0.47.04 as-is. If not, where did you get timestream.lua from previously?

We could try adding that feature, but since I'm not aware of it being intentionally removed, I'm not really sure where to look. Are you asking for something like "-rate 0.25" to work? From looking through the code briefly, I think that should work as-is (at least, I don't see anything actively preventing it from working).
ok so I thought timestream was something that mess with the calendar for loading in fort mode or adventure mode but yeah good to see someone legit uses it... but it is in my copy of r3.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Luckyowl

  • Bay Watcher
    • View Profile
    • https://imgur.com/a/Bjjtz.png
Re: DFHack 0.47.04-r3
« Reply #2687 on: November 16, 2020, 02:31:58 pm »

Hi guys, I want to know if it's possible to give an armor attributes boost using the item-tigger mod tool?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2688 on: November 16, 2020, 05:35:15 pm »

ok so I thought timestream was something that mess with the calendar for loading in fort mode or adventure mode but yeah good to see someone legit uses it... but it is in my copy of r3.

Yes, it's part of 0.47.04-r3, but so far, DFHack has only included it in that version, hence my confusion. To my knowledge, the version we've included is an updated and fixed version of an older script that didn't work in 0.47, so in order to address Evans' feedback (i.e. "why did you remove X, can you please re-add it"), I would need to know where the version of the script that Evans was previously using came from.

Hi guys, I want to know if it's possible to give an armor attributes boost using the item-tigger mod tool?
modtools/item-trigger, right? I've never used it, but it does appear to make the ID of the defending unit available (as \\DEFENDER_ID), so you could probably adjust the defending unit's armor on the fly. Perhaps it would be easier to adjust armor attributes beforehand, though.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Luckyowl

  • Bay Watcher
    • View Profile
    • https://imgur.com/a/Bjjtz.png
Re: DFHack 0.47.04-r3
« Reply #2689 on: November 16, 2020, 06:20:54 pm »


Hi guys, I want to know if it's possible to give an armor attributes boost using the item-tigger mod tool?
modtools/item-trigger, right? I've never used it, but it does appear to make the ID of the defending unit available (as \\DEFENDER_ID), so you could probably adjust the defending unit's armor on the fly. Perhaps it would be easier to adjust armor attributes beforehand, though.

Thank you for replying! Can you tell me how I can adjust armor attributes beforehand?
Logged

Uthimienure

  • Bay Watcher
  • O frabjous day!!
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2690 on: November 16, 2020, 06:53:08 pm »

You can adjust values in:

DF folder/raw/objects/item_armor.txt

But to make it apply to an in-progress game, you have to also make the changes in the same raw file of the saved game.
I'm assuming the changes would only apply to newly created armor, but not sure on that.
Logged
FPS in Gravearmor (925+ dwarves) is 2-5 (v0.47.05 lives on).
"I've never really had issues with the old DF interface (I mean, I loved even 'umkh'!)" ... brewer bob
As we say in France: "ah, l'amour toujours l'amour"... François D.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2691 on: November 16, 2020, 06:55:38 pm »

Thank you for replying! Can you tell me how I can adjust armor attributes beforehand?
Well, it depends on what you want to do. I was thinking just modifying the raws would work for some changes to armor, if you want them to always be in effect. I'm also not very familiar with how the combat system works in general, so other people might have better ideas.

Edit: thanks, Uthimienure!
My understanding is that modifying some traits in the save-specific raws would affect all matching items in-game, but some (e.g. the initial state of certain values) would only apply to new items. Adding new items wouldn't work in an existing world, though - this thread in the modding forum goes into some detail about it.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Luckyowl

  • Bay Watcher
    • View Profile
    • https://imgur.com/a/Bjjtz.png
Re: DFHack 0.47.04-r3
« Reply #2692 on: November 16, 2020, 07:06:17 pm »

You can adjust values in:

DF folder/raw/objects/item_armor.txt

But to make it apply to an in-progress game, you have to also make the changes in the same raw file of the saved game.
I'm assuming the changes would only apply to newly created armor, but not sure on that.


Oh no, What I want to do is to give an armor an effect only when the armor is worn. Like for example: If unit_1 has a tier 1 attribute and if unit_1 equips an armor that gives 1+ to atribute then Unit_1 now has a tier 2 attribute. That's what I'm trying to do. But I can't find any threads about this and to be honest the DFhack Lua doc overwhelms me with vast possibilities.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2693 on: November 16, 2020, 07:17:33 pm »

Oh, so you're probably more interested in detecting when a unit puts on a piece of armor, then. From what I can gather from the docs, something like this might help:

Code: [Select]
modtools/item-trigger -onEquip Worn -itemType ARMOR -command [ my-script \\ITEM_ID \\UNIT_ID ]

This would rely on a separate my-script.lua that you write, which would receive an item ID and unit ID as arguments, and could use df.item.find() and df.unit.find() to obtain references to the items/units themselves. (From that point, I don't know exactly how you'd check or adjust the traits you're interested in off the top of my head.)
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Luckyowl

  • Bay Watcher
    • View Profile
    • https://imgur.com/a/Bjjtz.png
Re: DFHack 0.47.04-r3
« Reply #2694 on: November 16, 2020, 08:10:13 pm »

Oh, so you're probably more interested in detecting when a unit puts on a piece of armor, then. From what I can gather from the docs, something like this might help:

Code: [Select]
modtools/item-trigger -onEquip Worn -itemType ARMOR -command [ my-script \\ITEM_ID \\UNIT_ID ]

This would rely on a separate my-script.lua that you write, which would receive an item ID and unit ID as arguments, and could use df.item.find() and df.unit.find() to obtain references to the items/units themselves. (From that point, I don't know exactly how you'd check or adjust the traits you're interested in off the top of my head.)

ah! thank you, quick question, what do I put in  df.item.find() and df.unit.find()? do I do something like this?

df.item.find(ITEM_ARMOR_HELM)?
 
Logged

Luckyowl

  • Bay Watcher
    • View Profile
    • https://imgur.com/a/Bjjtz.png
Re: DFHack 0.47.04-r3
« Reply #2695 on: November 16, 2020, 08:22:58 pm »

Spoiler (click to show/hide)

would something like this work?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2696 on: November 16, 2020, 09:22:00 pm »

find() takes the ID, which would be passed to my-script.lua by the modtools/item-trigger command when a matching event occurs. You wouldn't need to check for "onEquip" in the script itself - armorType couldn't be equal to "ITEM_ARMOR_HELM" and "onEquip" at the same time, and modtools/item-trigger would already only run your custom script for equip events of the "Worn" mode.

I guess I was thinking something along these lines for my-script.lua (which can be renamed, of course):
Code: [Select]
local args = ...
local item = df.item.find(args[1])
local unit = df.unit.find(args[2])
-- do stuff with unit, item

I'm not sure if there are any existing examples for what you want to do - have you written a Lua script before? If not, https://www.lua.org/start.html has some resources that might be useful for Lua in general.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

MC

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2697 on: November 17, 2020, 11:08:06 am »

Question about the family affairs plugin, was there some specific reason it was limited to fortress mode? As far as I can tell virtually none of the checks it runs to see if someone is eligible for marriage actually matter (from a "not crashing the game" sense at least, I get that filtering out hostiles, children, and the insane help prevent accidentally sticking yourself with unproductive relationships). Is there some adv mode specific weirdness I'm missing?
Logged
This is a terrible mod. All crashmanship is of the highest quality. This object is adorned with hanging rings of notification spam. This object menaces with spikes of llama wool. On the item is an image of a large oval dwarf flesh cabochan in elf bone. The artwork relates to the attack of an unknown creature on an unknown creature in a time before time. It was inevitable.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2698 on: November 17, 2020, 05:26:59 pm »

Question about the family affairs plugin, was there some specific reason it was limited to fortress mode? As far as I can tell virtually none of the checks it runs to see if someone is eligible for marriage actually matter (from a "not crashing the game" sense at least, I get that filtering out hostiles, children, and the insane help prevent accidentally sticking yourself with unproductive relationships). Is there some adv mode specific weirdness I'm missing?
Apart from adventurers being a special kind of asexual?
Logged

MC

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r3
« Reply #2699 on: November 17, 2020, 05:48:52 pm »

I mean it doesn't have to target the adventurer does it? I was just wondering if there was some weird crash with unloading sites or something that I was missing. I don't think family affairs even cares about orientation all that much anyways.
Logged
This is a terrible mod. All crashmanship is of the highest quality. This object is adorned with hanging rings of notification spam. This object menaces with spikes of llama wool. On the item is an image of a large oval dwarf flesh cabochan in elf bone. The artwork relates to the attack of an unknown creature on an unknown creature in a time before time. It was inevitable.
Pages: 1 ... 178 179 [180] 181 182 ... 244