OSP Kit Combat Camel Kit! - Makes horses react to camels

Users who are viewing this thread

Zarthas

Knight at Arms
Camel Kit!

I decided earlier that not enough mods use camels.  They're awesome.  Persians, Byzantines, and even the Romans used them, and they were very popular cavalry throughout Arabia.  Now, a few mods have chucked them in as a cool add-on, but I wanted to explore one of the most interesting aspects of camelry - Their effect on horses.

Code:
He gathered all the dromedaries from his army train, took off their burdens and set cavalry men upon them. Having thus furnished them, he ordered them to go in front of the rest of the army towards the horsemen of Croesus [...]. He did this because horses are afraid of dromedaries and can not endure to see or smell them.
[Herodotus of Halicarnassus, Histories 1.80]

It was apparently a big deal during the crusades as well.  And its still an issue for people who ride camels recreationally.  They're not really able to share horse-trails without making horses go berserk.

So, I wrote this kit.  It has some base Camel types, and everything you need to get horses to react to camels in battle.  Horses that are close to a camel will rear occasionally, disrupting any kind of charge action and stopping the rider.  The Riding skill reduces the likelihood that the horse will rear.

Add this to the very top of module_mission_templates :
Code:
from header_skills import *
from module_skills import *


  Add this bit to the top of module_mission_templates, above the check_belfy_movement one

Old version that scares all horses:
Old Version!

Code:
horses_spook = (
   2, 0, 0, [],#Every six seconds
       [
(try_for_agents, ":cur_agent"),
    (try_begin),
        (neg|agent_is_human,":cur_agent"),
        (agent_is_alive,":cur_agent"),
        (agent_get_item_id,":horse_type", ":cur_agent"),
        (try_for_range,":camel",camels_begin,camels_end),
            (eq,":horse_type",":camel"),#If this horse is a camel
            (agent_get_position,pos2,":cur_agent"),
                (try_for_agents,":enemy_horse"),
                    (assign,":canspook",1),
                    (neg|agent_is_human,":enemy_horse"),#See if its a horse
                    (agent_is_alive,":enemy_horse"),#Make sure he's not dead
                    (agent_get_item_id,":enemy_horse_type",":enemy_horse"),
                        (try_for_range,":camel",camels_begin,camels_end),                     
                            (eq,":enemy_horse_type",":camel"),#Can't scare other camels
                            (assign,":canspook",0),
                        (try_end),
                    (store_random_in_range,":chance",1,11),
                    (agent_get_rider,":enemy_rider",":enemy_horse"),
                    (agent_get_troop_id,":ridertroop",":enemy_rider"),
                    (store_skill_level,":riding",skl_riding,":ridertroop"),
                    (val_add,":chance",":riding"),
                        (try_begin),
                        (ge,":chance",10),
                        (assign,":canspook",0),
                        (end_try),
                    (try_begin),
                        (eq,":canspook",1),
                        (agent_get_position,pos1,":enemy_horse"),
                        (get_distance_between_positions,":dist",pos1,pos2),#In CM
                        (try_begin),
                            (le,":dist",3500),#Within 35m
                            (agent_set_animation,":enemy_horse","anim_horse_rear"),
                        (try_end),
                    (try_end),
                (try_end),
        (try_end),
        (try_end),
    (try_end)])

Improved version that prevents allied horses from getting spooked, courtesy of Xaliber, with performance suggestions by Somebody.

Code:
horses_spook = (
	6, 0, 0, [],#Every six seconds
	[
	(try_for_agents,":cur_horse"),
		(agent_is_alive,":cur_horse"),
		(agent_get_item_id,":horse_type",":cur_horse"),
		(is_between,":horse_type",camels_begin,camels_end),
		(agent_get_position,pos2,":cur_horse"),	
		(agent_get_rider,":cur_rider",":cur_horse"),		# Store rider info from camel
			(gt, ":cur_rider", -1),						# Camel has rider (greater thn -1)
			(agent_get_team,":agent_team",":cur_rider"),	# Store camel rider info, what team is he?
			(try_for_agents,":enemy_horse"),				# Then  check enemy horse
				(agent_is_alive,":enemy_horse"),#Make sure he's not dead
				(neg|agent_is_human, ":enemy_horse"),
				(agent_get_item_id,":enemy_horse_type",":enemy_horse"),
				(neg|is_between, ":enemy_horse_type", camels_begin,camels_end),
				(agent_get_position, pos1,":enemy_horse"),
				(get_distance_between_positions,":dist",pos1,pos2),#In CM
				(le,":dist",3500),#Within 35m
				(store_random_in_range,":chance",1,11),
				
				(try_begin),		# Check if opposing team, apply horse spook. If not, don't
					(agent_get_rider,":enemy_rider",":enemy_horse"),
					(gt, ":enemy_rider", -1),
					(agent_get_team,":enemy_team",":enemy_rider"),
					(try_begin),
						(teams_are_enemies,":agent_team",":enemy_team"),
						(agent_get_troop_id,":enemy_rider",":enemy_rider"),
						(store_skill_level,":riding","skl_riding",":enemy_rider"),
					(else_try),
						(assign,":riding", 99),
					(try_end),
					(val_add,":chance",":riding"),
				(try_end),

				(lt, ":chance", 10),
				(agent_play_sound, ":enemy_horse", "snd_horse_low_whinny"),		# gives sound
				(agent_set_animation,":enemy_horse","anim_horse_rear"),
			(try_end),	# try_for_agents enemy_horse
	(try_end),
	]
)

Then call horses_spook in every mission type you want this to happen in.  Obviously, it doesn't matter in sieges.

Then add these to module_constants somewhere:
Code:
camels_begin = "itm_pack_camel"
camels_end = "itm_arrows"

And here's the item types!
Code:
##CAMELS!!
 ##Bactrian Camels
 ["pack_camel","Pack Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 134,abundance(90)|hit_points(120)|body_armor(14)|difficulty(2)|horse_speed(27)|horse_maneuver(42)|horse_charge(11)|horse_scale(120),imodbits_horse_basic],
 ##Dromedary
 ["riding_camel","Riding Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 487,abundance(90)|hit_points(120)|body_armor(14)|difficulty(4)|horse_speed(32)|horse_maneuver(45)|horse_charge(14)|horse_scale(123),imodbits_horse_basic],
 ##Noble's Camel - Bred for speed
 ["nobles_camel","Noble's Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 1011,abundance(90)|hit_points(133)|body_armor(14)|difficulty(4)|horse_speed(39)|horse_maneuver(44)|horse_charge(14)|horse_scale(125),imodbits_horse_basic],
 ##Highly Trained - Camelphracts - Able to carry loads better than horses, so has heavier armor
 ["war_camel","War Camel", [("sumpter_horse",0)], itp_merchandise|itp_type_horse, 0, 1555,abundance(90)|hit_points(180)|body_armor(45)|difficulty(4)|horse_speed(28)|horse_maneuver(38)|horse_charge(25)|horse_scale(127),imodbits_horse_basic],

Models:
Check out Xenoargh's OSP camel!
https://forums.taleworlds.com/index.php/topic,114455.msg2759125.html#msg2759125

Camel Pros and Cons
Camels are a bit hardier overall, less prone to breaking limbs, etc.  Hitpoints +
Camels are notoriously difficult to ride and train. Difficulty +
Camels are much taller than horses.  Scale +
Most Camels are much slower than horses over short distances.  Speed -
Even highly trained horses can't stand Camels.  Disruption Ability.

Overall, Camel Riders will fulfill a unique role as anti-cavalry cavalry.  Their effectiveness vs infantry would be limited, as they aren't capable of the shock charges that horses are.  However, mounted camel archers could be a very effective skirmishing force, disrupting both enemy infantry and cavalry.  The biggest threat to a camel rider would be enemy archers and persistent enemy horsemen.


On a side note, tell me this isn't awesome:
UN peacekeeper camelry
UN_Soldiers_in_Eritrea.jpeg
 
Code:
(try_for_range,":camel",camels_begin,camels_end),
(eq,":horse_type",":camel"),#If this horse is a camel
This should be replaced with (is_between, ":horse_type", camels_begin, camels_end), and same with the next instance with (neg|is_between).
 
Holy hell Zarthas, that's great! :grin: My mod will certainly include camels and I had always considered it a bit of a shame they would be pretty much different looking horses.

Only ENEMY horses are affected by the camel-ness, right?
 
FrisianDude said:
Holy hell Zarthas, that's great! :grin: My mod will certainly include camels and I had always considered it a bit of a shame they would be pretty much different looking horses.

Only ENEMY horses are affected by the camel-ness, right?

there is no horse scale in 1.011 i think..
 
Negative  :twisted:  All horses hate camels.  I think I might code in a bit were ally horses can be a bit closer to them without freaking out, being accustomed to them and whatnot.

But yeah, you'd have to keep your Camelry and Cavalry seperate.  One of the main reasons people didn't use camel riders I think.
 
Naw, I think horses from the same region as camels would be familiar enough with them not to be scared, no? :razz: Would be very convenient, mod-wise, if allied horses didn't mind their side's camels. :razz:
 
Nice, going to see if can fit this in the Hyborian Age!

Cheers!

P.S: Zarthas, you have a PM also, abut Dawn of Man stuff!
 
Good!

Another note:
Putting
Code:
(get_distance_between_positions,":dist",pos1,pos2),#In CM
(le,":dist",3500),
right after
Code:
(try_for_agents,":enemy_horse"),
saves a ton of time too
 
But it works?
Copying the code doesn't harm, but when I try to call the script it gaves me many errors. There is a reccomended place of the various "you lead your men" code where to put the call script? It is strange because is like I haven't initialised something despite the fact I put the code at the beginning and the call script in the various mission template. I also have problems with other script like regeneration, maybe it's just me that I don't know how and where call script properly.
 
Also is made for warband too? The code shouldn't change but there are some difference (not all polearm are couchable, too weight don't stop you), maybe isn't compatible.
 
Eh, try this instead
Code:
horses_spook = (
	6, 0, 0, [],#Every six seconds
	[
	(try_for_agents,":cur_horse"),
		(agent_is_alive,":cur_horse"),
		(agent_get_item_id,":horse_type",":cur_horse"),
		(is_between,":horse_type",camels_begin,camels_end),
		(agent_get_position,pos2,":cur_horse"),
		(try_for_agents,":enemy_horse"),
			(agent_is_alive,":enemy_horse"),#Make sure he's not dead
			(neg|agent_is_human, ":enemy_horse"),
			(agent_get_item_id,":enemy_horse_type",":enemy_horse"),
			(neg|is_between, ":enemy_horse_type", camels_begin,camels_end),
			(agent_get_position, pos1,":enemy_horse"),
			(get_distance_between_positions,":dist",pos1,pos2),#In CM
			(le,":dist",3500),#Within 35m
			(store_random_in_range,":chance",1,11),
			(try_begin),
				(agent_get_rider,":enemy_rider",":enemy_horse"),
				(gt, ":enemy_rider", -1),
				(agent_get_troop_id,":enemy_rider",":enemy_rider"),
				(store_skill_level,":riding","skl_riding",":enemy_rider"),
				(val_add,":chance",":riding"),
			(try_end),
			(lt, ":chance", 10),
			(agent_set_animation,":enemy_horse","anim_horse_rear"),
		(try_end),
	(try_end),
	]
)
 
Hi, I followed the tutorial but it did not work. I am assuming that the problem is...
Then call horses_spook in every mission type you want this to happen in.  Obviously, it doesn't matter in sieges.
As I have not really mastered the Module System I do not really know how to call horses_spook in battle. I can imagine it to be quite simple but I do not have the knowledge to do it and I have been looking around the MS for clues but with no success. I would appreciate some help with this.  :smile:
 
Back
Top Bottom