Results 1 to 8 of 8

Thread: Questions on EDB

  1. #1

    Default Questions on EDB

    I have been struggling to make an extensive building tree, and I would like to know if there are any solutions to some of the problems I've encountered.

    My first and most important problem is that I can't get my buildings to behave like temples. I have made several groups of buildings and my intent is that the player may only construct one of the buildings inside a group, just as it is with temples. I have a group of 3 buildings f.e. that contains Tavern, Workshop and Hospital. I have tried naming the buildings in EDB so that they all share a prefix such as prefix_tavern, prefix_workshop and prefix_hospital but I was still able to build all 3 of them.

    Then, I tried excluding the others by conditionals, f.e. tavern had requirements such as "not building_present workshop and not building_present hospital" (I adapted the requirements for all 3 buildings) and this worked as intended but in return the buildings stopped showing up in my in-game building browser. I can't really have that because the whole point of the building tree I'm making is to force the player to plan the city ahead.

    I am hoping someone knows a functional way of achieving this. I read a thread a while back where someone was trying to have 2 temples per city, where both the main temple and the second one offered a choice from the same variety of deities. I can't find that thread however. I would gladly name all my buildings temples in EDB if only I would get it to work.


    My second problem has made me completely rethink my original design of the building tree. I was making full use of branched levels so I could fit in more buildings. For example, I had a building containing a start level that branched to 8 possibilities for level 2 and thought I could save about 7 building slots that way but it turned out to be a useless design.

    I wanted to make other buildings require one of the 8 branches of that building but was unable to detect which branch was built exactly. The game didn't see my building as a level one and 8 different levels 2 to choose from, but 9 levels one on top of the other. So if I had a building_a that required branch_8 such as "requires building_present_min_level branch_building branch_8", building_a could be built even if branch 1, 2, 3... or 7 where built because it saw branch 8 as the next level after the base level and all the others as superior to it. If building_a required branch_2, than both branch_2 and branch_1 would satisfy the requirement because branch_1 was seen as a superior level to branch_2.

    I tried a conditional such as "requires building_present_min_level branch_building branch_8 and not building_present_min_level branch_building branch_7" since apparently branch 8 was seen as level 2 and branch 7 was seen as level 3, thinking that I could narrow it down to the exact level I was looking for but it didn't work at all. The game crashed if I remember correctly. What I would have needed was a conditional such as "building_present current_level" but that doesn't exist. Personally I suspect there is no way of doing this but if anyone has additional knowledge on this it would be very welcome.

    These are my greatest plagues regarding EDB so if anyone has any info regarding these I would greatly appreciate it.

    EDIT: I completely forgot to mention I am running vanilla RTW although I have both expansions installed. Also, I wasn't able to find answers for these problems in the EDB guide.
    Last edited by GigeliusMinimus; 05-06-2013 at 17:44.

  2. #2
    Arrogant Ashigaru Moderator Ludens's Avatar
    Join Date
    Nov 2003
    Posts
    9,058
    Blog Entries
    1

    Lightbulb Re: Questions on EDB

    Hello GigeliusMinimus,

    Quote Originally Posted by GigeliusMinimus View Post
    My first and most important problem is that I can't get my buildings to behave like temples. (...) I have a group of 3 buildings f.e. that contains Tavern, Workshop and Hospital. I have tried naming the buildings in EDB so that they all share a prefix such as prefix_tavern, prefix_workshop and prefix_hospital but I was still able to build all 3 of them.
    If I understand Aradan's building guide correctly, the game looks at the prefix of the building tree, not the buildings itself. If that doesn't work, you could use the temple entries, and change the descr files to rename them to "tavern", "workshop", etc in-game.

    Quote Originally Posted by GigeliusMinimus View Post
    Then, I tried excluding the others by conditionals, f.e. tavern had requirements such as "not building_present workshop and not building_present hospital" (I adapted the requirements for all 3 buildings) and this worked as intended but in return the buildings stopped showing up in my in-game building browser. I can't really have that because the whole point of the building tree I'm making is to force the player to plan the city ahead.
    The building browser is indeed confused by not-requirements. I know this was a problem for the Europa Barbarorum mod - they dealt with it by ignoring the building browser and making a .pdf to show the tech tree.

    Quote Originally Posted by GigeliusMinimus View Post
    I tried a conditional such as "requires building_present_min_level branch_building branch_8 and not building_present_min_level branch_building branch_7" since apparently branch 8 was seen as level 2 and branch 7 was seen as level 3, thinking that I could narrow it down to the exact level I was looking for but it didn't work at all. The game crashed if I remember correctly. What I would have needed was a conditional such as "building_present current_level" but that doesn't exist. Personally I suspect there is no way of doing this but if anyone has additional knowledge on this it would be very welcome.
    It's not listed in Aradan's guide, so I am pretty certain that such a conditional does not exist. However, the afore-mentioned EB mod does do something like that with their Roman barrack upgrades (check the Romani building tree on their website - the barracks are the right-most building tree). Maybe that would work?

    I hope this helps.
    Looking for a good read? Visit the Library!

    Member thankful for this post:



  3. #3

    Default Re: Questions on EDB

    Thank you for the info. Since the EB team did not find a seamless way of making buildings behave like temples I realize there is little chance I will succeed in this. I still have a few ideas to try but I don't expect much of them. From what I have tested so far in the case of temples the .exe applies the "only one building per group rule" to all the buildings that start with "temple_". No matter what you write after that the new building will be tied to the temple group. I haven't been able to make any other prefixes work, it seems the .exe completely ignores them. Also I can't really include my buildings in the same group as temples since building one of them would mean you couldn't build a temple. Not to mention I need several groups of buildings. I was hoping I could make new temple groups I could disguise as my buildings but I guess not.

    As long as I come up with ideas to experiment with I will keep trying and if none of them work I will have to use "not" conditionals just like in EB. I have it installed along with XC and Roma Surrectum II and I'm constantly going through their files to learn more tricks.

    As for the branch levels problem, I will leave it for later. If I can get around it somehow I could make some interesting trade buildings for my building tree but if not, it should be good enough as it is.

  4. #4

    Default Re: Questions on EDB

    I think I am on to something. Well, something worked. I managed to use the NOT conditional without the buildings disappearing from the browser. I'll explain:

    As I said, there's a group of 3 buildings and once you build one the other two should become unavailable. The buildings are Workshop, Hospital and Library. This is my first requirement design:

    The workshop has the following requirements: "requires factions { roman, } and not building_present hospital and not building_present library".
    The hospital has the following requirements: "requires factions { roman, } and not building_present workshop and not building_present library".
    The library has the following requirements: "requires factions { roman, } and not building_present workshop and not building_present hospital".

    Normally this would work but the 3 buildings would not show up in the building browser. As we know, the "not" conditional somehow confuses the building browser and it simply skips the buildings all together. This is the design I tried just now:

    The workshop has the following requirements: "requires factions { roman, } and building_present workshop or not building_present hospital and not building_present library".
    The hospital has the following requirements: "requires factions { roman, } and building_present hospital or not building_present workshop and not building_present library".
    The library has the following requirements: "requires factions { roman, } and building_present library or not building_present workshop and not building_present hospital".

    It appears that by first adding a requirement that doesn't start with "not" the building browser displays the building correctly. The first requirement is a non-sense and can never be met (the building requires it's self to be already built) but the second one is the real requirement and works as intended. The downside is that if you hover over the buildings in the browser it will show the requirements in a messy unintelligible fashion.

    This is what I've got so far. I am still a bit skeptical and expecting nasty surprises that will render this useless for my mod so if anyone is curious to test it let me know how it went. If it works like it did for me a few minutes ago it could prove to be a very useful technique for mods that involve complex building trees. I will report anything else I find on this as I use it for my buildings.

  5. #5
    Arrogant Ashigaru Moderator Ludens's Avatar
    Join Date
    Nov 2003
    Posts
    9,058
    Blog Entries
    1

    Lightbulb Re: Questions on EDB

    Thanks for letting us know. I am somewhat puzzled by the ordering of the conditionals, though. I am not sure how R:TW parses the conditionals, but the first requirment is the faction, not the presence of the workshop/hospital/library. So there are two ways this could be parsed:

    Requires: (faction Roman AND workshop) OR (not-hospital AND not-library)

    or

    Requires: faction Roman AND (workshop OR not-hospital) AND not-library

    Are you sure it works as intended?
    Looking for a good read? Visit the Library!

  6. #6

    Default Re: Questions on EDB

    The problem with the "not" conditional might come from using it in the first group of requirements linked by "and". If you create a bogus group that has no effect and doesn't contain "not", the problem seems to vanish. And even though the first group containing the non-sense requirement also contains the faction, that doesn't seem to cause problems. I tested this with other factions and my buildings hadn't become available to all like I suspected they might. They were still only available for the factions specified in the first group of requirements.

    It has worked and it continues to work for me. I have applied it to multiple groups of buildings that were supposed to work the same way as the group I mentioned above. However I use the word "seems" a lot because I like to stay skeptical until I manage to apply this trick to all my buildings and have everything working smoothly. I've learned you never know what other problems you may encounter in EBD.

    Also, I suspect the trick I came across would still work if the non-sense self-requirement in the first group would be changed with a hidden resource that isn't available in any region just so that it can't be met and only the second group of requirements, the one that actually counts will be relevant. I haven't tested this however but if it does work it could make it less confusing than a building that requires it's own presence.

    EDIT:

    I see you used brackets in your examples. I never used brackets in my requirements because I thought they didn't work. Am i wrong? (I hope so, they would be useful). The only way I've managed to create requirement groups is through "and" conditionals. As soon as you use "or" it becomes the start of an alternative requirement/group of requirements. To make my requirements more clear I think they could be reformulated as:

    For the workshop f.e.: requires factions { roman, } and building_present workshop or factions { roman, } and not building_present hospital and not building_present library

    This will only work if the "not" conditional causes problems when used in the first group of requirements like I stated earlier. If the problem actually comes from placing "and not" after "requires factions { roman, }" than the building would once again become invisible in the building browser. I will test this and report the results.
    Last edited by GigeliusMinimus; 05-08-2013 at 13:32.

  7. #7

    Default Re: Questions on EDB

    I am happy to say this requirement formula worked:

    For the workshop: requires factions { roman, } and building_present workshop or factions { roman, } and not building_present hospital and not building_present library

    Also, I tried replacing "and building_present workshop" with a hidden resource called "test", hidden resource which I haven't added to any region, and that worked as well:

    requires factions { roman, } and hidden_resource test or factions { roman, } and not building_present hospital and not building_present library

    The result is a less confusing code line and also a less confusing requirement description in the building browser. It will now tell you that the workshop requires library and hospital because it's not coded to display the "not" in front of them. It's still not seamless but at least you can see the buildings in the browser.

  8. #8
    Arrogant Ashigaru Moderator Ludens's Avatar
    Join Date
    Nov 2003
    Posts
    9,058
    Blog Entries
    1

    Lightbulb Re: Questions on EDB

    Quote Originally Posted by GigeliusMinimus View Post
    Also, I suspect the trick I came across would still work if the non-sense self-requirement in the first group would be changed with a hidden resource that isn't available in any region just so that it can't be met and only the second group of requirements, the one that actually counts will be relevant.
    That should work: the EB team uses that trick to disable recruitment of a certain unit (hidden_resource not_here).

    Quote Originally Posted by GigeliusMinimus View Post
    I see you used brackets in your examples. I never used brackets in my requirements because I thought they didn't work. Am i wrong? (I hope so, they would be useful).
    I just added them to clarify how I thought the line was parsed. I have no idea if they actually work. The R:TW scripting language is very limited; so unless brackets are used in the original data files, I would assume they don't work.

    Quote Originally Posted by GigeliusMinimus View Post
    The only way I've managed to create requirement groups is through "and" conditionals. As soon as you use "or" it becomes the start of an alternative requirement/group of requirements.
    Excellent. That is what I wanted to know.
    Looking for a good read? Visit the Library!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO