Results 1 to 8 of 8

Thread: How to script building limitations?

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 How to script building limitations?

    For example, is it possible to script a building so that... if a building is already present for the faction, he can't build another one? For example if my building is called English_Capital to represent the capital of a faction, obviously I only want it for one area. And if that buildling is lost he can build a new one etc...

    I think I've seen something like this happen. I'm pretty sure this require some sort of monitor_event in the campaign_script.txt, is that correct?
    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
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: How to script building limitations?

    Have an eventcounter that the building requires set from 1 to 0 on completion of the building. Then when it is not present in the faction have the eventcounter return to 1 to allow it to be built again.

    Look in the conditions docudemon for building present in faction condition.

    edit:

    And look in the events docudemon for the building completed event.
    Last edited by Taiji; April 21, 2011 at 03:44 AM. Reason: Realised late that one was an event.

  3. #3

    Default Re: How to script building limitations?

    If you want it in one settlement only then you can also give it a hidden resource so that it is only buildable in that settlement only.

  4. #4
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to script building limitations?

    Quote Originally Posted by Ishan View Post
    If you want it in one settlement only then you can also give it a hidden resource so that it is only buildable in that settlement only.
    Yeah I know this but thats not exactly what I"m trying to achieve.

    For example if your say... the Turks and have massive empire, but loses your capital, you can just rebuild it at another settlement but only if you lose your old capital etc...


    Anyway, is this how you set the monitor event condtion? for example, if I want to seperate leather tanners from armouers.. but want the armourer to check if leather tanner exist before it gives out leather armour related bonuses....

    So I put in these to campaign script...

    monitor_event SettlementSelected SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 1
    end_monitor

    monitor_event SettlementSelected not SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 0
    end_monitor
    and then for leather armour I use the line

    armour 1 requires event_counter leather_tanner 1

    But it doesn't seem to work properly :/ it still upgrades the armour even without the leather tanner building... what am I missing?
    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.....

  5. #5

    Default Re: How to script building limitations?

    Try this:-
    Code:
    monitor_event SettlementSelected TrueCondition
    and SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 1
    end_monitor
    
    monitor_event SettlementSelected TrueCondition
    and not SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 0
    end_monitor

  6. #6
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to script building limitations?

    thnx!!
    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.....

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

    Default Re: How to script building limitations?

    Events must be fired before a faction's turn if they are to have an EDB effect in that turn.

  8. #8
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: How to script building limitations?

    Quote Originally Posted by Taiji View Post
    Events must be fired before a faction's turn if they are to have an EDB effect in that turn.
    ahh... no wonder it's still weird... so you mean I should write it like..

    monitor_event FactionTurnEnd FactionIsLocal
    set_event_counter leather_tanner 1
    end_monitor

    monitor_event SettlementSelected TrueCondition
    and SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 1
    end_monitor

    monitor_event SettlementSelected TrueCondition
    and not SettlementBuildingExists >= leather_tanner
    set_event_counter leather_tanner 0
    end_monitor
    like this?

    Edit: YES! it's working now, great! though one should use FactionTurnStart instead of FactionTurnEnds
    Last edited by RollingWave; April 23, 2011 at 07:54 AM.
    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.....

Posting Permissions

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