[eINFO] Creating mutually exclusive buildings (beta 0.77)

Someone asked how we could put together mutually exclusive buildings, and they've changed a few parts in E:wom so what used to work won't be viable any longer. This is a new method that I've come up with, but it has one huge limitation: the actual mutually exclusive buildings must be completed in a single turn.

I've posted some example buildings here: http://pastebin.com/raw.php?i=EvmTb0Br 

There is also <!--comments--> in the code, which will explain what is done where and why. The example is a single level 1 merchant available from start, that unlocks a choice of 2 buildings.

 

Now, with the implementation in mind, there are two possible improvement structures that will work. But keep in mind that the actual mutually exclusive building will take only 1 turn to complete.

http://i.snag.gy/n6z9C.jpg

Also those combinations can obviously be combined or expanded as you see fit.

 

 

 

9,498 views 12 replies
Reply #1 Top

Keep in mind that, unless the choice HAS to be mutually exclusive, you can also use xml such as this

        <RequiresCityImprovements>1</RequiresCityImprovements>
        <RequiredImprovement>Air_Shrine</RequiredImprovement>
        <RequiredImprovement>Death_Shrine</RequiredImprovement>
        <RequiredImprovement>Earth_Shrine</RequiredImprovement>
        <RequiredImprovement>Fire_Shrine</RequiredImprovement>
        <RequiredImprovement>Life_Shrine</RequiredImprovement>
        <RequiredImprovement>Water_Shrine</RequiredImprovement>

for one building to require any predecessor. In the quoted example from the temple of essence, the temple would only appear if the player has any of the shrines inside city walls.

Reply #2 Top

So I just need to have the upgraded building negate the resource that allowed it to be built. That is actually quite sound in lieu of an "IS_exclusive" function. I can use this very easily. 

And can I use <RequiresCityImprovements>1</RequiresCityImprovements> in addition to the resource function to allow for forking paths I assume. I will have to test this tomorrow. 

Reply #4 Top

Quoting seanw3, reply 2
So I just need to have the upgraded building negate the resource that allowed it to be built. That is actually quite sound in lieu of an "IS_exclusive" function. I can use this very easily. 

And can I use <RequiresCityImprovements>1</RequiresCityImprovements> in addition to the resource function to allow for forking paths I assume. I will have to test this tomorrow. 

Don't forget the storage caps. I didn't write it, but it is crucial to keep a cheating AI with bonus to productions from breaking stuff. Someone else actually figured that one out in E:wom, but I can't find the post now.

Reply #5 Top

I am using resource storage. Is that all I need?

I want to start testing the dungeons today.

Reply #6 Top

Try playing around with the example. I feel everything should be clear then.

Cityhub - stores  1 X resource

Unlock buildling - produces 1 X resource per turn.

Mutually exclusive building 1: Costs 1 X resource, and builds in 1 turn. reduces production by 1 X per turn, also removes 1 X storage

Mutually exclusive building 2: Costs 1 X resource, and builds in 1 turn.  reduces production by 1 X per turn, also removes 1 X storage

 

You probably also want to make the mutually exclusive buildings not appear unless you actually have the Unlock building, see the first reply in this thread.

Reply #7 Top

I will post my results. 

Reply #8 Top

I made it the way you showed me. It worked well. In the final version I am going to want to have a tech produce the resource to upgrade. Can I set a tech to make every market start producing the resource? The idea would be to have the tech instantly upgrade all merchants when finished. They would be upgraded to start producing the level2merchant_choice_A resource. That resource is required to build one type of merchant on a faction wide scale. You have to decide which is better for the whole civilization. The opposite tech choice would give an upgrade to produce level2merchant_choice_B resource. 

 

 I want the choice to be faction wide. Either you are a Beastmaster Wizard or you are a Conjurer Wizard. I now need to make a mutually exclusive tech. Beastmaster (tech) or Conjurer (tech). I would assume, using the same logic, that I can make a tech require a resource. Otherwise I need help to figure out a way to make techs exclusive. Are exclusive techs possible?

Reply #9 Top

I can't think of any way to make techs mutually exclusive. I'll think about it. There doesn't seem to be any xml support for it, and putting unlocks inside buildings is very bad since they can be captured from enemies.

Can I ask, what is the goal with these mutually exclusive techs, broadly speaking? Perhaps we can move the content of the tech somewhere else instead.

Edit: The only way I can think of is to use one of the already existing mutually exclusive systems. That means AbilityBonus options. It could either be pre-selected from faction bonuses, or you could devise a system where your sovereign, on level-up, gets to choose between two traits which is mutually exclusive. Of course, you'll be dependant on a very random system that I know many are going to try modding. Even giving your own traits very high likelihoods may not be enough to guarantee that both appear at the next level-up. (edit: technically, you are not limited to two traits though... you can make 5-10, and hope that they aren't all the same. at least you'll have higher chance of knocking out competing mod traits)

Reply #10 Top

Can I give a tech from a quest?

 

I would like to have a option for the player to specialize his tower and dungeon with forking options in the research tree. This is apparently very complicated to do. 

Reply #11 Top

I haven't experimented at all with the actual tech tree. It's one of those things I think a modular mod should avoid meddling with.

Reply #12 Top

My plan is to use the function separate from the rest of the tree. I think it is a great place to show the user how far he has come in the story and game. Imagine a separate area above the Magic Tree with techs that describe the user's progression. 

So if I am using that, I would like to have certain techs be given under Treasure. I will test this and get back to you.