Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Call DFHack function when a specific building is created  (Read 392 times)

bloop_bleep

  • Bay Watcher
    • View Profile
Call DFHack function when a specific building is created
« on: February 27, 2017, 02:34:06 am »

Is there a way to do what the title says? Thanks.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Call DFHack function when a specific building is created
« Reply #1 on: February 28, 2017, 02:17:53 pm »

Probably. Look at the code for the soundsense script, I think it adds extra messages for completed buildings.

(the script in question is packaged together with soundsense last time I knew)
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

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Call DFHack function when a specific building is created
« Reply #2 on: February 28, 2017, 10:24:49 pm »

Woah there! There's like 50 files in that folder, and the ones with "Building" in their name don't seem to have the code I'm interested in.
Ah, what the hell, I should stop being an elf and just loop through all the buildings again each tick. Come to think of it, I have to do something else for buildings of that type that were already created, so there's less processor cycles wasted.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.