Results 1 to 8 of 8

Thread: Questions on EDB

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    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.

  2. #2

    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.

  3. #3
    Arrogant Ashigaru Moderator Ludens's Avatar
    Join Date
    Nov 2003
    Posts
    9,065
    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