Town Upgrading system

I want to make a game where you travel through dungeons and use the gold and items you collect in them to buy buildings and upgrade a town and equipment. Like you start off by buying a guild hall that lets you go to more dungeons. Then you can choose to save up your gold to buy a shop, a blacksmith or hire more characters. Once you get the shop you can buy upgrades for your character and buildings and once you get the blacksmith you can upgrade your equipment.
OK, and where is your problem or your question?


That is possible, just a lot of work with a careful use of scripts or complex eventing.
I know I can use events to do it but i want to know if there is an easier way. i just need a system like "The Guild of Dungeoneering"
I actually have some code that work similar to that- at it's base, you'll still be using events to do the driving, but my code tracks 'quests' that occur in stages. While they're referred as quests, they function the same as quests in, say, Morrowind.

In Morrowind, when the player builds his stronghold, the data is stored in his 'journal' in phases (in the game code, stages). Each step represents progression in the Quest, and includes reminder text for the player. In turn, the game keeps track of this, and alters the state of the world and NPC interactions to reflect changes in quest stages. In the linked example above, at stage 100, the player has access to a small room housing unit they can make use of. When 200 is triggered, the player has access to the second floor (iirc). At stage 300, the stronghold is fully upgraded with towers/defenses/guards (rough guess still, haven't played in a while) and the construction quest line is finished. After that, you would trigger the next quest the player can take by advancing the stage on that one to 5 or so.

In your instance, if we use dungeon completion as a metric of time, the player can fund the construction of a building, say "Weaponsmithy", which would set the weaponsmithy quest stage to 1. After that, you can add that to a time tracking list- each time the player clears a dungeon, 1 unit of time is subtracted from the time needed to complete the building. When that hits 0, you can advance the quest stage to 2. When the player visits the building and does the tutorial, you advance the quest to 3- which signals the completion of the building or the first upgrade to the plot.
I actually have some code that work similar to that- at it's base, you'll still be using events to do the driving, but my code tracks 'quests' that occur in stages. While they're referred as quests, they function the same as quests in, say, Morrowind.

In Morrowind, when the player builds his stronghold, the data is stored in his 'journal' in phases (in the game code, stages). Each step represents progression in the Quest, and includes reminder text for the player. In turn, the game keeps track of this, and alters the state of the world and NPC interactions to reflect changes in quest stages. In the linked example above, at stage 100, the player has access to a small room housing unit they can make use of. When 200 is triggered, the player has access to the second floor (iirc). At stage 300, the stronghold is fully upgraded with towers/defenses/guards (rough guess still, haven't played in a while) and the construction quest line is finished. After that, you would trigger the next quest the player can take by advancing the stage on that one to 5 or so.

In your instance, if we use dungeon completion as a metric of time, the player can fund the construction of a building, say "Weaponsmithy", which would set the weaponsmithy quest stage to 1. After that, you can add that to a time tracking list- each time the player clears a dungeon, 1 unit of time is subtracted from the time needed to complete the building. When that hits 0, you can advance the quest stage to 2. When the player visits the building and does the tutorial, you advance the quest to 3- which signals the completion of the building or the first upgrade to the plot.

I think I understand what your saying and i guess that i could make something like that work. I just really have to think really hard.
If you don't need to use them tied to quests, you can just assign them to variables or switches. Variables offer more complexity (building levels, upgrades), while switches are simply and give you a boolean value to use (built/unbuilt). You can tie everything together easily, since variables and switches exist in global scope- so if you wanted, you can script a custom UI to do upgrades/buildings, or even read the variables from different quests/dungeons/events.

Pillars of Eternity is kinda like this, using a menu to do it.
 

Spoiler
yh46iaM.jpg

Original thread: https://forums.rpgmakerweb.com/threads/town-upgrading-system.56645/