Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: hi making certain events faction specific

Hybrid View

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

    Default hi making certain events faction specific

    hi, I would be very appreciative if some one would be willing to help me get the simple script for making an event faction specific (only seen by them)

    thank you
    druvatar

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

    Default Re: hi making certain events faction specific

    If you use the historic_event command then it has a factions parameter which serves this purpose.

    This will only show the "robin_hood_dies" event when playing England:

    Code:
    monitor_event FactionTurnStart FactionIsLocal
      and I_TurnNumber == 5
    
      historic_event robin_hood_dies factions { england, }
    
    terminate_monitor
    end_monitor
    I don't know if the factions parameter is for Kingdoms only.

    EDIT: Alternatively you could do it this way...
    Code:
    monitor_event FactionTurnStart FactionIsLocal
      and I_TurnNumber == 5
    
      if I_LocalFaction england
        historic_event robin_hood_dies
      end_if
    
    terminate_monitor
    end_monitor
    ...but this doesn't allow for including more than one faction (as it is).

    EDIT2: Using the first method you can use something like factions { england, scotland, denmark, }
    Last edited by Withwnar; May 11, 2011 at 11:40 AM.

  3. #3

    Default Re: hi making certain events faction specific

    thank you!

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

    Default Re: hi making certain events faction specific

    I'm not sure you caught my last edit as we posted at the same time. I have turned it into an "edit 2".

  5. #5

    Default Re: hi making certain events faction specific

    yes, I got that, I will test it & post my results! thank you!

  6. #6

    Default Re: hi making certain events faction specific

    it is not triggering
    I have the proper entry in historic_events text
    (in fact, for testing purposes I am using an event which was originally just a "regular" historic event
    and I simply deleted the entry in desc_events and adding the script given to the Campaign_script like this:
    Code:
    monitor_event FactionTurnStart FactionIsLocal
      and I_TurnNumber == 1
    
      if I_LocalFaction milan
        historic_event shelabi
      end_if
    
    terminate_monitor
    end_monitor
    
    end_script
    may be I need the event images file from one of the kingdoms campaigns?
    Last edited by Druvatar De Bodemloze; May 11, 2011 at 12:15 PM.

  7. #7

    Default Re: hi making certain events faction specific

    Quote Originally Posted by Druvatar De Bodemloze View Post
    Code:
    monitor_event FactionTurnStart FactionIsLocal
      if I_LocalFaction milan
      and I_TurnNumber == 1
        historic_event shelabi
      end_if
    
    terminate_monitor
    end_monitor
    Remove the red part.

  8. #8

    Default Re: hi making certain events faction specific

    did as you suggested but still nothing and I made sure script campaign_script txt. was at the bottom of my desc_strat

    this is the script with your suggested edit Ishan
    Code:
    monitor_event FactionTurnStart FactionIsLocal
      and I_TurnNumber = 1
    
      if I_LocalFaction milan
        historic_event shelabi
      end_if
    
    terminate_monitor
    end_monitor

  9. #9

    Default Re: hi making certain events faction specific

    Well i did inserted and condition after if line not just the = thing.
    Anyways use this simple one:-
    Code:
    monitor_event FactionTurnStart I_TurnNumber = 12
    	historic_event X_Y factions { england, scotland, ireland, }
    terminate_monitor
    end_monitor

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

    Default Re: hi making certain events faction specific

    Quote Originally Posted by Druvatar De Bodemloze View Post
    Code:
    monitor_event FactionTurnStart ...
     ...
    end_monitor
    
    end_script
    This might be the problem: if you inserted yours between wait_monitors and end_script then move it to before the wait_monitors line instead...

    Code:
    monitor_event FactionTurnStart ...
     ...
    end_monitor
    
    
    ;----------------------------------------------------
    ; keep script unfinised until last monitor termination
    wait_monitors
    
    end_script
    Quote Originally Posted by Ishan View Post
    Anyways use this simple one:-
    Code:
    monitor_event FactionTurnStart I_TurnNumber = 12
    	historic_event X_Y factions { england, scotland, ireland, }
    terminate_monitor
    end_monitor
    I think that this monitor will trigger once for each faction on turn 12. You will still only see it if you're playing as milan (in Druvatar's example) but you will see it about 20 times (faction count). Having FactionIsLocal as a monitor condition limits it to triggering just once.

    By the way, you can use = or == in conditions.

    EDIT: sorry, no, it will only trigger once because the terminate_monitor will kill after the first one.
    Last edited by Withwnar; May 11, 2011 at 11:13 PM.

  11. #11

    Default Re: hi making certain events faction specific

    still no go I (scripting aggh!)

    any way is my entry in campaign_script txt.
    Code:
    monitor_event FactionTurnStart I_TurnNumber = 1
        historic_event shelabi_intro factions { milan, }
    terminate_monitor
    end_monitor
    here is my entry in historic_events
    Code:
    {SHELABI_INTRO_BODY}The Shelabi 
    {SHELABI_INtRO_TITLE} The Shelabi
    here is what is at the bottom of my desc_strat
    Code:
    ; >>>> start of regions section <<<<
    
    script
    campaign_script.txt

  12. #12

    Default Re: hi making certain events faction specific

    ok I do not have a wait_monitors line where should I put it?
    & thank you for your efforts
    this the very first script I am adding into this mod
    my complete campaign_script
    Code:
    ;
    ; Campaign script by gigantus
    ;
    script
    
        restrict_strat_radar false
    ;    console_command toggle_fow
    
    monitor_event FactionTurnStart I_TurnNumber = 1
        historic_event shelabi_intro factions { milan, }
    terminate_monitor
    end_monitor
    
    end_script

  13. #13

    Default Re: hi making certain events faction specific

    done got it working thanks a bunch! guys!

  14. #14

    Icon1 Re: hi making certain events faction specific

    The TWC University’s archive has some classes on writing scripts:

    Scripting 101

    Introduction to Scripting

    Code:
    	monitor_event FactionTurnStart FactionIsLocal
              	and I_TurnNumber = 0
    		if I_LocalFaction england
    		historic_event england_intro factions { england, }
    	end_if
    		if I_LocalFaction scotland
    		historic_event scotland_intro factions { scotland, }
    	end_if
    		if I_LocalFaction ireland
    		historic_event ireland_intro factions { ireland, }
    	end_if
    	end_monitor
    Last edited by TNZ; May 12, 2011 at 12:24 AM.

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

    Default Re: hi making certain events faction specific

    Quote Originally Posted by Druvatar De Bodemloze View Post
    done got it working thanks a bunch! guys!
    Excellent.

    Quote Originally Posted by TNZ View Post
    Code:
    	monitor_event FactionTurnStart FactionIsLocal
              	and I_TurnNumber = 0
    		if I_LocalFaction england
    		historic_event england_intro factions { england, }
    	end_if
    		if I_LocalFaction scotland
    		historic_event scotland_intro factions { scotland, }
    	end_if
    		if I_LocalFaction ireland
    		historic_event ireland_intro factions { ireland, }
    	end_if
    	end_monitor
    Using a separate IF per faction like this is another way to cater for multiple factions. Although the "factions" conditions are redundant here I think.

  16. #16
    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: hi making certain events faction specific

    Quote Originally Posted by Withwnar View Post
    Excellent.



    Using a separate IF per faction like this is another way to cater for multiple factions. Although the "factions" conditions are redundant here I think.
    You need the faction conditions. Otherwise you don't have a condition for your IF part.

    IF 'player is england
    THEN 'historic event for england'
    END_IF










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

    Default Re: hi making certain events faction specific

    A bit ambiguous wasn't it? I meant the " factions { xxx, }" on the historic_event lines.

  18. #18
    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: hi making certain events faction specific

    Not really, if you leave them out there, then the message of the historic event still gets displayed to whatever faction the human player uses.
    BUT - as you have defined the condition as 'player's faction' is indeed superfluous.










  19. #19

    Icon1 Re: hi making certain events faction specific

    It's my understanding that in a hot-seat game it wouldn't be redundant at all but would ensure that the player only sees the historic event meant for their faction.

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

    Default Re: hi making certain events faction specific

    Ah, I don't know much about hot seat scenarios.

    But wouldn't...
    Code:
    if I_LocalFaction england
      historic_event england_intro 
    end_if
    ... mean that the historic_event line would only be reached if the player is england? So they won't see the event if they're not playing england. I don't understand how adding "factions { england, }" helps any in this case.

Page 1 of 2 12 LastLast

Posting Permissions

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