Results 1 to 13 of 13

Thread: Condition for region character is in

Hybrid View

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

    Default Condition for region character is in

    I was wondering if there is any way to test if an army or character is in a certain region or to return the region that the army or character is in.

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

    Default Re: Condition for region character is in

    The IsRegionOneOf condition will test whether this character is in a specific region or in one of a selection of regions.

    e.g. In campaign script...
    Code:
    monitor_event CharacterTurnStart IsRegionOneOf London_Province York_Province
    
      ;this character is in London or York region... do something...
    
    end_monitor
    (No idea of those region names are correct. Just an example.)

    You could add other conditions to restrict it to a certain faction, character type, etc.

  3. #3

    Default Re: Condition for region character is in

    Thank you that is just what I was looking for!
    On a related note, is there a condition to test if a character is inside of a certain country's borders? (like it will return true if the specified character is in a region that belong's to a faction)
    Thanks again.

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

    Default Re: Condition for region character is in

    You're welcome.

    Quote Originally Posted by sandymoo View Post
    is there a condition to test if a character is inside of a certain country's borders?
    Not easily. Possibly something like this...

    Code:
    declare_counter french_within_english_borders
    
    monitor_event PreFactionTurnStart FactionType france
      set_counter french_within_english_borders 0
    end_monitor
    
    monitor_event CharacterTurnStart FactionType france
      and IsGeneral
      and IsRegionOneOf London_Province
      and I_SettlementOwner London england
    
      set_counter french_within_english_borders 1
    end_monitor
    
    monitor_event CharacterTurnStart FactionType france
      and IsGeneral
      and IsRegionOneOf York_Province
      and I_SettlementOwner York england
    
      set_counter french_within_english_borders 1
    end_monitor
    
    ... and so on for every region that you want to include...
    ...which only handles one faction (France) being in one other faction's (Engand's) borders, and even then will be lengthy if you want to include all regions on the map. I haven't used IsGeneral much; not sure if it includes regular "generals" (captains), i.e. armies without named character commanders.
    Last edited by Withwnar; March 13, 2012 at 11:05 PM.

  5. #5
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Condition for region character is in

    Nope, Is_General only works for Generals aka named characters with a character_record.
    A captain does not qualify for any of this.
    Ah and afaik PreFactionTurnStart only works in the 0 round = when you start a campaign - I might be mistaken in that one though


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  6. #6

    Default Re: Condition for region character is in

    Quote Originally Posted by Aikanár View Post
    Nope, Is_General only works for Generals aka named characters with a character_record.
    A captain does not qualify for any of this.
    Is there any condition that would work for captains then? I want to make something happen whenever there's a rebel army inside of a region you control and obviously it would work better if the condition fires whether the army has a general or not...

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

    Default Re: Condition for region character is in

    Quote Originally Posted by Aikanár View Post
    Ah and afaik PreFactionTurnStart only works in the 0 round = when you start a campaign - I might be mistaken in that one though
    It occurs (at least) before every turn for every faction.

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

    Default Re: Condition for region character is in

    Quote Originally Posted by Aikanár View Post
    Nope, Is_General only works for Generals aka named characters with a character_record.
    A captain does not qualify for any of this.
    Ah and afaik PreFactionTurnStart only works in the 0 round = when you start a campaign - I might be mistaken in that one though
    It seems that it does work - I just tried it....

    Code:
    monitor_event CharacterTurnStart FactionType milan
      and IsRegionOneOf Nan-Curunir_Province
      and IsGeneral
    
      historic_event nazgul
    
    end_monitor
    When I put a milan army led by a captain in this region then the historic event fires. Also when led by a named character. But it didn't fire for a spy.

    Perhaps you are thinking of traits/ancillaries there Aikanar. IsGeneral would appear not to work on captains in those triggers but that is due to them not being able to have traits/ancs.

    Quote Originally Posted by Taiji View Post
    It occurs (at least) before every turn for every faction.
    Yes, every turn, once per faction, before all other xxxTurnStart events for that faction. Living factions only (I think?).

  9. #9
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Condition for region character is in

    To my knowledge this is only possible for characters or agents or factions.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

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

    Default Re: Condition for region character is in

    Try this:

    declare_counter PFTS
    monitor_event PreFactionTurnStart I_TurnNumber > 0
    inc_counter PFTS 1
    end_monitor

    And you'll know how many times it fires for all factions in round 2 by checking the (trace) log for the counter

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

    Default Re: Condition for region character is in

    Once per living faction.

  12. #12
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Condition for region character is in

    See, nice to know and you never stop learning
    That's with "read it somewhere" with regards to PreFactionTurnStart
    @IsGeneral:
    Interesting, that means that captains do have a character_record, thus I was liable to a missconception of how character_record works


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

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

    Default Re: Condition for region character is in

    They have a character record that's ready to be used for 'man of the hour'. So they can gain traits from the previous battle.

Posting Permissions

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