Page 1 of 3 123 LastLast
Results 1 to 20 of 54

Thread: Buildings and AoR

  1. #1

    Default Buildings and AoR

    So here is my problem. I've done an unit AoR for my mod, using the region-area method, so that every region has an unique ID.

    I've tried doing the same with the buildings, but it seems that it does not work :

    Here is the code
    Code:
    		c_bowyer city requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and building_present_min_level core_building wooden_pallisade or requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and hidden_resource Arnor and not hidden_resource HiddenC and not hidden_resource HiddenI and not hidden_resource HiddenH or requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and hidden_resource Miniriath and hidden_resource HiddenG or requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and hidden_resource Miniriath and hidden_resource HiddenI or requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and hidden_resource Miniriath and hidden_resource HiddenJ or requires factions { sicily, milan, scotland, turks, byzantium, spain, venice, england, france, hre, portugal, egypt, mongols, moors, denmark, poland, russia, ireland, saxons, normans, aztecs, timurids, hungary, teutonic_order, norway, united, khand, } and hidden_resource LastRegion and hidden_resource HiddenG
    When I silence the end of the code, before the second or requires faction, I cannot built bowyers in village. But when I use the second part of the condition, I can built bowyers in every village

    If there is no solution to this, is it possible to make buildings alvailable by asking an unique building level (and not an min level)

  2. #2
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Buildings and AoR

    I suspect the 2nd "requires" is not needed.

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Buildings and AoR

    I believe there is a simple 'building_present' as a condition. At least it is right after the min_level entry in the EXE and it's not a script command. It has obvious draw backs if other, higher building levels exist.










  4. #4

    Default Re: Buildings and AoR

    I've tested many thing, and is still does not work

  5. #5
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Buildings and AoR

    Yikes. Kiliç's right about the requires: there should be only one. It is not part of the "factions" condition, it is part of the level entry: "this level requires all the following conditions".

    Another problem is the mixing of ANDs and ORs. It looks to me like you're trying to say something like...

    (conditionA AND conditionB) OR (conditionC AND conditionD) OR ... and so on

    But that is not how the engine reads it. There are so many ANDs and ORs that I doubt that it's possible to write it 'correctly'. Such a complicated set of conditions would make it a prime candidate for a single new hidden resource instead. Though I'm guessing that you have no room left to add one?

    By the way, using simply "factions { all, }" (or leaving it out altogether) will reduce the size a LOT but this will include factions that your list might have purposely left out, e.g. slave.

    is it possible to make buildings alvailable by asking an unique building level (and not an min level)
    Do you mean, for example, buildable if the settlement has stone_wall walls and only those walls - nothing higher, nothing lower?

    I would say that this would do it...

    c_bowyer city requires factions { whatever, } and building_present_min_level core_building stone_wall and not building_present_min_level core_building large_stone_wall

    i.e. >= stone_wall and < large_stone_wall = stone_wall

    I believe there is a simple 'building_present' as a condition
    Pretty sure that takes a tree as the parameter, i.e. is any level of this tree present here?
    Last edited by Withwnar; November 22, 2013 at 10:58 PM.

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Buildings and AoR

    Pretty sure that takes a tree as the parameter, i.e. is any level of this tree present here?
    Unfortunately the only info I have is it's presence in the EXE, right after the min_level entry. I haven't tested it - so it could simply the level name without the tree name. Or it's a dud...










  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Buildings and AoR

    I can't remember if I've used it myself. I dug up the place I read about it (link) - a RTW tutorial.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Buildings and AoR

    Ah yes: "building_present (as building_present_min_level except that it tests for the building type only - e.g. building_present barracks)"

    That would give it a 50\50 chance of working (or being a 'leftover'). In the required circumstances it wouldn't work as desired unless that tree had only one level, your solution of > and < should do the job.

    While there I had a look at the plug-in tut which I had in the back of my mind for dealing with this requirement. Workable, but not very satisfactory in these circumstances.
    Last edited by Gigantus; November 22, 2013 at 10:36 AM.










  9. #9

    Default Re: Buildings and AoR

    I've made a test building

    Code:
    building test
    {
    	levels test1
    	{
    		test1 requires factions { turks, } and hidden_resource
    		{
    			capability
    			{
    			}
    			material wooden
    			construction  1
    			cost  1
    			settlement_min village
    			upgrades
    			{
    			}
    		}
    	}
    	plugins 
    	{
    	}
    }
    ,

    I try like this :

    Code:
    		test1 requires factions { turks, } and { hidden_resource Arnor and hidden_resource HiddenE } or { hidden_resource NorthEriador and hidden_resource HiddenG }
    , nothing
    Last edited by Arandir Tur-Anion de Bodemloze; November 22, 2013 at 10:56 AM.

  10. #10
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Buildings and AoR

    You can't use brackets like that.

    EDIT: the red brackets are not allowed...

    Code:
    test1 requires factions { turks, } and { hidden_resource Arnor and hidden_resource HiddenE } or { hidden_resource NorthEriador and hidden_resource HiddenG }
    Last edited by Withwnar; November 22, 2013 at 11:07 AM.

  11. #11

    Default Re: Buildings and AoR

    I know, but was is strange is that I did not get an error.
    We still do not know how to test the presene of a building in game ?

  12. #12
    Vipman's Avatar Protector Domesticus
    Join Date
    Jul 2010
    Location
    Romania
    Posts
    4,405

    Default Re: Buildings and AoR

    Quote Originally Posted by Withwnar View Post
    c_bowyer city requires factions { whatever, } and building_present_min_level core_building stone_wall and not building_present_min_level core_building huge_stone_wall

    i.e. >= stone_wall and < huge_stone_wall = stone_wall
    I think you mean large stone wall instead of huge one right?

    BTW can someone please confirm me or not that the game always reads buildings like this and that no other combination works?

    requires factions { ... } AND { condition1 OR condition2 OR condition3 } AND {condition4 OR condition5} AND condition6 AND { any of the previous examples}

    (the brackets are there just to point out what I mean)

    In other words, there can never be: {condition1 and condition2} or condition3
    Last edited by Vipman; November 22, 2013 at 12:32 PM.

  13. #13

    Default Re: Buildings and AoR

    Quote Originally Posted by Gigantus View Post
    Unfortunately the only info I have is it's presence in the EXE, right after the min_level entry. I haven't tested it - so it could simply the level name without the tree name. Or it's a dud...
    I've tested it, you need a settlement tree

  14. #14
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: Buildings and AoR

    Move the conditions to the upgrade section of the previous level of the building. To make the "first" level have a complex conditional consider having a dummy first level that exist in all relevant settlements.

    Each "or" piece gets its own line, since you can duplicate upgrade levels.
    Last edited by Squid; November 22, 2013 at 04:50 PM.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  15. #15

    Default Re: Buildings and AoR

    So you mean something like that :
    Code:
    upgrades
    {
    next_level requires condition
    next_level requires other conditions
    }
    Does that work ?

  16. #16
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Buildings and AoR

    Rome mod but you can unzip it in a temp folder for viewing. http://www.twcenter.net/forums/forum...f-Persia-(ROP)

    They were putting together a AOR when I still had Rome installed.

  17. #17

    Default Re: Buildings and AoR

    Code:
    building testaor
    {
    	levels testaor1 plugin1
    	{
    		testaor1 requires factions { all, }
    		{
    			capability
    			{
    			}
    			material wooden
    			construction 1
    			cost 1
    			settlement_min village
    			upgrades
    			{
    			plugin1 requires factions { all, } and hidden_resource Arnor and hidden_resource HiddenE
    			}
    		}
    		plugin1
    		{
    			capability
    			{
    			}
    			material wooden
    			construction 1
    			cost 1
    			settlement_min village
    			upgrades
    			{
    			}
    		}
    	}
    	plugins
    	{
    	}
    }
    I tried this and it seems to work. Thanks for that Squid

  18. #18
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Buildings and AoR

    Quote Originally Posted by Vipman View Post
    I think you mean large stone wall instead of huge one right?
    You are right. Edited.

    Quote Originally Posted by Vipman View Post
    BTW can someone please confirm me or not that the game always reads buildings like this and that no other combination works?

    requires factions { ... } AND { condition1 OR condition2 OR condition3 } AND {condition4 OR condition5} AND condition6 AND { any of the previous examples}

    (the brackets are there just to point out what I mean)
    As far as I know the conditions are read from right to left, with each next condition (to the left) AND'd/OR'd with the result so far.
    Code:
    condition1 and condition2 or condition3
    is read as
    Code:
    (condition3 or condition2) and condition1
    Code:
    condition1 and condition2 or condition3 and condition4
    is read as
    Code:
    ((condition4 and condition 3) or condition2) and condition1
    This conclusion is based on something I read once and seems to be right from my experiences so far.

    Quote Originally Posted by Vipman View Post
    In other words, there can never be: {condition1 and condition2} or condition3
    It would work when written as:
    condition3 or condition1 and condition2

    The more ANDs and ORs there are the more difficult it is to arrange it into a form that works. Some combinations would be impossible I'd say.

  19. #19
    Vipman's Avatar Protector Domesticus
    Join Date
    Jul 2010
    Location
    Romania
    Posts
    4,405

    Default Re: Buildings and AoR

    From right to left? Now that's weird. But at least it allows for more combinations than what I thought is possible, thank you for the information.

  20. #20

    Default Re: Buildings and AoR

    Is there any solution to this?

    so far I can achieve
    I can do;
    library requires factions { france, england, } or factions { denmark, } and building_present_min_level barracks militia_drill_square
    but not make france/england require a market and denmark a barracks to build the library
    testing that seemed to give me france/england can build it, but denmark needs the barracks first, using the building_present condition seemed to mess things up more than using hidden resources, which I thought I'd managed to get to behave for the and/or's previously... probably need to go back and re-test!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •