Results 1 to 4 of 4

Thread: Need help with script

Hybrid View

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

    Default Need help with script

    Greetings to all. I had a little problem with my script and I need help.
    I have two of the same script, but one of them does not work.I made two battles on the map, but one of them does not work, and the other is working fine.
    Here is my script
    Code:
    ;======================Kalka=====================
    declare_counter Kalka
    
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_IsFactionAIControlled kievan_rus
    and I_IsFactionAIControlled mongols
    set_counter Kalka 1
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements kievan_rus < 1
    set_counter Kalka 1
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements mongols < 1
    set_counter Kalka 1
    terminate_monitor
    end_monitor
    
    monitor_conditions I_CompareCounter Kalka = 0
    and I_TurnNumber = 3
    wait 2
    historic_event PREPARE_BATTLE true
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter PREPARE_BATTLE_accepted = 1
    and I_TurnNumber = 3
    disable_cursor
    inhibit_camera_input true
    	move_strat_camera 351, 187
    	wait 3
    set_event_counter PREPARE_BATTLE_accepted = 0
    console_command diplomatic_stance mongols kievan_rus war
    console_command season summer
    add_money kievan_rus 15000
    add_money mongols 15000
            spawn_army 
            faction mongols
            character    Jebee, named character, age 48, x 351, y 187, label defend1, direction W
            traits  MilitaryInclination 1 , Military_Edu 3 , NaturalMilitarySkill 2 , GoodCommander 3 , StrategyDread 2 , PublicFaith 1 , Loyal 2 , GoodCavalryGeneral 2 , ReligionStarter 1, LoyaltyStarter 1
                    unit	Keshikten Bodyguard		exp 10 armour 1 weapon_lvl 1
    		unit	Merguen Archers		exp 5 armour 1 weapon_lvl 1
    		unit	Disamounted Turhagut		exp 9 armour 1 weapon_lvl 1
                    unit	Disamounted Turhagut		exp 9 armour 1 weapon_lvl 1
    		unit	Disamounted Turhagut			exp 9 armour 1 weapon_lvl 1
    		unit	Nukeri Horse Archers	exp 5 armour 1 weapon_lvl 1
                    unit	Nukeri Horse Archers	exp 5 armour 1 weapon_lvl 1
                   	unit	Turhagut Lancers		exp 9 armour 1 weapon_lvl 1
    		unit	Turhagut Lancers	exp 9 armour 1 weapon_lvl 1
    		unit	Turhagut Lancers	exp 9 armour 1 weapon_lvl 1 
    		unit	Nukeri Horse Archers	exp 9 armour 1 weapon_lvl 1
    		unit	Lubchiten Horse Archers		exp 4 armour 1 weapon_lvl 1
    		unit	Lubchiten Horse Archers		exp 4 armour 0 weapon_lvl 1
    		unit	Disamounted Turhagut			exp 9 armour 1 weapon_lvl 1
                    unit	Disamounted Turhagut			exp 9 armour 1 weapon_lvl 1
    		unit	Nukeri Horse Archers	exp 5 armour 1 weapon_lvl 1
                    unit	Nukeri Horse Archers	exp 5 armour 1 weapon_lvl 1
    		unit	ME Trebuchet	exp 4 armour 1 weapon_lvl 1
    		unit	ME Trebuchet		exp 5 armour 0 weapon_lvl 0
                    end
                    spawn_army 
            faction kievan_rus
            character    Danielin Romanovich, named character, age 25, x 350, y 187, label attack1, direction E
            traits MilitaryInclination 1 , Military_Edu 2 , NaturalMilitarySkill 2 , GoodCommander 2 , StrategyDread 1 , PublicFaith 1 , Loyal 2 , GoodCavalryGeneral 1 , ReligionStarter 1, LoyaltyStarter 1
                    unit	EE Bodyguard		exp 2 armour 1 weapon_lvl 0
    		unit	EE Peasant Archers			exp 1 armour 0 weapon_lvl 0
                    unit	Berdiche Militia	exp 0 armour 0 weapon_lvl 0
    		unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
    		unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
    		unit	Rus Senior Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Rus Senior Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Rus Senior Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Dismounted Druzhina			exp 0 armour 0 weapon_lvl 0
                    unit	Dismounted Druzhina			exp 0 armour 0 weapon_lvl 0
                    unit    Boyars	exp 1 armour 0 weapon_lvl 0
                    unit    Boyars	exp 1 armour 0 weapon_lvl 0
                    unit	Pechenegs	exp 1 armour 0 weapon_lvl 0
                    unit	Pechenegs	exp 1 armour 0 weapon_lvl 0
                    unit	Luchniki		                exp 1 armour 0 weapon_lvl 0
                    unit	Luchniki		                exp 1 armour 0 weapon_lvl 0
                    unit    Druzhina			        exp 0 armour 0 weapon_lvl 0
    		end 
    historic_event BATTLE_KALKA event/New_kalka.bik factions { kievan_rus, mongols, }
    console_command	give_trait defend1 script
    console_command	give_trait attack1 script
    inhibit_camera_input false
    enable_cursor
    wait 2
    set_counter Kalka 1
    engage_armies Jebee, Danielin Romanovich
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType mongols
    and I_CharacterExists defend1
    console_command	remove_trait defend1 script
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType kievan_rus
    and I_CharacterExists attack1
    console_command	remove_trait attack1 script
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter PREPARE_BATTLE_declined = 1
    set_event_counter PREPARE_BATTLE_accepted = 0
    terminate_monitor
    end_monitor
    This script is the Battle of the Kalka River, it works fine. Both generals appear and attack each other.
    However, I did exactly the same script, only for another battle, and it does not work
    Code:
    ;=============== Ice battle ==================
    declare_counter battle
    
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_IsFactionAIControlled russia
    and I_IsFactionAIControlled teutonic_order
    set_counter battle 1
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
    and I_NumberOfSettlements russia < 1
    set_counter battle 1
    terminate_monitor
    end_monitor
    
    monitor_conditions I_CompareCounter battle = 0
    and I_TurnNumber = 22
    wait 2
    historic_event PREPARE_BATTLE true
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter PREPARE_BATTLE_accepted = 1
    and I_TurnNumber = 22
    disable_cursor
    inhibit_camera_input true
    	move_strat_camera 277, 265
    	wait 3
    set_event_counter PREPARE_BATTLE_accepted = 0
    console_command diplomatic_stance russia teutonic_order war
    console_command kill_character "Alexandrr Yaroslavichh"
    console_command season winter
            spawn_army 
            faction teutonic_order
            character    Bishop Hermann, named character, age 35, x 277, y 265, label battle1, direction N
            traits  MilitaryInclination 1 , Military_Edu 1 , NaturalMilitarySkill 1 , GoodCommander 2 , StrategyDread 2 , PublicFaith 1 , Loyal 2 , GoodCavalryGeneral 2 , ReligionStarter 1, LoyaltyStarter 1
                    unit		TO Bodyguard				exp 2 armour 0 weapon_lvl 0
                    unit		Sword Brethren				exp 3 armour 0 weapon_lvl 0
                    unit		Prussian Archers			exp 3 armour 1 weapon_lvl 0
                    unit		Prussian Archers			exp 3 armour 1 weapon_lvl 0
                    unit	        Sword Brethren 		                exp 5 armour 1 weapon_lvl 1
                    unit		Crusader Sergeants			exp 5 armour 1 weapon_lvl 1
                    unit	        Sword Brethren 		                exp 5 armour 1 weapon_lvl 1
                    unit		Christ Knights				exp 2 armour 0 weapon_lvl 0
                    unit		Knechten				exp 1 armour 1 weapon_lvl 0
                    unit		Prussian Auxillia			exp 1 armour 0 weapon_lvl 0
                    unit		Prussian Infantry			exp 3 armour 0 weapon_lvl 0
                    unit		Burgher Pikemen			        exp 4 armour 0 weapon_lvl 0
                    unit		Spear Militia				exp 3 armour 0 weapon_lvl 0
                    unit		Prussian Axemen				exp 2 armour 1 weapon_lvl 0
                    unit		Knechten				exp 1 armour 1 weapon_lvl 0
                    unit		Dismounted Ritterbruder		        exp 3 armour 1 weapon_lvl 0
                    unit		Dismounted Ritterbruder		        exp 1 armour 1 weapon_lvl 0
                    unit		Ritterbruder		                exp 5 armour 1 weapon_lvl 0
                    end
                    spawn_army 
            faction russia
            character    Alex Nevskyi, named character, age 21, x 277, y 266, label battle2, family, direction S
            traits MilitaryInclination 1 , Military_Edu 1 , NaturalMilitarySkill 1 , GoodCommander 3, PublicFaith 1 , Loyal 2 , GoodCavalryGeneral 2 , ReligionStarter 1, LoyaltyStarter 1
                    unit	EE Bodyguard		exp 2 armour 1 weapon_lvl 0
    		unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
    		unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
                    unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
    		unit	Smolensk Infantry	exp 0 armour 0 weapon_lvl 0
    		unit	Rus Senior Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Rus Senior Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Rus Senior Militia			exp 0 armour 0 weapon_lvl 0
                    unit	Druzhina				exp 1 armour 0 weapon_lvl 0
                    unit	Druzhina				exp 1 armour 0 weapon_lvl 0
                    unit	Dismounted Druzhina			exp 0 armour 0 weapon_lvl 0
                    unit	Dismounted Druzhina			exp 0 armour 0 weapon_lvl 0
                    unit	Dismounted Druzhina			exp 0 armour 0 weapon_lvl 0
                    unit	Dismounted Boyars			exp 0 armour 0 weapon_lvl 0
                    unit	Senior Mounted Militia			exp 1 armour 0 weapon_lvl 0
                    unit	Senior Mounted Militia			exp 1 armour 0 weapon_lvl 0
                    unit    Boyars			                exp 1 armour 0 weapon_lvl 0
                    unit    Boyars			                exp 1 armour 0 weapon_lvl 0
                    unit	Luchniki		                exp 1 armour 0 weapon_lvl 0
                    unit	Luchniki		                exp 1 armour 0 weapon_lvl 0
                    end
    historic_event ICE_BATTLE event/Battle_ICE.bik factions { russia, teutonic_order, }
    console_command	give_trait battle1 script
    console_command	give_trait battle2 script
    inhibit_camera_input false
    enable_cursor
    wait 2
    set_counter battle 1
    engage_armies Bishop Hermann, Alex Nevskyi
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType teutonic_order
    and I_CharacterExists battle1
    console_command	remove_trait battle1 script
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionType russia
    and I_CharacterExists battle2
    console_command	remove_trait battle2 script
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter PREPARE_BATTLE_declined = 1
    set_event_counter PREPARE_BATTLE_accepted = 0
    terminate_monitor
    end_monitor
    The problem is that Bishop Herman does not want to attack Alex Nevskyi, If I play for Novgorod. However, if I play for the Teutonic Order, then again, no problems
    Although in the last battle of all attacking each other, and there are no problems

    Sry for bad English.
    Last edited by OPASEH; March 15, 2012 at 09:02 PM.

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

    Default Re: Need help with script

    You can highlight what is different in the script that doesn't work, so we don't have to do it.

  3. #3

    Default Re: Need help with script

    Quote Originally Posted by Taiji View Post
    You can highlight what is different in the script that doesn't work, so we don't have to do it.
    It works good
    Code:
    console_command give_trait defend1 script
    console_command give_trait attack1 script
    inhibit_camera_input false
    enable_cursor
    wait 2
    set_counter Kalka 1
    engage_armies Jebee, Danielin Romanovich
    terminate_monitor
    end_monitor
    BUT This is not working
    Code:
    console_command give_trait battle1 script
    console_command give_trait battle2 script
    inhibit_camera_input false
    enable_cursor
    wait 2
    set_counter battle 1
    engage_armies Bishop Hermann, Alex Nevskyi
    terminate_monitor
    end_monitor
    Why engage_armies Bishop Hermann, Alex Nevskyi is not work?
    Last edited by OPASEH; March 16, 2012 at 04:51 AM.

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

    Default Re: Need help with script

    Try using the labels you gave them.

Posting Permissions

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