Results 1 to 2 of 2

Thread: spawn_character oddity

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default spawn_character oddity

    Mongol invasion 1 setup.
    Code:
            ;-- Mongols invasions --
    	monitor_event EventCounter EventCounterType mongols_invasion_warn
    		and EventCounter > 0
    		; ADD SCOUTING INVASION
    		add_events
    			event	counter	mongols_invasion
            	date	2
           end_add_events
            if I_EventCounter mongols_invasion_warn == 2
    			terminate_monitor
    		end_if
    	end_monitor
    
    	monitor_event EventCounter EventCounterType mongols_invasion
    		and EventCounter > 0
    		if I_EventCounter mongols_invasion == 1
    			add_events
    		;;; SCOUTING INVASION
    				event	emergent_faction	mongols
    				date	0
    ; 				region 	Tbilisi_Province
    ;				region 	Yerevan_Province
    ;				region	Bulgar_Province
    				region	Sarkel_Province
    				region 	Baghdad_Province
    				movie	event/mongols_invade.bik
    				;ADD MONGOL INVASION 1
    				event	counter	mongols_invasion
    	        	date	2
    			end_add_events
    		end_if
            if I_EventCounter mongols_invasion == 2
     
    			;Sarkel
    			if I_CharacterTypeNearTile mongols named_character, 30 258, 134
    				set_counter mongols_sarkel 1
    			end_if
    			;Tbilisi / Yerevan
    ;			if I_CharacterTypeNearTile mongols named_character, 20 278, 101
    ;				set_counter mongols_yerevan 1
    ;			end_if
    			;Baghdad
    			if I_CharacterTypeNearTile mongols named_character, 30 291, 70
    				set_counter mongols_baghdad 1
    			end_if
    
    	;;; MONGOL INVASION 1 SCRIPT
    		spawn_army 
    			faction mongols
    			character	Jebe, named character, age 30, x 292, y 166, family	;command 8, dread 9, loyalty 7, piety 1
    			traits EasternWarlord 3 , GoodCommander 2 , Bloodthirsty 2 , BattleDread 4 , Energetic 2 , StrategyDread 2 , PublicFaith 1 , Loyal 2 , ContentGeneral 3	;command 8, dread 9, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    		end
    		spawn_army 
    			faction mongols
    			character	Aradai, named character, age 22, x 290, y 168, family	;command 6, dread 7, loyalty 7, piety 1
    			traits EasternWarlord 2 , Anger 3 , BattleDread 2 , Energetic 2 , StrategyDread 2 , PublicFaith 1 , Loyal 2 , ContentGeneral 3	;command 6, dread 7, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    		end
    		spawn_army 
    			faction mongols
    			character	Bayan, named character, age 21, x 292, y 162, family	;command 6, dread 7, loyalty 7, piety 1
    			traits EasternWarlord 2 , Anger 3 , BattleDread 2 , Energetic 2 , StrategyDread 2 , PublicFaith 1, Loyal 2, ContentGeneral 3	;command 6, dread 7, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    		end
    		spawn_army 
    			faction mongols
    			character	Abadhun, named character, age 21, x 291, y 166, family	;command 6, dread 7, loyalty 7, piety 1
    			traits EasternWarlord 2 , Bloodthirsty 2 , BattleDread 2 , Energetic 3 , StrategyDread 2 , PublicFaith 1, Loyal 2, ContentGeneral 3	;command 6, dread 7, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    		end
    		spawn_army 
    			faction mongols
    			character	Bavdai, named character, age 21, x 289, y 168, family	;command 6, dread 7, loyalty 7, piety 1
    			traits EasternWarlord 2 , Bloodthirsty 3 , BattleDread 2 , Energetic 2 , StrategyDread 2 , PublicFaith 1, Loyal 2, ContentGeneral 3	;command 6, dread 7, loyalty 7, piety 1
    			unit		Mongol Bodyguard		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Infantry			exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Foot Archers		exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Heavy Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Light Lancers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    			unit		Mongol Horse Archers	exp 6 armour 0 weapon_lvl 0
    		end
    		spawn_character	mongols, Yesuk, spy, age 20, x 289, y 165
    				console_command give_trait Yesuk NaturalSpySkill 3
    				console_command give_trait Yesuk GoodSpy 4
    		
    		;;; move them to location of first invasion
    		if I_CompareCounter mongols_sarkel = 1
    			reposition_character Jebe, 280, 136
    			reposition_character Aradai, 277, 133
    			reposition_character Bayan, 278, 131
    			reposition_character Abadhun, 276, 132
    			reposition_character Bavdai, 276, 133
    			reposition_character Yesuk, 276 134
    		end_if
    ;		if I_CompareCounter mongols_yerevan = 1
    ;			reposition_character Jebe, 291, 109
    ;			reposition_character Aradai, 289, 108
    ;			reposition_character Bayan, 291, 107
    ;		end_if
    		if I_CompareCounter mongols_baghdad = 1
    			reposition_character Jebe, 292, 58
    			reposition_character Aradai, 290, 60
    			reposition_character Bayan, 293, 63
    			reposition_character Abadhun, 290, 61
    			reposition_character Bavdai, 290, 63
    			reposition_character Yesuk, 289, 60
    		end_if
    
    	
    			;ADD MONGOL INVASION 2
    			add_events
    				event	counter	mongols_invasion
    	        	date	4
                end_add_events
    		end_if
    OK, while the code works properly, I found something rather odd going on and its not reported in an errorlog.

    Basically the Mongols all spawned and then I saw that their spy was positioned where she should be but had no name. Yesuk is listed by default in the names file so this is oddity 1.

    Secondly, the Mongols in that case were relatively passive circling my heavily defended Sarkel Castle for around 30 odd turns.

    Then, the Timurids invaded near Baghdad. As soon as they took the first settlement (mosul) and raided it, the Mongols became active and the weird thing was that the spy now had his intended name!

    They then went on to attack Kiev that was also one of my holdings while the Timurids happily slaughtered Turks and rebels in the Levant.


    So, what I'm wondering is why the character was spawned unnamed (although console commands worked on him as if he had the name) and then only when the Timurids spawned, did the Mongols become active and that particular character named?

    According to alpaca's Script-O-Rama, no "end" is needed after spawn_character and the associated give_trait commands, but might that help in this case or what is causing it?
    Last edited by FactionHeir; 05-05-2008 at 16:31.
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO