Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: FactionIsLocal vs IsFactionAIControlled

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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,681
    Blog Entries
    35

    Default Re: FactionIsLocal vs IsFactionAIControlled

    Quote Originally Posted by Withwnar View Post
    It does, yes. In fact it doesn't matter when historic_event is called, in a FactionIsLocal context or otherwise; every player will get the HE in hotseat (unless factions { xxx } is used to limit it to certain faction(s) of course). But it's only one HE seen per player: they each see it in their next turn, not player_count HEs seen by one player (if that's what you're saying).
    Every player seeing it is a given unless restricted - what I am saying is that it multiplies if called by an event like the one underneath as it will fire multiple times because of the FactionIsLocal condition:
    Code:
    monitor_event FactionTurnstart FactionIsLocal
        and I_TurnNumber = 1
        historic_event makemyday
    end_monitor
    3 human players:
    Human Player 1: sees his event in round 2 and Human Player 2 and 3's in round 3
    Human Player 2: sees Human Player 1's and his event in round 2 and Human Player 3's in round 3
    Human Player 3: sees Human Player 1 and 2's and his event in round 2

    Would be great if this could be confirmed.
    Last edited by Gigantus; April 10, 2017 at 05:52 AM.










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

    Default Re: FactionIsLocal vs IsFactionAIControlled

    Oh I see. Each of the three players will see three HEs.

    In hotseat you need to add a lot of script to avoid that:

    Code:
    monitor_event FactionTurnstart FactionIsLocal
        and I_TurnNumber = 1
    
        if I_LocalFaction england
            historic_event makemyday factions { england, }
        end_if
        if I_LocalFaction france
            historic_event makemyday factions { france, }
        end_if
        if I_LocalFaction hre
            historic_event makemyday factions { hre, }
        end_if
        ;...other possible player factions...
    
    end_monitor
    Sad but true. And even that only works because it's in the player's own turn. Say something happened in an AI turn to a player faction and you want to tell that player about it ... the FactionIsLocal condition and the I_LocalFaction IFs won't work; there's no shortcut ("local") way to do it.

  3. #3
    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,681
    Blog Entries
    35

    Default Re: FactionIsLocal vs IsFactionAIControlled

    Nope, has to be old fashioned:
    Code:
        monitor_event FactionTurnStart FactionType Faction A
            do something to Faction B
            historic_event makemyday factions { Faction B, }
        end_monitor
    Faction turn counters help to some extent:
    Code:
        monitor_event FactionTurnStart FactionType [faction]
            log [faction]: Faction turn end
            set_event_counter faction_turn_[faction] 1
        end_monitor
        
        monitor_event FactionTurnEnd FactionType [faction]
            log [faction]: Faction turn end
            set_event_counter faction_turn_[faction] 0
        end_monitor
    
        monitor_event FactionTurnstart FactionIsLocal
            and I_TurnNumber = 1
            if I_EventCounter faction_turn_[faction] > 0
                historic_event makemyday factions { [faction], }
            end_if
        end_monitor
    Last edited by Gigantus; April 10, 2017 at 06:41 AM.










Page 2 of 2 FirstFirst 12

Posting Permissions

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