Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Disabling Hard coded buildings: An actual working method!  (Read 9505 times)

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #15 on: July 13, 2015, 12:15:47 pm »

Finally added the full, everything working, version. I have added some significant improvements, and everything is well tested.

You will need to install the script loader linked from the first page, but otherwise usage is more-or-less the same.
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

expwnent

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #16 on: July 15, 2015, 02:41:32 am »

Posting to watch.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #17 on: July 22, 2015, 04:46:37 am »

How does this compare with eventful.removeNative?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #18 on: July 22, 2015, 09:45:39 am »

If I remember one of the previous posts, removeNative wasn't working (although I can't seem to find the post now). Also this allows adding as well as removing.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #19 on: July 22, 2015, 09:51:27 am »

removeNative removes the native jobs from the building (it's addReactionToShop that doesn't work), this library removes the ability to build the shop in the first place (or, as Roses said, you can add or move stuff too).

While talking about workshop related stuff in eventful that doesn't work, postWorkshopFillSidebarMenu does not work for furnaces (I assume the same is true of onWorkshopFillSidebarMenu, but I haven't tested it).
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

expwnent

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #20 on: July 22, 2015, 09:58:40 am »

Sweet.

Warmist wrote that bit originally but he's not very active lately so it hasn't been maintained. I'll add it to my list of things to fix.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #21 on: July 24, 2015, 02:52:26 am »

removeNative removes the native jobs from the building (it's addReactionToShop that doesn't work), this library removes the ability to build the shop in the first place (or, as Roses said, you can add or move stuff too).

While talking about workshop related stuff in eventful that doesn't work, postWorkshopFillSidebarMenu does not work for furnaces (I assume the same is true of onWorkshopFillSidebarMenu, but I haven't tested it).
Originally I intended removenative to disable shops, but did not find the way to do that.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #22 on: July 24, 2015, 10:43:37 am »

Originally I intended removenative to disable shops, but did not find the way to do that.

My code was inspired by yours! I never would have thought about modifying the menus if I hadn't seen the code in eventful that did that.
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

Roses

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #23 on: April 19, 2016, 01:15:49 pm »

So I know this thread hasn't seen a lot of action lately, but I also know that you are still active, and figured I would post in here instead of cluttering up the rubble thread.

Question, can the list of available buildings be changed during gameplay? That is to say, assume I set up a way to acquire "blueprints" for buildings, would it be possible to have the dwarfs "learn" them so that they could then build the building?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #24 on: April 20, 2016, 02:09:32 am »

So I know this thread hasn't seen a lot of action lately, but I also know that you are still active, and figured I would post in here instead of cluttering up the rubble thread.

Question, can the list of available buildings be changed during gameplay? That is to say, assume I set up a way to acquire "blueprints" for buildings, would it be possible to have the dwarfs "learn" them so that they could then build the building?
I'm not sure but i think so. I mean this might need to be modified to in principle it disables buildings each time you open the menu.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #25 on: April 20, 2016, 10:08:02 am »

A fort can definitely use a building NOT available to that civ, but only for reactions that the civ DOES have access to.  This lets you make a building only accessible by upgrade, or in my case transform the workshop based on its material.

Maybe you can include a building bunch of dummy entries in the civ (give access to the same building over and over), and switch one at runtime as the fort gets access? I have no idea how the civ raws gets held in memory, and in particular if duplicates would be culled.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #26 on: April 21, 2016, 04:08:49 pm »

What Dirst and Warmist said :P

Yes you can change buildings during play, but I can't remember if this script will remember changes across save/load (I don't think it does), so you will need to store them somewhere so you can restore the correct state.
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

Roses

  • Bay Watcher
    • View Profile
Re: Disabling Hard coded buildings: An actual working method!
« Reply #27 on: April 21, 2016, 04:21:43 pm »

What Dirst and Warmist said :P

Yes you can change buildings during play, but I can't remember if this script will remember changes across save/load (I don't think it does), so you will need to store them somewhere so you can restore the correct state.

Excellent. I can definitely store it in persistent storage.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Disabling Hard coded buildings: An actual working method!
« Reply #28 on: May 17, 2016, 07:10:42 pm »

Hey Milo,

Can this be used to remove custom workshops from the menu too?

I want to give a civ a unique reaction. I would do this by giving them a workshop with the reaction, and when they run it, it removes the workshop from the menu. This way they can only run it once. The reaction would also destroy the workshop itself.
« Last Edit: May 17, 2016, 09:31:49 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Insanegame27

  • Bay Watcher
  • Now versio- I mean, age 18. Honestly not an AI.
    • View Profile
    • Steam ID
Re: Disabling Hard coded buildings: An actual working method!
« Reply #29 on: May 17, 2016, 08:18:08 pm »

PTW
Logged
Power/metagaming RL since Birth/Born to do it.
Quote from: Second Amendment
A militia cannot function properly without arms, therefore the right of the people to keep and bear Arms, shall not be infringed.
The military cannot function without tanks and warplanes, therefore the right of the people to keep and bear tanks and warplanes, shall not be infringed.
The military cannot function without ICBMs, therefore the right of the people to keep and bear ICBMs, shall not be infringed.
Pages: 1 [2] 3