Results 1 to 7 of 7

Thread: Is it possible to make a building require a resource?

Hybrid View

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

    Default Is it possible to make a building require a resource?

    Say I wanted to make certain settlements pernamently stay as villages/towns/etc. So only cities with the resource is able to upgrade to large city/fortress/etc.

    And I imagine I would have to make some changes to avoid rebellion/massive squalor.

    EDIT: Gah, i just realized this is the tutorial section and not the ask questions section. So would a mod kindly move this to the correct section?
    Last edited by sumaznguy; July 14, 2009 at 10:11 PM.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Is it possible to make a building require a resource?

    You can use a hidden_resource in the EDB as requirement for a certain level of wall.
    There is a maximum level of population for each wall level, beyond that it will not increase, no matter what.










  3. #3
    EarendilElenthol's Avatar Artifex
    Join Date
    Apr 2008
    Location
    The Netherlands
    Posts
    998

    Default Re: Is it possible to make a building require a resource?

    It is possible, in fact, I am implementing it myself now. You can use two ways, first a resource (like gold) and second a hidden_resource (in the EDB). It depends on what is easier for you, or from which you use all the slots.

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

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

    Default Re: Is it possible to make a building require a resource?

    Moved to Workshop->Text Editing & Scripting. If you aren't posting a tool, tutorial or resource please do not create a thread in tutorial section of the workshop.
    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

  5. #5
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Is it possible to make a building require a resource?

    For reference, here is the EDB entry for mines which shows how you use resources(scroll right):
    Code:
    building hinterland_mines
    {
        convert_to hinterland_castle_mines
        levels mines mines+1 
        {
            mines city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }  and resource silver or resource gold or resource tin or resource iron or resource sulfur or resource marble or resource coal
            {
                convert_to 0
                capability
                {
                    mine_resource 4
                }
                material wooden
                construction  2 
                cost  2000 
                settlement_min large_town
                upgrades
                {
                    mines+1
                }
            }
            mines+1 city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }  and resource silver or resource gold or resource tin or resource iron or resource sulfur or resource marble or resource coal
            {
                convert_to 1
                capability
                {
                    mine_resource 7
                }
                material wooden
                construction  3 
                cost  3500 
                settlement_min city
                upgrades
                {
                }
            }
        }
        plugins 
        {
        }
    }
    I don't recall vanilla examples of hidden resources, but it's essentially the same thing except with hidden_ in front and you have to define it at the top of the file in this list:
    Code:
    hidden_resources sparta rome italy america atlantic explorers_guild swordsmiths_guild etc. etc. your_resource

  6. #6
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Is it possible to make a building require a resource?

    There is a third way to do this.

    Code:
    monitor_event SettlementTurnEnd TrueCondition
        and SettlementBuildingExists blah blah
        set_event_counter building_exists 1
    end_monitor
    Any settlement that has the building will process the counter.


    Then reset the counter for the start of every settlement:

    Code:
    monitor_event SettlementTurnStart TrueCondition
        set_event_counter building_exists 0
    end_monitor
    Require the event_counter in the EDB file. You can even use this to set different bonus levels. See this script for an idea how that works. That one is based on leader authority, but you can base it on anything as long as you get the processing order correct.

  7. #7
    EarendilElenthol's Avatar Artifex
    Join Date
    Apr 2008
    Location
    The Netherlands
    Posts
    998

    Default Re: Is it possible to make a building require a resource?

    Thanks for this way, I posted alreasy in that thread. Thanks again for pointing out!!

Posting Permissions

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