Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
again, anybody now how to fix it?
Code:
common_regeneration = (1, 0, 0, [], [
	(get_player_agent_no,":player_agent"),
    (try_for_agents, ":agent"),
		(agent_is_active, ":agent"),
		(agent_is_alive, ":agent"),
		(agent_is_human, ":agent"),
		(neg|agent_is_routed, ":agent"),
		(agent_get_troop_id, ":troop", ":agent"),
		(try_begin),#player
			(eq, ":agent", ":player_agent"),
			(assign, ":regen_rate", "$player_regen_rate"),
		(else_try),#heroes
			(troop_is_hero,":troop"),
			(eq, "$hero_health_regen", 1),
			(try_begin),#kings
				(this_or_next|is_between, ":troop", kings_begin, kings_end),
				(is_between, ":troop", pretenders_begin, pretenders_end),
				(assign, ":regen_rate", 5),
			(else_try),#lords
				(is_between, ":troop", lords_begin, lords_end),
				(assign, ":regen_rate", 3),
			(else_try),#other heroes
				(assign, ":regen_rate", 2),
			(try_end),
		(else_try),#regulars
			(eq, "$regular_health_regen", 1),
			(assign, ":regen_rate", 1),
			(val_div, ":regen_rate", 2),
		(try_end),
		(gt, ":regen_rate", 0),
		(store_agent_hit_points, ":agent_health", ":agent", 0),
		(val_add, ":agent_health", ":regen_rate"),
		(agent_set_hit_points, ":agent", ":agent_health", 0),
    (try_end),
  ])
# EGIII ABILITIES Begin
abilities_help1 = (0, 0, 0,[(key_clicked, "$key_abilities_help"),
	(eq, "$abilities_help", 1),
	(store_add, ":string", "$key_abilities_rage", "str_0x02"),
	(str_store_string, s1, ":string"),
	(store_add, ":string", "$key_abilities_focus", "str_0x02"),
	(str_store_string, s2, ":string"),
	(store_add, ":string", "$key_abilities_sprint", "str_0x02"),
	(str_store_string, s3, ":string"),
	(store_add, ":string", "$key_abilities_horse_whistle", "str_0x02"),
	(str_store_string, s4, ":string"),
	(store_add, ":string", "$key_abilities_first_aid", "str_0x02"),
	(str_store_string, s5, ":string"),
	(store_add, ":string", "$key_abilities_battlecry", "str_0x02"),
	(str_store_string, s6, ":string"),
	(store_add, ":string", "$key_abilities_warcry", "str_0x02"),
	(str_store_string, s7, ":string"),
	(store_add, ":string", "$key_abilities_taunt", "str_0x02"),
	(str_store_string, s8, ":string"),
	(store_add, ":string", "$key_abilities_help", "str_0x02"),
	(str_store_string, s9, ":string"),], [
	(tutorial_message, "@Combat abilities:^^{s1} : RAGE, +5 Power strike, +5 Power throw, +5 Agility, lasts for 2xStrength sec, requires 14 Strength ^^{s2} : FOCUS, +10xIntelligence to weapon proficiencies, +5 Agility, lasts for 2xIntelligence sec, requires 14 Intelligence ^^{s3} : SPRINT, +7 Athletics, +15 Agility, lasts for 2xAgility seconds, requires 14 Agility ^^{s4} : WHISTLE FOR HORSE, call a horse to come to you, more than one with higher Charisma, requires 14 Charisma ^^{s5} : FIRST AID, treat your immediate wounds to recover 3xFirstAid+Intelligence hitpoints, requires 14 Intelligence ^^{s6} : BATTLECRY, rally your wounded troops to fight and recover 3xLeadership+Charisma percent of their hitpoints ^^{s7} : WARCRY, unleash a fearsome cry to terrify weaker oppnents around you ^^{s8} : TAUNT, attract the attention of your enemies, more with higher charisma^^All combat abilites can be used every 60 seconds in battle ^^Press {s9} to close help."),
	(assign, "$abilities_help", 0),
	])
abilities_help2 = (0, 1, 0,[(key_clicked, "$key_abilities_help"),(eq, "$abilities_help", 0)], [
	(assign, "$abilities_help", 1),
	(tutorial_message, "@ "),
	(store_add, ":string", "$key_abilities_help", "str_0x02"),
	(str_store_string, s9, ":string"),
	(display_message,"@Press {s9} for help",0x6495ed),
	])
abilities_help3 = (1, 3, ti_once, [], [
	(assign, "$abilities_help", 1),
	(store_add, ":string", "$key_abilities_help", "str_0x02"),
	(str_store_string, s9, ":string"),
	(display_message,"@Press {s9} for help",0x6495ed), 
	(assign, "$ability", 1),
	])
abilities_horse_whistle = (0, 0, 60, [(key_clicked, "$key_abilities_horse_whistle"),(store_attribute_level,"$attribute","$g_player_troop",3),(ge,"$attribute",14),(neg|main_hero_fallen)], [
	(play_sound,"snd_horse_low_whinny"),
	(get_player_agent_no, ":player_agent"),
	(agent_get_position, pos1, ":player_agent"),
	(store_sub,":ch_bonus","$attribute",14),
	(val_div,":ch_bonus",-2),
	(assign,":whistled",":ch_bonus"),
	(try_for_agents,":agent"),
		(agent_is_alive,":agent"),
		(neg|agent_is_human,":agent"),
		(lt,":whistled",1),
		(agent_get_position, pos2, ":agent"),
		(get_distance_between_positions,":distance",pos2,pos1),
		(ge,":distance",250),
		(agent_set_scripted_destination,":agent",pos1,1),
		(val_add,":whistled",1),
	(try_end),
	(gt,":whistled",0),
	(display_message,"@You whistle for a horse!",0x6495ed),	
	(call_script, "script_sprint_exp_penalty"),   
	])
# EGIII ABILITIES End
common_damage_system1 = (ti_on_agent_hit, 0, 0, [],[
	(store_trigger_param_1, ":agent"),
	(store_trigger_param_2, ":attacker"),	
	(store_trigger_param_3, ":damage"),
	(store_trigger_param_3, ":orig_damage"),
	(agent_get_troop_id, ":troop", ":agent"),
	(agent_get_troop_id, ":attacker_troop", ":attacker"),	
	(assign, ":dodged", 0),
	(agent_is_active,":agent"),#stop accidental CTD
	(agent_is_alive,":agent"),#same diff
	(agent_is_active,":attacker"),#stop accidental CTD
	(agent_is_alive,":attacker"),#same diff
	(try_begin),#Damage is avoided 3% per point of Athletics
		(ge, "$dodge_rate", 1),
		(agent_is_human, ":agent"),#stop if not human
		(store_skill_level, ":athletics",  "skl_athletics", ":troop"),
		(gt, ":athletics", 0),	
		(val_mul, ":athletics", "$dodge_rate"),
		(store_random_in_range, ":random_no", 1, 100),
		(le, ":random_no", ":athletics"),
		(assign, ":dodged", 1),
		(try_begin),
			(eq, ":troop", "trp_player"),
			(display_message, "@You dodge the attack!"),
		(else_try),
			(eq, ":attacker_troop", "trp_player"),
			(display_message, "@{He/She} dodges the attack!"),
		(try_end),			
	(else_try),#if not dodged
		(try_begin),#Critical hits for missiles
			(ge, "$missile_critical_damage", 1),
			(this_or_next|is_between, reg0, "itm_arrows", "itm_cartridges"),
			(eq, reg0, "itm_cartridges"),
			(store_random_in_range, ":random_no", 1, 100),
			(try_begin),
				(le, ":random_no", 5),
				(val_max, ":damage", "$missile_critical_damage"),
				(assign, reg1, "$missile_critical_damage"),
				(eq, ":troop", "trp_player"),
				(display_message, "@{He/She} delivered {reg1} damage with a critical hit!"),
			(else_try),
				(eq, ":attacker_troop", "trp_player"),
				(display_message, "@You delivered {reg1} damage with a critical hit!"),
			(try_end),
		(try_end),
		(agent_is_human, ":agent"),#stop if not human
		(try_begin),#Random knockdown, with STR used to test
			(eq, "$knockdown_on", 1),
			(neg|is_between, reg0, "itm_arrows", "itm_cartridges"),
			(neq, reg0, "itm_cartridges"),
			(store_attribute_level,":strength",":attacker_troop",ca_strength),
			(store_attribute_level,":enemy_strength",":troop",ca_strength),
			(store_sub, ":strength_test", ":strength", ":enemy_strength"),
			(val_max, ":strength_test", 2),#2 percent knockdown chance, if the atacker is weaker than the defender.
			(store_random_in_range, ":random", 1, 100),
			(neg|agent_is_ally,":agent"),#don't knock down allies
			(agent_is_human, ":agent"),#stop if not human			
			(agent_get_horse, ":horse", ":agent"),
			(eq, ":horse", -1),#don't knock down riders, maybe write some "lose yer horse" code later	
			(le, ":random", ":strength_test"),
			(agent_set_animation, ":agent","anim_shield_strike"),
			(try_begin),
				(eq, ":troop", "trp_player"),
				(display_message, "@{He/She} knocked you down!"),
			(else_try),
				(eq, ":attacker_troop", "trp_player"),
				(display_message, "@You knocked {him/her} down!"),
			(try_end),
		(try_end),
		(try_begin),#Damage is lowered 3% per point of Ironflesh.
			(ge, "$ironskin_rate", 1),
			(agent_is_human, ":agent"),#stop if not human
			(store_skill_level, ":ironflesh",  "skl_ironflesh", ":troop"),
			(gt, ":ironflesh", 0),
			(val_mul, ":ironflesh", "$ironskin_rate"),
			(assign, ":mod_damage", ":damage"),		
			(val_mul, ":mod_damage", ":ironflesh"),
			(val_div, ":mod_damage", 100),#Rounded here, but whatever.
			(assign, reg1, ":damage"),
			(val_sub, ":damage", ":mod_damage"),
			(assign, reg2, ":damage"),
			(try_begin),
				(eq, ":troop", "trp_player"),
				(display_message, "@Because of your ironflesh skill, you received {reg2} damage instead of {reg1}!"),
			(else_try),
				(eq, ":attacker_troop", "trp_player"),
				(display_message, "@Because of {his/her} ironflesh skill, {he/she} received {reg2} damage instead of {reg1}!"),
			(try_end),			
		(try_end),
	(else_try),#if not human
		(neg|agent_is_human, ":agent"),
#		(try_begin),#Pike special rules
#			(is_between, reg0, "itm_pikes_start", "itm_pikes_end"),
#			(val_min, ":damage", 100),
#		(try_end),
		(try_begin),#Horses randomly rear if they take damage
			(eq, "$random_rear_on", 1),
			(store_random_in_range, ":random_no", 1, 100),
			(gt, ":damage", 5),
			(le, ":random_no", 10),
			(agent_set_animation, ":agent","anim_horse_rear"),
		(try_end),
	(try_end),
	(store_sub, ":diff_damage", ":damage", ":orig_damage"),
	(store_agent_hit_points, ":hitpoints" , ":agent", 1),
	(val_sub, ":hitpoints", ":diff_damage"),
	(try_begin),#if dodged
		(eq, ":dodged", 1),
		(store_agent_hit_points, ":current_hp", ":agent", 1),#store current health
		(agent_set_hit_points,":agent",100,0),#100% health
		(store_agent_hit_points, ":max_hp", ":agent", 1),#store max health
		(agent_set_hit_points,":agent",":current_hp",1),
		(ge, ":damage", ":max_hp"), #arbitrary output register - damage will be overkill
		(agent_set_slot, ":agent", slot_agent_avoid, ":current_hp"), #inside slot
		(agent_set_no_death_knock_down_only, ":agent", 1), #disable death
	(else_try),	
		(agent_set_hit_points,":agent",":hitpoints",1),
	(try_end),
	])
common_damage_system2 = (ti_on_agent_knocked_down, 0, 0,[],[
	(store_trigger_param_1, ":agent"),
	(agent_get_slot, ":hp", ":agent", slot_agent_avoid),
	(ge, ":hp", 1), #this slot was marked
	(agent_set_slot, ":agent", slot_agent_avoid, 0),
	(agent_set_hit_points, ":agent", ":hp", 1), #restore hp
	(agent_set_no_death_knock_down_only, ":agent", 0),
	])
theoris_decapitation = (ti_on_agent_hit, 0, 0, [],[
   	(store_trigger_param_1, ":agent"),
   	(store_trigger_param_3, ":damage"),
	(agent_is_human, ":agent"),
	(store_agent_hit_points, ":hp", ":agent", 1),
	(ge, ":damage", 30),
	(ge, ":damage", ":hp"),
	(agent_get_position, pos1, ":agent"),
	(get_distance_between_positions, ":distance", pos1, pos0),
	(is_between, ":distance", 160, 176), # *zing*
	(agent_get_item_slot, ":item", ":agent", 4), #head slot
	(try_begin),
	    (ge, ":item", 1),
		(agent_unequip_item, ":agent", ":item"),
	(try_end),
	(agent_equip_item, ":agent", "itm_invisible_head"),
	(particle_system_burst, "psys_game_blood_2", pos1, 125), #Yeah..
	#(set_spawn_position, pos1),
	#(spawn_scene_prop, "spr_physics_head"),
	])
Code:
custom_commander_commom_triggers = [
    #custom_commander_camera,
    custom_commander_init_hero_begin_xp,
...
    custom_commander_give_hero_extra_xp,
    dplmc_horse_speed,
	deploy_pavise,
#################################################################################################################
# Floris Improved Mod Pack (FIMP) 0.2 begin ->																	#
#################################################################################################################
	common_regeneration,
	abilities_help1,
	abilities_help2,
	abilities_help3,
	abilities_horse_whistle,
	abilities_taunt1,
	abilities_taunt2,
	abilities_warcry1,
	abilities_warcry2,
	abilities_first_aid,
	abilities_battlecry1,
	abilities_battlecry2,
	abilities_rage1,
	abilities_rage2,
	abilities_rage3,
	abilities_sprint1,
	abilities_sprint2,
	abilities_sprint3,
	abilities_focus1,
	abilities_focus2,
	abilities_focus3,
	common_damage_system1,
	common_damage_system2,
	theoris_decapitation,
#################################################################################################################
# Floris Improved Mod Pack (FIMP) 0.2 end <-																	#
#################################################################################################################
  ]
when I disable this it works:
Code:
	abilities_help1,
	abilities_help2,
	abilities_help3,
	abilities_horse_whistle,
#	abilities_taunt1,
#	abilities_taunt2,
#	abilities_warcry1,
#	abilities_warcry2,
	abilities_first_aid,
#	abilities_battlecry1,
#	abilities_battlecry2,
#	abilities_rage1,
#	abilities_rage2,
#	abilities_rage3,
#	abilities_sprint1,
#	abilities_sprint2,
#	abilities_sprint3,
#	abilities_focus1,
#	abilities_focus2,
#	abilities_focus3,
	common_damage_system1,
	common_damage_system2,
	theoris_decapitation,

the errors are:
Code:
Initializing...
Compiling all global variables...
Error in mission template:
('town_default', 0, -1, 'Default town visit', [(0, 4100, 256, 0, 1, [159, 158, 2
5, 541]), (1, 4100, 256, 0, 1, []), (2, 4100, 256, 0, 1, []), (3, 4100, 256, 0,
1, []), (4, 4100, 256, 0, 1, []), (5, 4100, 256, 0, 1, []), (6, 4100, 256, 0, 1,
 []), (7, 4100, 256, 0, 1, []), (8, 4, 256, 0, 1, []), (9, 4, 256, 0, 1, []), (1
0, 4, 256, 0, 1, []), (11, 4, 256, 0, 1, []), (12, 4, 256, 0, 1, []), (13, 4, 0,
 0, 1, []), (14, 4, 0, 0, 1, []), (15, 4, 0, 0, 1, []), (16, 16, 256, 0, 1, []),
 (17, 16, 256, 0, 1, []), (18, 16, 256, 0, 1, []), (19, 16, 256, 0, 1, []), (20,
 16, 256, 0, 1, []), (21, 16, 256, 0, 1, []), (22, 16, 256, 0, 1, []), (23, 16,
256, 0, 1, []), (24, 16, 256, 0, 1, []), (25, 16, 256, 0, 1, []), (26, 16, 256,
0, 1, []), (27, 16, 256, 0, 1, []), (28, 16, 256, 0, 1, []), (29, 16, 256, 0, 1,
 []), (30, 16, 256, 0, 1, []), (31, 16, 256, 0, 1, [])], [(1, 0, 100000000.0, []
, [(2211, ':cur_scene'), (503, ':cur_scene', 0, 1), 4, (31, '$sneaked_into_town'
, 1), (1, 'script_music_set_situation_with_culture', 16384), 5, (31, '$talk_cont
ext', 14), (1, 'script_music_set_situation_with_culture', 512), 5, (1, 'script_m
usic_set_situation_with_culture', 8192), 3]), (-19.0, 0, 0, [], [(1, 'script_cha
nge_banners_and_chest'), (1, 'script_initialize_tavern_variables')]), (-22.0, 0,
 0, [(2075, 1)], []), (1, 0, 0, [(32, '$g_belligerent_drunk_leaving', 0), (1780,
 0, 0), (1710, 1, '$g_belligerent_drunk_leaving'), (710, ':dist', 0, 1), (214748
3680L, ':dist', 150)], [(1749, '$g_belligerent_drunk_leaving'), (2133, '$g_belli
gerent_drunk_leaving', 0)]), (-21.0, 0, 0, [4, (31, '$g_main_attacker_agent', 0)
, (2075, 1), 3], []), (2, 0, 0, [2147483690L, (31, '$talk_context', 14), (214748
4188L, 'trp_hired_assassin', 12, '$g_encountered_party'), (540, 'trp_belligerent
_drunk', 12, '$g_encountered_party'), (31, '$drunks_dont_pick_fights', 0)], [4,
(31, '$g_start_belligerent_drunk_fight', 0), (2133, '$g_start_belligerent_drunk_
fight', 1), (12, ':cur_agent'), (1718, ':cur_agent_troop', ':cur_agent'), (31, '
:cur_agent_troop', 'trp_belligerent_drunk'), (2133, '$g_belligerent_drunk', ':cu
r_agent'), 3, 5, (31, '$g_start_belligerent_drunk_fight', 1), (1712, '$g_bellige
rent_drunk'), (1702, '$g_belligerent_drunk'), (1700, ':player_agent'), (1710, 0,
 ':player_agent'), (1710, 1, '$g_belligerent_drunk'), (710, ':dist', 0, 1), (728
, ':pos0_z', 0), (728, ':pos1_z', 1), (2121, ':z_difference', ':pos1_z', ':pos0_
z'), 4, (2147483680L, ':z_difference', 0), (2107, ':z_difference', -1), 3, (2122
, ':z_difference_mul_3', ':z_difference', 3), (2105, ':dist', ':z_difference_mul
_3'), (2136, ':random_value', 0, 200), (2120, ':400_plus_random_200', 400, ':ran
dom_value'), (2147483680L, ':dist', ':400_plus_random_200'), (1, 'script_activat
e_tavern_attackers'), (1920, 'trp_belligerent_drunk'), (2133, '$g_start_belliger
ent_drunk_fight', 2), 3]), (2, 0, 0, [2147483690L, (31, '$talk_context', 14), (5
40, 'trp_hired_assassin', 12, '$g_encountered_party')], [4, (31, '$g_start_hired
_assassin_fight', 0), (2133, '$g_start_hired_assassin_fight', 1), (12, ':cur_age
nt'), (1718, ':cur_agent_troop', ':cur_agent'), (31, ':cur_agent_troop', 'trp_hi
red_assassin'), (2133, '$g_hired_assassin', ':cur_agent'), 3, 5, (31, '$g_start_
hired_assassin_fight', 1), (1712, '$g_hired_assassin'), (1702, '$g_hired_assassi
n'), (1700, ':player_agent'), (1710, 0, ':player_agent'), (1710, 1, '$g_hired_as
sassin'), (710, ':dist', 0, 1), (728, ':pos0_z', 0), (728, ':pos1_z', 1), (2121,
 ':z_difference', ':pos1_z', ':pos0_z'), 4, (2147483680L, ':z_difference', 0), (
2107, ':z_difference', -1), 3, (2122, ':z_difference_mul_3', ':z_difference', 3)
, (2105, ':dist', ':z_difference_mul_3'), (2136, ':random_value', 0, 200), (2120
, ':400_plus_random_200', 400, ':random_value'), (2147483680L, ':dist', ':400_pl
us_random_200'), (1, 'script_activate_tavern_attackers'), (2133, '$g_start_hired
_assassin_fight', 2), 3]), (3, 0, 100000000.0, [2147483690L, (31, '$talk_context
', 14), (32, '$g_main_attacker_agent', 0), (3221227174L, '$g_main_attacker_agent
'), (1703, '$g_main_attacker_agent')], [1935, (12, ':agent'), (1702, ':agent'),
(1710, 4, ':agent'), (1730, ':agent', 4), 3, (521, ':tavernkeeper', '$g_encounte
red_party', 20), (1920, ':tavernkeeper')]), (3, 0, 100000000.0, [2147483690L, (3
1, '$talk_context', 14), (32, '$g_main_attacker_agent', 0), 1006], [(2060, 'mnu_
lost_tavern_duel'), (1907, 0)]), (1, 0, 0, [2147483690L, (31, '$talk_context', 1
4), (32, '$g_main_attacker_agent', 0), (1700, ':player_agent'), (1702, ':player_
agent'), (1726, ':wielded_item', ':player_agent', 0), (33, ':wielded_item', 'itm
_darts', 'itm_torch'), (2147483679L, ':wielded_item', 'itm_javelin_melee'), (214
7483679L, ':wielded_item', 'itm_throwing_spear_melee'), (2147483679L, ':wielded_
item', 'itm_jarid_melee'), (2147483679L, ':wielded_item', 'itm_light_throwing_ax
es_melee'), (2147483679L, ':wielded_item', 'itm_throwing_axes_melee'), (21474836
79L, ':wielded_item', 'itm_heavy_throwing_axes_melee')], [(521, ':tavernkeeper',
 '$g_encountered_party', 20), (1920, ':tavernkeeper')]), (1, 0, 0, [(32, '$g_mai
n_attacker_agent', 0)], [(1726, ':wielded_item', '$g_main_attacker_agent', 0), (
2111, '$g_attacker_drawn_weapon', ':wielded_item'), (1, 'script_neutral_behavior
_in_fight')]), (0, 0, 100000000.0, [], [(12, ':agent_no'), (1704, ':agent_no'),
(1718, ':troop_no', ':agent_no'), (1507, ':troop_no'), (1515, ':troop_xp', ':tro
op_no'), (500, ':troop_no', 329, ':troop_xp'), 3]), (1, 0, 0, [], [(1700, ':play
er_agent'), (12, ':agent_no'), (1704, ':agent_no'), (1718, ':troop_no', ':agent_
no'), (1507, ':troop_no'), (1515, ':troop_xp', ':troop_no'), (520, ':troop_extra
_xp_limit', ':troop_no', 329), (32, ':troop_xp', ':troop_extra_xp_limit'), (2121
, ':xp_dif', ':troop_xp', ':troop_extra_xp_limit'), (2172, ':troop_int', ':troop
_no', 2), (2122, ':extra_xp', ':troop_int', 3), (2107, ':extra_xp', ':xp_dif'),
(2108, ':extra_xp', 100), (1107, 0), (1062, ':extra_xp', ':troop_no'), (1107, 1)
, 4, (31, ':agent_no', ':player_agent'), (32, ':extra_xp', 0), (31, '$g_report_e
xtra_xp_and_wpt', 1), (2133, 72057594037927937L, ':extra_xp'), (1106, '@You got
{reg1} extra experience because of your intelligence.'), 3, (1515, ':troop_final
_xp', ':troop_no'), (500, ':troop_no', 329, ':troop_final_xp'), (2121, ':wpn_poi
nts_add', ':troop_final_xp', ':troop_extra_xp_limit'), (2170, ':skill_level', 27
, ':troop_no'), (2105, ':skill_level', 10), (2107, ':wpn_points_add', ':skill_le
vel'), (2108, ':wpn_points_add', 20), (2108, ':wpn_points_add', 100), (32, ':wpn
_points_add', 0), (1525, ':troop_no', ':wpn_points_add'), 4, (31, ':agent_no', '
:player_agent'), (31, '$g_report_extra_xp_and_wpt', 1), (2133, 72057594037927937
L, ':wpn_points_add'), (2121, 72057594037927938L, 72057594037927937L, 1), (1106,
 '@You got {reg1} weapon {reg2?points:point}.'), 3, 3]), (1, 0, 0, [], [(1700, '
:player_agent'), (12, ':agent_no'), (2147483679L, ':agent_no', ':player_agent'),
 (1702, ':agent_no'), (1704, ':agent_no'), (1727, ':agent_ammo', ':agent_no'), (
545, ':agent_no', 26, 0), (2147483680L, ':agent_ammo', 1), (1728, ':agent_no'),
(505, ':agent_no', 26, 1), 3]), (0, 0, 0, [], [4, (70, 29), (71, 30), (1700, ':p
layer_agent'), (1728, ':player_agent'), 5, (70, 56), (71, 30), (12, ':agent_no')
, (1728, ':agent_no'), 3]), (-19.0, 0, 0, [], [(1, 'script_change_rain_or_snow')
, (541, 'p_main_party', 107, 1), (1, 'script_cf_weather_affect_proficiency', 720
57594037927936L, 72057594037927937L)]), (0, 0, 100000000.0, [(2147483679L, '$g_p
layer_troop', 'trp_player')], [(2120, ':wpt_end', 6, 1), (6, ':weapon_type', 0,
':wpt_end'), (2176, ':weapon_proficiency', '$g_player_troop', ':weapon_type'), (
507, ':weapon_type', 68, ':weapon_proficiency'), 3]), (1, 0, 0, [(2147483679L, '
$g_player_troop', 'trp_player')], [(2322, 1, '$g_player_troop'), (2120, ':wpt_en
d', 6, 1), (6, ':weapon_type', 0, ':wpt_end'), (2176, ':cur_weapon_proficiency',
 '$g_player_troop', ':weapon_type'), (527, ':weapon_proficiency', ':weapon_type'
, 68), (32, ':cur_weapon_proficiency', ':weapon_proficiency'), (2121, ':amout',
':cur_weapon_proficiency', ':weapon_proficiency'), (2133, 72057594037927938L, ':
amout'), (2106, ':amout', 1), (2133, 72057594037927939L, ':amout'), (2133, 72057
594037927937L, ':cur_weapon_proficiency'), (2121, ':out_string', ':weapon_type',
 0), (2105, ':out_string', 'str_one_handed_weapon'), (2320, 2, ':out_string'), (
1106, "@{reg3?{s1}'s proficiency in {s2}has improved by {reg2} to {reg1}.:{s1}'s
 {s2}proficiency have reach to {reg1}.}", 15658496), (507, ':weapon_type', 68, '
:cur_weapon_proficiency'), 3]), (0.1, 0, 0, [], [(1700, ':player_agent'), (12, '
:agent_no'), (1704, ':agent_no'), (1702, ':agent_no'), (1718, ':troop_no', ':age
nt_no'), (1, 'script_agent_troop_get_banner_mesh', ':agent_no', ':troop_no'), (2
133, ':cur_banner', 72057594037927936L), (2120, ':arms_meshes_end', 'mesh_arms_f
21', 1), 4, (33, ':cur_banner', 'mesh_arms_a01', ':arms_meshes_end'), (2106, ':c
ur_banner', 'mesh_arms_a01'), (2105, ':cur_banner', 'spr_banner_a_back'), 5, (21
33, ':cur_banner', -1), 3, 4, (1716, ':agent_party', ':agent_no'), (2147483680L,
 ':agent_party', -1), 4, (31, ':troop_no', 'trp_player'), (2147483679L, ':agent_
no', ':player_agent'), 5, (2133, ':cur_banner', -1), 3, 3, 4, (31, ':agent_no',
':player_agent'), 4, (31, '$g_player_carry_banner', 0), (2133, ':cur_banner', -1
), 3, 5, (31, '$g_others_carry_banner', 0), (2133, ':cur_banner', -1), 5, (31, '
$g_others_carry_banner', 1), 4, (2147485155L, ':troop_no'), (2133, ':cur_banner'
, -1), 3, 5, (31, '$g_others_carry_banner', 2), 4, (2147485354L, ':agent_no'), (
2133, ':cur_banner', -1), 3, 3, (32, ':cur_banner', -1), (1756, ':attached_banne
r', ':agent_no'), 4, (2147483680L, ':attached_banner', -1), (1810, ':instance_no
', ':cur_banner'), (1974, ':cur_banner'), (505, ':agent_no', 28, ':cur_banner'),
 (505, ':agent_no', 29, ':instance_no'), (1811, ':cur_banner_prop_instance', ':c
ur_banner', ':instance_no'), (1757, ':agent_no', ':cur_banner_prop_instance'), (
1758, ':agent_no', 0), (1759, ':agent_no', 130), 5, (525, ':cur_banner', ':agent
_no', 28), (525, ':instance_no', ':agent_no', 29), (1811, ':cur_banner_prop_inst
ance', ':cur_banner', ':instance_no'), (1757, ':agent_no', ':cur_banner_prop_ins
tance'), (1758, ':agent_no', 0), (1759, ':agent_no', 130), 3, 3]), (-26.0, 0, 0,
 [], [(2071, ':agent_no'), (1756, ':attached_banner', ':
 
I was browsing around in youtube, and I found this video of a guy using kinect to play Mount & Blade and his mic to give voice commands to his troops.

http://www.youtube.com/watch?v=ZWGhN99BJBE&feature=related

Now, I dont' really care about the motion sensor stuff and all that, because I don't think it can work out well and I'm fine with my mouse and keyboard. But I AM interested in the voice commands though.

Would it be possible to somehow implement this to warband? Via 3rd party programs or whatever?
I think it'd be really awesome since the menu system we're using for orders is kinda annoying to get used to, especially when using the expanded one in some mods.

 
This script here is the consequences block from a trigger. But ingame, i get an error "invalid player id -1"

(try_begin),
        (eq, "$staff", "itm_heal_staff_1"),
(assign, ":max_range", 600),
(assign,":real_target",0),
(get_player_agent_no, ":agent"),
(agent_get_player_id,":player",":agent"),
(player_get_team_no,  ":team_no", ":player"),

(agent_get_position,pos6,":agent"),
(try_for_agents,":target"),
(agent_is_active,":target"),
(agent_is_alive,":target"),
(agent_get_player_id,":target_player",":target"),
(player_get_team_no,  ":target_team_no", ":target_player"),

(eq,":target_team_no",":team_no"),
(store_agent_hit_points,":cur_life",":target"),
(lt,":cur_life",100),
(agent_get_position,pos7,":target"),
(try_begin),
(neq|position_is_behind_position,pos6,pos7),
(get_distance_between_positions,":dist",pos6,pos7),
(try_end),
(try_begin),
(le, ":dist",":max_range"),
(assign,":max_range",":dist"),
(assign,":target",":real_target"),
(try_end),
(try_end),
(try_begin),
(neq,":real_target",0),
(display_message,"@var real_target ist nicht 0",0x6495ed),
(store_agent_hit_points,":target_life",1),
(val_add,":target_life",40),
(agent_set_hit_points,":real_target",":target_life",1),
(display_message,"@target healed",0x6495ed),
(try_end),
(end_try),

edit: wrong key -.-
ok, so now the rest of the text i wanted to write:
i marked the pieces of the code where i think the error must be in red and made them fat. One of those must give back the player ID -1 and so the next line can't be executed. Because of this, the script where the target is healed and where the messages are printed is not executed. Could someone help me with this?
 
I hope you can answer this.
I had understood about Global Variable after one long month  :lol:. Thank you Caba'Drin and Ikaguia.

I want to made some features in my mod, Then I tried and i Want to made it activate with the maximal "Luck" (in game) is 100. I think "slot" code is suit, like "slot_troops". And what is for "Luck"?
 
I am not sure if I understand right. You ask for how the code handles luck, right?

It's a global. Inside module_simple_trigger you can find this.

Code:
# Reducing luck by 1 in every 180 hours
  (180,
   [
     (val_sub, "$g_player_luck", 1),
     (val_max, "$g_player_luck", 0),
    ]),

 
Patta said:
(get_player_agent_no, ":agent"),
(agent_get_player_id,":player",":agent"),
You should use multiplayer_get_my_player instead, as I think get_player_agent_no doesn't work in some situations with multiplayer, from memory.
Patta said:
(agent_get_player_id,":target_player",":target"),
(player_get_team_no,  ":target_team_no", ":target_player"),
The agent could be a horse or a bot, so you must always use player_is_active when getting player ids from a try_for_agents loop (and anywhere else you are not absolutely sure it is a player agent). Alternatively, you could also use agent_get_team instead, so bots work too.

But the script is flawed: multiplayer_get_my_player only returns a valid id on a client, and you can only adjust hit points on the server; you need to either run the whole thing on the server (from ti_on_agent_hit or an item attack trigger), using the parameter agent id, or have a client key press trigger send a message to the server, which performs the action.
 
IT_magic_system_2 = (0, 0, 30, #every frame
      [
      (key_clicked, key_j), #could use global var, game_key, or something - see list in header_triggers
      (get_player_agent_no, ":agent"), 
      (agent_get_wielded_item, "$staff", ":agent", 0),
      ],
That is the beginning from the trigger, with the consequences block i posted before directly after it.

edit: ###

edit2: Wrong way round, forget edit1

So about that thing with "get_player_agent_no", it seems to work in that conditions block in the trigger... Had no problems with it till now.
 
I have a bit a of a problem with sounds right now. Before, they used to work properly. Now, when a player shoots, it sounds like the sound is coming right next to you, even though the player is far away. First thing I checked was the the sounds were mono, some of them weren't but I changed them. No affect. Sounds work for bots, but for some reason, it's messed up now for players and I have no idea. One player said that the sounds work for him, other said that he can't always hear sounds. Here are the codes I use:

Server Side
Code:
      (else_try),
        (eq, ":event_type", multiplayer_event_sound_at_player),
		
		(this_or_next|neq,":player_no",0),
		(neg|multiplayer_is_dedicated_server),
		
		#(display_message,"@player trying to shoot"),
		(store_script_param,":sound",3),
		(get_max_players, ":num_players"),
      
                   (try_for_range, ":player_no2", 0, ":num_players"),
                      (this_or_next|neq,":player_no2",0),
                      (neg|multiplayer_is_dedicated_server),

                      (player_is_active, ":player_no2"),
                      (multiplayer_send_2_int_to_player, ":player_no2", multiplayer_event_player_play_sound, ":sound", ":player_no"),
                   (try_end),

      
      (else_try),

Client side

Code:
		(else_try),
		  (eq, ":event_type", multiplayer_event_player_play_sound),
		  #(display_message,"@Bang!"),
		  (store_script_param, ":sound", 3),
		  (store_script_param, ":player", 4),
		  (player_get_agent_id,":agent",":player"),
		  (try_begin),
		      (neg|is_between, ":agent", 0, 200),
			  (play_sound, ":sound", 0),
		  (else_try),
			  (neq,":agent",-1),
			  (agent_is_alive,":agent"),
			  (agent_play_sound,":agent",":sound"),
		  (end_try),
      
        (else_try),

Item code:

Code:
["kar98", "Kar98", [("kar98",0)], itp_type_musket |itp_merchandise|itp_primary|itp_ignore_gravity|itp_next_item_as_melee ,itcf_shoot_musket|itcf_reload_musket|itcf_carry_spear, 650 , weight(6)|difficulty(0)|spd_rtng(30) | shoot_speed(150) | thrust_damage(90 ,pierce)|max_ammo(5)|accuracy(120),imodbits_none,
 [(ti_on_weapon_attack, [(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_k98"),(position_move_y, pos1,75)])]],
 
edit: how stupid i am :wink: Forget everything i wrote here...

edit2: so, what exactly are the options you can use as the second parameter in the script?

edit3: (agent_play_sound,":agent",":sound"),
That is what i found in the operations file, I use that and it seems to work, even though i get an error with a player id or something, but that is a problem i can fix alone i think...
 
Status
Not open for further replies.
Back
Top Bottom