Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: milo christiansen on February 06, 2015, 05:31:58 pm

Title: DFHack building-hacks plugin, a few sugestions
Post by: milo christiansen on February 06, 2015, 05:31:58 pm
I have been using the DFHack building-hacks plugin for some time now, but there are two big issues with it.

A) There is no way to make a powered workshop that does something when it has power but also can have reaction that can be run without power.

B) While it is possible to make a building that generates power there is no way to "shut it off".

Are either of these fixable? Because I would like to make powered factories that can have adjustment reactions that can be run when they are shutdown (no power) and scripted sterling engines that only produce power if magma is nearby (just for starters).

Animal treadmills anyone? Simple to do, but only if I can stop the building from generating power when there is no animal.
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Warmist on February 07, 2015, 05:06:19 am
I have been using the DFHack building-hacks plugin for some time now, but there are two big issues with it.

A) There is no way to make a powered workshop that does something when it has power but also can have reaction that can be run without power.

B) While it is possible to make a building that generates power there is no way to "shut it off".

Are either of these fixable? Because I would like to make powered factories that can have adjustment reactions that can be run when they are shutdown (no power) and scripted sterling engines that only produce power if magma is nearby (just for starters).

Animal treadmills anyone? Simple to do, but only if I can stop the building from generating power when there is no animal.
A is a bit tricky. I'm using vanilla df vmethod: "isUnpowered" and i'm not sure how to work around that.
B I'll try to think of something...
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: milo christiansen on February 20, 2015, 11:45:57 am
For A: Would it not be possible to put a flag in the register function to specify if reactions are allowed when unpowered? That way you could have the current behavior or you could have a building that can run reactions regardless.
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Warmist on February 24, 2015, 08:41:17 am
Done and done.
Hopefully everything goes without any problems and it will be in the next dfhack release.
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Henny on February 26, 2015, 07:36:07 am
Excuse a dabbling modder, but where do I find info on using this plugin? I can't seem to find documentation on it.
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Warmist on February 26, 2015, 09:32:26 am
Excuse a dabbling modder, but where do I find info on using this plugin? I can't seem to find documentation on it.
Documentation here:  my number one used doc  (https://github.com/DFHack/dfhack/blob/master/Lua%20API.rst#building-hacks) working examples  here-ish... (https://github.com/warmist/df-mini-mods/tree/master/displayCase)

The second link explained: you can ignore init.lua (it's for mod manager) and the rest is normal df building def and a script that gets run when starting a world. The script just replaces the sidebar of that particular building with a custom one. (i should write a tutorial about this, shouldn't I?...)

It's bit unconventional because this is not "df raw modding" that people are (usually?) used to.
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Henny on February 26, 2015, 01:03:56 pm
Excuse a dabbling modder, but where do I find info on using this plugin? I can't seem to find documentation on it.
Documentation here:  my number one used doc  (https://github.com/DFHack/dfhack/blob/master/Lua%20API.rst#building-hacks) working examples  here-ish... (https://github.com/warmist/df-mini-mods/tree/master/displayCase)

The second link explained: you can ignore init.lua (it's for mod manager) and the rest is normal df building def and a script that gets run when starting a world. The script just replaces the sidebar of that particular building with a custom one. (i should write a tutorial about this, shouldn't I?...)

It's bit unconventional because this is not "df raw modding" that people are (usually?) used to.
Thank you very much!
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: milo christiansen on March 07, 2015, 01:31:41 pm
Thank you for the extensions! Animal treadmills, spring capacitors, etc here I come!
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: milo christiansen on March 15, 2015, 10:34:22 am
Where can I find the updated documentation? (or has it not been updated yet?)
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: Warmist on March 15, 2015, 12:12:00 pm
docs here: https://github.com/warmist/dfhack/blob/dev_building_hacks/Lua%20API.rst#building-hacks

The plugin itself is not yet released so there is little use for those docs...
Title: Re: DFHack building-hacks plugin, a few sugestions
Post by: milo christiansen on March 15, 2015, 02:54:44 pm
It will give me a head start on making stuff to use the new version so I am ready when it hits :)