Results 1 to 4 of 4

Thread: question about setting up scripts for capitals

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default question about setting up scripts for capitals

    Hello folks, I'm trying to design a event monitor so that certain units or agents can be built simply by being the capital city, for example... diplomats. isn't it kinda abusrd that a faction can't build a diplomat in some situation if it doesn't have a certain building?

    So for example, I try to do this in the EDB, putting these lines in all the core_buildings

    agent diplomat 0 requires factions { all, } and event_counter is_capital 1
    agent spy 0 requires factions { all, } and event_counter is_capital 1

    agent_limit spy 1
    agent_limit diplomat 1
    and then I try to setup an event counter... but I'm failing to see how to do that, there isn't any trigger that precisely defines capital, the only onces I'm seeing that have any relevant connection is FactionNewCapital (which isn't what I need) and CapitalDistance ... which seem to be the closest approixmation , but my test seem to reveal that it only works for charactors... or maybe i'm doing it wrong, this is my script so far


    monitor_event FactionTurnStart FactionIsLocal
    set_event_counter is_capital 1
    end_monitor

    monitor_event SettlementSelected TrueCondition
    and not DistanceCapital >= 1
    set_event_counter is_capital 1
    end_monitor

    monitor_event SettlementSelected TrueCondition
    and DistanceCapital >= 1
    set_event_counter is_capital 0
    end_monitor
    Any ideas? I seem to recall some other folks having done something like this, but a search isn't showing much results
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

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

    Default Re: question about setting up scripts for capitals

    Counters are global, not specific to a settlement. "is_capital" isn't going to help you here. All it will indicate is that a settlement is the capital... it will always be 1.

    What you could do, perhaps, is use script to build an indestructible building in the capital - and destroy it and build it elsewhere when the capital changes - and use that building for recruiting these agents.

    But you still need to find the capital. Another thread is asking the same thing here: http://www.twcenter.net/forums/showthread.php?t=524769

  3. #3
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: question about setting up scripts for capitals

    It's an AoR so you can use resources.
    Last edited by Taiji; February 28, 2012 at 01:25 AM.

  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: question about setting up scripts for capitals

    You can do by script if you have one event_counter per settlement per faction (very big and long) then you'd be able to know which settlement for each faction is the capital. The indestructible building option might be easier.
    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

Posting Permissions

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