Results 1 to 20 of 20

Thread: complex event accepting or not templars is it ok?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default complex event accepting or not templars is it ok?

    Hello...this is my first try to make a event,what i want is that a event appears(with a image)asking if the templar order is acepted or not in portugal....if i acept it unlock 3 buildings(comendadoria-the first building level- : preceptorado-the second building level- : grande preceptorado-the tird building level-) and in that 3 buildings it can be recruited ex:Templar Crossbowmen...if i reject nothing happens but 3 years later the invitation appears again,and again...until i acept or not...from 3 to 3 years they will be asking , can you see what is wrong here?And correct me where itīs wrong?hope you guys can help, thanks in advance



    ;--- Templar Order Event
    monitor_event FactionTurnStart FactionIsLocal
    and I_EventCounter Templar_accepted = 0
    and Treasury > 2000
    and FactionBuildingExists >= stone_wall
    and RandomPercent < 25

    historic_event Templar true

    end_monitor

    monitor_conditions I_EventCounter Templar_accepted = 1
    console_command add_money -2000

    terminate_monitor
    end_monitor

    monitor_conditions I_EventCounter Templar_declined = 1
    set_event_counter Templar_declined = 0
    end_monitor


    {PRINTING_BODY}Sire, the Holy warriors of God, the Templars, are asking if they can do Godīs work in our Kingdom.The Templar Order offers to help us against the infidels. The Order will fight with us for the expansion of Kingdom of Portugal. They are Holy Warrior monks, hard, pious, and fight against evil, they have the best weapon to fight foes...their faith, their valor cannot be denied. Their Grandmaster will be visiting us here by next season to begin construction for 2,000 florins. Do I have your permission to accept?




    Buildings.................................


    Templar Order
    {
    levels comendadoria preceptorado grande perceptorado
    {
    comendadoria city requires factions { portugal, } and building_present_min_level stone_wall large_stone_wall huge_stone_wall and event_counter Templar_accepted 1 or event_counter i_robot 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, } requires event_counter i_robot 0
    }
    material wooden
    construction 5
    cost 4800
    settlement_min large_city
    upgrades
    {
    preceptorado
    }
    }
    preceptorado city requires factions { northern_european, hre, poland, } and building_present_min_level education_libraries great_library and event_counter printing_accepted 1 or event_counter i_robot 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, } requires event_counter i_robot 0
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    preceptorado city requires factions { northern_european, hre, poland, } and building_present_min_level education_libraries great_library and event_counter printing_accepted 1 or event_counter i_robot 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, } requires event_counter i_robot 0
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    }
    }
    }
    plugins
    {
    }
    }
    Homo Homini Lupus

  2. #2
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: complex event accepting or not templars is it ok?

    Campaign_Script-

    declare_counter quarter
    set_counter quarter 0

    ;start counter to appear every third turn
    monitor_event FactionTurnStart FactionIsLocal
    inc_counter quarter 1
    end_monitor

    ;when the couner reaches 3, reset to 1
    monitor_event FactionTurnStart FactionIsLocal
    and I_CompareCounter quarter == 3
    set_counter quarter 1
    end_monitor

    ;one the third turn it asks yes/no event
    monitor_event FactionTurnStart FactionIsLocal
    and I_CompareCounter quarter = 2
    add_events
    event event_counter templar_accepted
    event event_counter templar_declined
    date 0
    end_add_events
    historic_event templar true
    end_monitor

    ;yes- reduce money and buildings available
    monitor_event EventCounter EventCounterType templar_accepted
    and I_EventCounter templar_accepted == 1
    console_command add_money -2000
    set_event_counter templar_accepted 1
    terminate_monitor
    end_monitor

    ;no- resets counters
    monitor_conditions EventCounter EventCounterType templar_declined
    and I_EventCounter templar_declined == 1
    set_event_counter templar_declined 0
    end_monitor


    historic_events.txt-

    {TEMPLAR_BODY}Sire, the Holy warriors of God, the Templars, are asking if they can do Godīs work in our Kingdom. The Templar Order offers to help us against the infidels. The Order will fight with us for the expansion of Kingdom of Portugal. They are Holy Warrior monks, hard, pious, and fight against evil, they have the best weapon to fight foes...their faith, their valor cannot be denied. Their Grandmaster will be visiting us here by next season to begin construction for 2,000 florins. Do I have your permission to accept?
    {TEMPLAR_TITLE}Allow Templars in our country?

    EDB, Is this only for Portugal? If so it would look like this-

    Templar Order
    {
    levels comendadoria preceptorado grande perceptorado
    {
    comendadoria city requires factions { portugal, } and building_present_min_level stone_wall large_stone_wall huge_stone_wall and event_counter Templar_accepted 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 5
    cost 4800
    settlement_min large_city
    upgrades
    {
    preceptorado
    }
    }
    preceptorado city requires factions { portugal, } and building_present_min_level education_libraries great_library
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    preceptorado city requires factions { portugal, }
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    }
    }
    }
    plugins
    {
    }
    }

    Hope this helps.

    VB

  3. #3
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    Thanks Vegasbear...it was awsome to have this in my mood ....youīre Master Yoda of Scripting....+ rep to you
    Homo Homini Lupus

  4. #4
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: complex event accepting or not templars is it ok?

    You're welcome.

  5. #5
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    hello vegasbear i add everithing as you teach and something is not ok because iīm in turn 70 and the event stil donīt appears in the game..the building tree...i made the building ui and doesnt appears...only the rtw barracks building icon there is something wrong with my building?Yes is only to Portugal....can you help...again
    many thanks in advance

    Templar Order
    {
    levels comendadoria preceptorado grande perceptorado
    {
    comendadoria city requires factions { portugal, } and building_present_min_level stone_wall large_stone_wall huge_stone_wall and event_counter Templar_accepted 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 5
    cost 4800
    settlement_min large_city
    upgrades
    {
    preceptorado
    }
    }
    preceptorado city requires factions { portugal, }
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    preceptorado city requires factions { portugal, }
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7
    cost 9600
    settlement_min huge_city
    upgrades
    {
    }
    }
    }
    plugins
    {
    }
    }
    Homo Homini Lupus

  6. #6

    Default Re: complex event accepting or not templars is it ok?

    The old code wouldn't work because of the monitor order, see below for a more streamlined version,
    Code:
    declare_counter quarter
    set_counter quarter 0
    
    ;start counter to appear every third turn
    monitor_event FactionTurnStart FactionIsLocal
        inc_counter quarter 1
    end_monitor
    
    ;when the couner reaches 3, reset to 1
    monitor_event FactionTurnStart FactionIsLocal
        and I_CompareCounter quarter == 3
            set_counter quarter 1
    end_monitor
    
    ;one the third turn it asks yes/no event
    monitor_event FactionTurnStart FactionIsLocal
        and I_CompareCounter quarter = 2
        add_events
            event event_counter templar_accepted
            event event_counter templar_declined
            date 0
        end_add_events
        historic_event templar true
    end_monitor
    I think these parts run some sort on interference, wich causes the "quarter" never to be 2 at a turn start.
    Try this instead: ( removed some redundancies aswel )

    Code:
    declare_counter quarter
    
    ;start counter to appear every third turn
    monitor_event FactionTurnStart FactionIsLocal
        inc_counter quarter 1
    
          if I_CompareCounter quarter == 2 
           and I_EventCounter templar_accepted == 0 
              historic_event templar true
          end_if 
    
          if I_CompareCounter  quarter == 3 
             set_counter quarter 0 
          end_if 
    
          if I_EventCounter templar_accepted == 1
             terminate_monitor
          end_if 
    
    end_monitor
    then the actual effects: no real changes just 1 small redundancy, aka you set a condition as a command, the event only runs in templar_accepted == 1 and you had it set templar_accepted to 1 bit odd
    yes- reduce money and buildings available
    Code:
    monitor_event EventCounter EventCounterType templar_accepted
        and I_EventCounter templar_accepted == 1
            console_command add_money -2000
        terminate_monitor
    end_monitor
    ;no- resets counters
    stayed the same
    Code:
    monitor_conditions EventCounter EventCounterType templar_declined
        and I_EventCounter templar_declined == 1
            set_event_counter templar_declined 0
    end_monitor
    EDB
    It the building won't show up in the building browser as long as the event counter requirement is not met, so that's normal, the building looks fine except for the part I highlighted ( wich might work but it's a bit odd if you ask me...) the stone wall decides the size of your settlement so using it as a requirement is not needed because you already do have this line "settlement_min large_city" wich is basically the same thing.

    Also you made a mistake in the event_counter name, you named the event templar and the event counter in the EDB is Templar (not sure that this matters but better safe than sorry).
    I repeated the line in the second level of the building this way both levels remain hidden until you have activated the event.
    Also I'm not sure that you can have a unconnected name so I made grandeperceptorado --> grande_perceptorado

    Code:
    Templar Order
    {
    levels comendadoria preceptorado grande_perceptorado 
    {
    comendadoria city requires factions { portugal, } and building_present_min_level stone_wall large_stone_walland event_counter templar_accepted 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 5 
    cost 4800 
    settlement_min large_city
    upgrades
    {
    preceptorado
    }
    }
    preceptorado city requires factions { portugal, } and building_present_min_level education_libraries great_library and event_counter templar_accepted 1
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7 
    cost 9600 
    settlement_min huge_city
    upgrades
    {
    preceptorado city requires factions { portugal, }
    {
    capability
    {
    recruit_pool "Templar Crossbowmen" 1 0.7 6 0 requires factions { portugal, }
    }
    material wooden
    construction 7 
    cost 9600 
    settlement_min huge_city
    upgrades
    {
    }
    }
    }
    plugins 
    {
    }
    }
    for the UI did you make all 3 TGA's ?
    you should have
    southern_european_grande_perceptorado_constructed.TGA
    southern_european_grande_perceptorado.TGA
    and
    southern_european_grande_perceptorado.TGA
    in the "construction" folder of the UI, this can be the same one as above as the game automatically rescales and the size ratio is the same
    Last edited by ilmrik; November 23, 2011 at 09:13 AM.

  7. #7
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: complex event accepting or not templars is it ok?

    Quote Originally Posted by ilmrik View Post
    for the UI did you make all 3 TGA's ?
    you should have
    #southern_european_grande_perceptorado_constructed.TGA
    #southern_european_grande_perceptorado.TGA
    and
    #southern_european_grande_perceptorado.TGA
    in the "construction" folder of the UI, this can be the same one as above as the game automatically rescales and the size ratio is the same

  8. #8
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    Hello guys,first i want to thanks all for your help in this...iīve done everyting has you teach the event appears but there is no yes button to accept the event ...i sent a pic....what is the solution to this?Many thanks in advance
    Homo Homini Lupus

  9. #9
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: complex event accepting or not templars is it ok?

    Check this line in campaign script
    Code:
    historic_event templar true

  10. #10
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: complex event accepting or not templars is it ok?

    You are probably missing the required syntax from a Kingdoms campaign that allows you to have a Yes/No event. Look in you Teutonic campaign and look for descr_event_images.txt. In this file you will be looking for the historic_event entry. Replace the entry from your mod w/ this syntax. You will now have the Yes/No options upon getting the historic event.

    Spoiler Alert, click show to read: 
    Code:
    historic_event
    	icon	historic
    	importance high
    	heading_items	3
    	footer_items	1
    	format
    	{
    		string	center verdana black
    		image	center
    		spacer	8
    		multistring	left verdana_sml khaki left
    		condition
    		{
    			true
    			{
    				group center 8
    				{
    					accept    right
    					decline   left
    				}
    			}
    			false
    			{
    				group center 8
    				{
    					spacer 1	; dummy item to fix event message formatting wrt header and footer items
    				}
    			}
    		}
    	}


    If you can't find the file, I included the historic event entry, just open your descr_event_images and replace the historic_event section w/ the one above.

    VB

  11. #11
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    hello again...done that but still the same... the event appears but no yes/no button to chose...and the image donīt appears...exactly like the pic....help guys.Thanks again for all help
    Homo Homini Lupus

  12. #12

    Default Re: complex event accepting or not templars is it ok?

    You are running kingdoms right ? Because I tried getting choice events to run on plain M2TW and never got it to work ( had exactly the same issue as you )

  13. #13
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    oh,oh....itīs vanilla not kingdoms....
    Homo Homini Lupus

  14. #14
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: complex event accepting or not templars is it ok?

    Why don't you just use kingdoms?

  15. #15

    Default Re: complex event accepting or not templars is it ok?

    Well I agree with killersmurf really, but essentially you do this:

    Create 2 new shortcuts as in this tutorial.

    Lets assume you named them event_agreed (F2) and event_declined hotkeys (F3)

    Code:
    monitor_event EventCounter EventCounterType templar_accepted 
    and I_EventCounter templar_accepted  1
    
    end_monitor
    would become


    Code:
    monitor_event 
    ShortcutTriggered ShortcutTriggered strat_ui event_agreed
    and I_EventCounter templar 1 
    
      usual effects 
      set_event_counter templar 0 
    
    terminate_monitor
    end_monitor
    
    monitor_event 
    ShortcutTriggered ShortcutTriggered strat_ui event_declined
    and I_EventCounter templar 1 
    
      usual effects 
      set_event_counter templar 0 
    
    end_monitor
    Anyway you'll have to think about the finer things a bit but it should work fine,
    just mention the 2 hotkeys in the event text.
    If you want to do this for more than one event you'll need some far more advanced scripting.

    So moral of the story, listen to the homocidal ( or smurficidal ) smurf and upgrade, you can get kingdoms for like 6 or 7 euro online nowadays.

  16. #16
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: complex event accepting or not templars is it ok?

    hello guys...iīll try this....i have all total war series until shogun 2, i use medieval vanilla because the all factions are in here,kingdoms havenīt portugal,spain etc......many thanks for help in advance
    Homo Homini Lupus

  17. #17
    Emperor of Hell's Avatar SPA-NED 1-5
    Join Date
    Jul 2011
    Location
    Netherlands
    Posts
    5,747

    Default Re: complex event accepting or not templars is it ok?

    Use bare kingdoms from Gigantus (it's a basic modfolder with all vanilla things, except it's using kingdoms.exe) or the retrofit mod (a mod which adds many kingdoms features to vanilla, also using kingdoms.exe)
    LINKS: bare kingdoms
    the retrofit mod

  18. #18
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: complex event accepting or not templars is it ok?

    You basically want to use the Kingdoms.exe, it allows for much greater possibilities for modding, than the vanilla.exe. Most people play using the Kingdoms.exe, just look at the mods available. There are only a handful that use the vanilla.exe, most use kingdoms.exe.

    VB

Posting Permissions

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