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
-
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.
-
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...
-
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.
-
Done and done.
Hopefully everything goes without any problems and it will be in the next dfhack release.
-
Excuse a dabbling modder, but where do I find info on using this plugin? I can't seem to find documentation on it.
-
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.
-
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!
-
Thank you for the extensions! Animal treadmills, spring capacitors, etc here I come!
-
Where can I find the updated documentation? (or has it not been updated yet?)
-
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...
-
It will give me a head start on making stuff to use the new version so I am ready when it hits :)