Page 2 of 2 FirstFirst 12
Results 31 to 44 of 44

Thread: Complex conditionals for recruiting and building

  1. #31
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Complex conditionals for recruiting and building

    Depends how it's parsed. If it's simple left-to-right parsing, what you'd want is "requires buildingalpha or buildingbeta and factions { x, y, }", because it would get parsed "requires ((buildingalpha or buildingbeta) and factions { x, y, })". It could also be right-to-left, in which case you'd want "requires factions { x, y, } and buildingalpha or buildingbeta" = "requires (factions { x, y, } and (buildingalpha or buildingbeta))". If it's using some other kind of parsing, God only knows.

    You'll have to try it out for yourself, really. And post the results here.
    TWC Administrator

    MediaWiki Developer

  2. #32

    Default Re: Complex conditionals for recruiting and building

    Well I just tried out:

    requires factions { x, y, } and buildingalpha or { z, } and buildingbeta

    and the second part seems to work right now. But it ignores the restriction on the first part when I add that.

    When I said:

    requires factions { x, y, } and buildingalpha or factions { z, } and buildingbeta

    the first part worked but the second part was totally ignored. Gah.

  3. #33

    Default Re: Complex conditionals for recruiting and building

    Aha. I found a way to get a second set of factions into a requirement line in constructing a building, but it still isn't nearly what I would like. The "or" apparently will keep two things together, so this would work:

    buildingalpha requires factions { greek_cities, romans_brutii, } or factions { parthia, } and building_present_min_level hinterland_roads roads

    I had been unable to get any second grouping of factions to work. So one set can have no requirements, while the second set has some. But this doesn't do a lot, as I was wanting to have different sets for multiple different factions. If anyone has any idea how to achieve this, please let me know. But the above appears to work. The first two factions have no requirements, and work immediately, but the last one, parthia, has to have roads built first before it will be buildable. But once they are constructed you could build it.

    (It appears as if someone else in EB figured it out too, earlier. Probably Angadil, but not sure. But I see this same structure used in another building's requirements that I hadn't seen before.)

  4. #34
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Complex conditionals for recruiting and building

    This would suggest that the requirements are parsed right-to-left, although it's not certain. If that is indeed the case, I suspect what you want would be unattainable.
    TWC Administrator

    MediaWiki Developer

  5. #35

    Default Re: Complex conditionals for recruiting and building

    I noticed a weird outcome.

    When I put the "and not building_present" (or the "and not hidden_resource") condition for a building, the building tree is affected in ALL settlements.

    Lets say I put a "not hidden_resource" condition to build a market, the markets disappears in ALL settlements building tech tree.

    The condition works perfecltyperfectlyperfectperfectaperfectoperfectsperfectasperfectedperfecterperfectosperfectersperfe ctingperfectionperfectibleperfectionsperfectness - the market is buildable where the hidden resource is not present and cannot be built where the hidden resource is present, but the catalog of available buildings is impaired everywhere the same, no matter if the condition is satisfied or not.

    On the contrary, if I put a "and building_present" (or "and hidden_resource"), tech tree is correctly affected - the market disappears - only where the resource is not present.

    Is it just me or it happens to everyone?

  6. #36

    Default Re: Complex conditionals for recruiting and building

    Did u try using the _min_level variation (of course using the first level as parametre)?

    Never happened to me/fatw anyway, at least with "not hidden_resource". Can't remember an instance with the other atm.
    Last edited by Aradan; 04-30-2008 at 00:31.

    Norman Invasion - The fate of England lies in your hands...

    Viking Invasion II - Unite Britain in the best TW campaign ever!

    Gods and Fighting Men: Total War - Enter the Mists of Myth in Ancient Ireland

  7. #37

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by Aradan
    Did u try using the _min_level variation (of course using the first level as parametre)?

    Never happened to me/fatw anyway, at least with "not hidden_resource". Can't remember an instance with the other atm.
    Mmm can you check it please to be sure?
    I made lots of tentatives, changing the buildings involved, the resource, the faction, and I always have that same outcome.

    Be sure to check the building catalog tree of the settlement, because its only there that it can be noticed: the building conditions works in the game, you see the icon of the new level to build. Its just if you check the tree that you see its not there.

    Mmm let me post a few screens.

    CONDITION:
    red_eye1 requires factions { romans_julii, } and not hidden_resource barad_dur

    OUTCOME:

    >> CITY WITH RESOURCE:
    Correclty, not shown and not able to be built.



    tech tree:
    Correctly, not shown.



    >> CITY WITHOUT RESOURCE:
    Correclty, shown and able to be built.



    tech tree:
    NOT CORRECTLY, NOT SHOWN





    CONDITION:
    red_eye1 requires factions { romans_julii, } and hidden_resource barad_dur

    OUTCOME:

    >> CITY WITH RESOURCE:
    Correclty, shown and able to be built.



    tech tree:
    Correclty, shown.



    >> CITY WITHOUT RESOURCE:

    Correclty, not shown and not able to be built.



    tech tree:
    Correclty, not shown.


  8. #38
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Complex conditionals for recruiting and building

    I'm fairly sure I had same issue (actually thought it was a known factor) - I know I wrote some of the building conditionals for Eod2 the very long way round by listing 'and or' all the positive ones when I was just trying to exclude one area.

    The 'and not' condition for buildings is anyway known to mess up which culture the building turns up as, in EDB guide.
    Note 1: Not conditionals (even if true) and positive conditionals that result false seem to break the culture/faction for the slave faction if those buildings are placed at game start - see this thread: https://forums.totalwar.org/vb/showthread.php?t=81322
    Last edited by Makanyane; 04-30-2008 at 07:40.
    Not used mods before? Looking for something small and fun?!
    Download the:

  9. #39

    Default Re: Complex conditionals for recruiting and building

    My noob-ness strikes again - and a loss of memory apparently.

    Yeah, checked it and you're right. We simply don't have such buildings viewable on the BB anyway, because they are either available on village level or they are branches of multiple-choice trees. Sorry for the above post - though Dol's perfect coding is to blame actually, not a single oversight in his EDB. :)
    Last edited by Aradan; 04-30-2008 at 11:24.

    Norman Invasion - The fate of England lies in your hands...

    Viking Invasion II - Unite Britain in the best TW campaign ever!

    Gods and Fighting Men: Total War - Enter the Mists of Myth in Ancient Ireland

  10. #40
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Complex conditionals for recruiting and building

    You need to reverse the thinking to make it a postive; this is why mods have such hidden resources as not_road etc.

    This is a known issue.
    "One of the most sophisticated Total War mods ever developed..."

  11. #41

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by Dol Guldur
    You need to reverse the thinking to make it a postive; this is why mods have such hidden resources as not_road etc.

    This is a known issue.
    Glad to see Its not my mistake then :)

    Yes making it positive was my first idea, but seems not appliable to my nedds.

    That is: the goal is to make such building availabe in all settlements BUT one. That will mean to add that hidden resource to all regions fo the game but one.

    Moreover, there are such unique temple buildings for EACH culture, so I'd need one hidden resource for ALL cultures added to ALL buildings but the one they don't have to build that temple - and for each culture the "free" region is different.

    In facts, making it positive would mean to add 14 new resources to more then 80 regions... sounds a bit too complex to limit a building :(

    O well, I'll think some workaround for that... maybe I'll put a undestructable placeholder in the building slot so to prevent it. That will leave the tech tree there but sounds better then removing it from all the settlements.

  12. #42

    Default Re: Complex conditionals for recruiting and building

    I know it's a bit late, but I thought it would worth telling about another way around the "not" conditional.

    As stated above coding a building like so:

    Code:
    building requires factions {whatever, } and not hidden_resource x
    will cause that building to never appear in the tech tree.

    However, this coding, where "never" is a HR that does not appear in any region:

    Code:
    building requires factions {whatever, } and hidden_resource never or not hidden_resource x
    will correctly show the building in regions without hidden resource x, but not in regions with it.
    Last edited by CaesarVincens; 08-18-2009 at 18:48.

    Expand your borders, a mod based on XGM 5.

  13. #43
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Complex conditionals for recruiting and building

    Did you miss out an "or"?
    "One of the most sophisticated Total War mods ever developed..."

  14. #44

    Default Re: Complex conditionals for recruiting and building

    Quote Originally Posted by Dol Guldur View Post
    Did you miss out an "or"?
    No


    Thanks for catching that.

    Expand your borders, a mod based on XGM 5.

Page 2 of 2 FirstFirst 12

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