Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFHack building-hacks plugin, a few sugestions  (Read 2312 times)

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
DFHack building-hacks plugin, a few sugestions
« 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.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #1 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...

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #2 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.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #3 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.

Henny

  • Bay Watcher
  • Save All 300 Elves
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #4 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.
Logged
Grey langurs came over to steal something, only to be overcome by terror when they realized that they were stealing +grey langur bone gauntlets+.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #5 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 working examples here-ish...

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.

Henny

  • Bay Watcher
  • Save All 300 Elves
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #6 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 working examples here-ish...

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!
Logged
Grey langurs came over to steal something, only to be overcome by terror when they realized that they were stealing +grey langur bone gauntlets+.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #7 on: March 07, 2015, 01:31:41 pm »

Thank you for the extensions! Animal treadmills, spring capacitors, etc here I come!
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #8 on: March 15, 2015, 10:34:22 am »

Where can I find the updated documentation? (or has it not been updated yet?)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #9 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...

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack building-hacks plugin, a few sugestions
« Reply #10 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 :)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS