Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Aleolex 说:
Lav has a lot of modules, is there a specific one I should download or will any of them work?

link to general downloads: https://forums.taleworlds.com/index.php/topic,326973.0.html

look for "Download Warband Module System 1.166 (bugfixed and tweaked by Lav)."

Lav's uses the modsys from TW and makes it more organized/adds more comments. Last release is for 1.166, which means it is missing stuff from 1.167 and 1.168 (which you can get from VC modules)
 
How can i make something random?Specificaly (misspeled LOL) i want "Thieving operations" in town menu and when player selects that another list of menus pops up and when he selects specific one he gets money between 50-1500 denars but i want something like chances are bigger that you gel less money or at leas that is based path finding?
PS.I know to create everything i said expect part after "between 50-1500"
 
This is probably what you looking for.

插入代码块:
(store_random_in_range, <destination>, <range_low>, <range_high>),
 
EmielRegis 说:
This is

插入代码块:
(store_random_in_range, <destination>, <range_low>, <range_high>),
Yeah thats what i know how to do  :grin: i dont know hot to make that chances are bigger for smaller amount of money :grin: or even better
:the higher path find the bigger amount
 
Im not sure if i understand you correctly.

Maybe set some thresholds that will decide how big chances of sucesful heist are, based on amount of gold specifed by player.

Rolled 10 means heist was sucessfull.

gold = 100 ---> random(9-10)
100 < gold <= 200 -------------->  random(8-10)
200 < gold <= 300 -------------->  random(7-10)
300 < gold <= 400 -------------->  random(6-10)
400 < gold <= 500 -------------->  random(5-10)
etc...

Values range just for example.
 
As far as I'm understanding it, the point is that we're biasing our probability towards spawning less rewarding quests, based on Pathfinding to some extent. It would've been great if we could simply implement a Gaussian distribution and skew it as we see fit, but that's either impossible, or more probably too difficult to be worth doing.
Unfortunately, this means that you need to come up with stricter guidelines as to what "greater chances" means. Anyways, here's an example that might be used for inspiration:
插入代码块:
(store_random_in_range, ":perc", 0, 100), # Roll a d100
# Ad-hoc "three sigmas rule" done in the worst way possible
(assign, ":reward_lower", 50),
(assign, ":reward_upper", 1500),
(store_skill_level, ":pathfinding", "skl_pathfinding", "trp_player"),
(val_mod, ":pathfinding", 2),
(val_add, ":perc", ":pathfinding"), # Add the player's (Pathfinding * 2) as a straight % increase
(try_begin),
    (lt, ":perc", 67),
    (assign, ":reward_upper", 501),
(else_try),
    (lt, ":perc", 95),
    (assign, ":reward_lower", 500),
    (assign, ":reward_upper", 1001),
(else_try),
    (assign, ":reward_lower", 1000),
    (assign, ":reward_upper", 1501),
(try_end),
# 67% chance for 50-500 gold reward; 28% chance for 500-1000 gold; 5% chance for 1000-1500
(store_random_in_range, ":reward_amount", ":reward_lower", ":reward_upper"),
[...]
(note: untested, written off the top of my head, etc.)
Something like that? You can define multiple reward ranges and whatnot.
 
Im feeling really dumb right now but i just can't figure out this error
It happens on hit, what i am making is head, hand, leg decapitation and the code works fine and decaps the message is shown alright but still it gives an error on opcode pointing to agent_is_human what is like super strange

code:
插入代码块:
common_battle_decapitation = ( #head
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1),
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  #general needs end
	  (try_begin),
		(this_or_next|eq, ":bone", hb_head),
		(this_or_next|eq, ":bone2", hb_head),
		(this_or_next|eq, ":bone", hb_shoulder_l),
		(this_or_next|eq, ":bone2", hb_shoulder_l),
		(this_or_next|eq, ":bone", hb_shoulder_r),
		(eq, ":bone2", hb_shoulder_r),
		#power and helmet condition begin 
		(ge, ":damage", 32),
		#(agent_get_item_slot, ":helmet", ":agent", 4),
		#(item_get_head_armor, ":head_armor", ":helmet"),
		#(lt, ":head_armor", 40),
		#power and helmet condition end
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(spawn_scene_prop, "spr_head"),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
      
		# fake head
        (assign, ":head_id", reg0),
      
		(prop_instance_enable_physics, ":head_id", 1),
		(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
		#(agent_equip_item, ":agent", "itm_unvisible"), #unvisible helmet
		(agent_equip_item, ":agent", "itm_decaphead"),
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has beheaded {s60}!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_arms_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param, ":agent", 1), #store hitted agent
	  (store_trigger_param, ":dealer", 2), #store dealer
	  (store_trigger_param, ":damage", 3), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
			
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  (store_agent_hit_points, ":hp", ":agent", 1),
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 32), #strong blow
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  (store_random_in_range, ":dearm", 0,100),
	  (le, ":dearm", 12), #because arm decap happened 75% of the time  
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_hand_l),
		(this_or_next|eq, ":bone2", hb_hand_l),
		(this_or_next|eq, ":bone", hb_forearm_l),
		(eq, ":bone2", hb_forearm_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left hand!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_hand_r),
		(this_or_next|eq, ":bone2", hb_hand_r),
		(this_or_next|eq, ":bone", hb_forearm_r),
		(eq, ":bone2", hb_forearm_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right hand!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_legs_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 30), #strongest blow of all because legs are harder to decap
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_foot_l),
		(this_or_next|eq, ":bone2", hb_foot_l),
		(this_or_next|eq, ":bone", hb_thigh_l),
		(this_or_next|eq, ":bone2", hb_thigh_l),
	    (this_or_next|eq, ":bone", hb_calf_l),
		(eq, ":bone2", hb_calf_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		    (agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left leg!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_foot_r),
		(this_or_next|eq, ":bone2", hb_foot_r),
		(this_or_next|eq, ":bone", hb_thigh_r),
		(this_or_next|eq, ":bone2", hb_thigh_r),
	    (this_or_next|eq, ":bone", hb_calf_r),
		(eq, ":bone2", hb_calf_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
			(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right leg!", 0xff0000),
	  (try_end), 
   ]) 

error
插入代码块:
SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 111; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 111; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 111; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has chopped of Looter his right hand!
 SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 107; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 107; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 107; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has beheaded Looter!

error explanation (partly)
插入代码块:
operation 1704 equals agent_is_human #(agent_is_human,<agent_id>),
operation 1718 equals agent_get_troop_id # (agent_get_troop_id,<destination>, <agent_id>),
operation 1710 equals agent_get_position # (agent_get_position,<position_no>,<agent_id>),
 
builder of the gods 说:
Im feeling really dumb right now but i just can't figure out this error
It happens on hit, what i am making is head, hand, leg decapitation and the code works fine and decaps the message is shown alright but still it gives an error on opcode pointing to agent_is_human what is like super strange

code:
插入代码块:
common_battle_decapitation = ( #head
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1),
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  #general needs end
	  (try_begin),
		(this_or_next|eq, ":bone", hb_head),
		(this_or_next|eq, ":bone2", hb_head),
		(this_or_next|eq, ":bone", hb_shoulder_l),
		(this_or_next|eq, ":bone2", hb_shoulder_l),
		(this_or_next|eq, ":bone", hb_shoulder_r),
		(eq, ":bone2", hb_shoulder_r),
		#power and helmet condition begin 
		(ge, ":damage", 32),
		#(agent_get_item_slot, ":helmet", ":agent", 4),
		#(item_get_head_armor, ":head_armor", ":helmet"),
		#(lt, ":head_armor", 40),
		#power and helmet condition end
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(spawn_scene_prop, "spr_head"),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
      
		# fake head
        (assign, ":head_id", reg0),
      
		(prop_instance_enable_physics, ":head_id", 1),
		(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
		#(agent_equip_item, ":agent", "itm_unvisible"), #unvisible helmet
		(agent_equip_item, ":agent", "itm_decaphead"),
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has beheaded {s60}!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_arms_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param, ":agent", 1), #store hitted agent
	  (store_trigger_param, ":dealer", 2), #store dealer
	  (store_trigger_param, ":damage", 3), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
			
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  (store_agent_hit_points, ":hp", ":agent", 1),
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 32), #strong blow
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  (store_random_in_range, ":dearm", 0,100),
	  (le, ":dearm", 12), #because arm decap happened 75% of the time  
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_hand_l),
		(this_or_next|eq, ":bone2", hb_hand_l),
		(this_or_next|eq, ":bone", hb_forearm_l),
		(eq, ":bone2", hb_forearm_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left hand!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_hand_r),
		(this_or_next|eq, ":bone2", hb_hand_r),
		(this_or_next|eq, ":bone", hb_forearm_r),
		(eq, ":bone2", hb_forearm_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right hand!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_legs_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 30), #strongest blow of all because legs are harder to decap
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_foot_l),
		(this_or_next|eq, ":bone2", hb_foot_l),
		(this_or_next|eq, ":bone", hb_thigh_l),
		(this_or_next|eq, ":bone2", hb_thigh_l),
	    (this_or_next|eq, ":bone", hb_calf_l),
		(eq, ":bone2", hb_calf_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		    (agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left leg!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_foot_r),
		(this_or_next|eq, ":bone2", hb_foot_r),
		(this_or_next|eq, ":bone", hb_thigh_r),
		(this_or_next|eq, ":bone2", hb_thigh_r),
	    (this_or_next|eq, ":bone", hb_calf_r),
		(eq, ":bone2", hb_calf_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
			(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right leg!", 0xff0000),
	  (try_end), 
   ]) 

error
插入代码块:
SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 111; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 111; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 111; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has chopped of Looter his right hand!
 SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 107; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 107; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 107; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has beheaded Looter!

error explanation (partly)
插入代码块:
operation 1704 equals agent_is_human #(agent_is_human,<agent_id>),
operation 1718 equals agent_get_troop_id # (agent_get_troop_id,<destination>, <agent_id>),
operation 1710 equals agent_get_position # (agent_get_position,<position_no>,<agent_id>),

Cant find any problems in code(still checking).
But for now I can tell that you could use "agent_is_active" command to filter out invalid agent ids.
 
kalarhan 说:
Aleolex 说:
Lav has a lot of modules, is there a specific one I should download or will any of them work?

link to general downloads: https://forums.taleworlds.com/index.php/topic,326973.0.html

look for "Download Warband Module System 1.166 (bugfixed and tweaked by Lav)."

Lav's uses the modsys from TW and makes it more organized/adds more comments. Last release is for 1.166, which means it is missing stuff from 1.167 and 1.168 (which you can get from VC modules)
What stuff is it missing specifically that I would need to take from other modules?
 
builder of the gods 说:
Im feeling really dumb right now but i just can't figure out this error
It happens on hit, what i am making is head, hand, leg decapitation and the code works fine and decaps the message is shown alright but still it gives an error on opcode pointing to agent_is_human what is like super strange

code:
插入代码块:
common_battle_decapitation = ( #head
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1),
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  #general needs end
	  (try_begin),
		(this_or_next|eq, ":bone", hb_head),
		(this_or_next|eq, ":bone2", hb_head),
		(this_or_next|eq, ":bone", hb_shoulder_l),
		(this_or_next|eq, ":bone2", hb_shoulder_l),
		(this_or_next|eq, ":bone", hb_shoulder_r),
		(eq, ":bone2", hb_shoulder_r),
		#power and helmet condition begin 
		(ge, ":damage", 32),
		#(agent_get_item_slot, ":helmet", ":agent", 4),
		#(item_get_head_armor, ":head_armor", ":helmet"),
		#(lt, ":head_armor", 40),
		#power and helmet condition end
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(spawn_scene_prop, "spr_head"),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
      
		# fake head
        (assign, ":head_id", reg0),
      
		(prop_instance_enable_physics, ":head_id", 1),
		(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
		#(agent_equip_item, ":agent", "itm_unvisible"), #unvisible helmet
		(agent_equip_item, ":agent", "itm_decaphead"),
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has beheaded {s60}!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_arms_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param, ":agent", 1), #store hitted agent
	  (store_trigger_param, ":dealer", 2), #store dealer
	  (store_trigger_param, ":damage", 3), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
			
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  (store_agent_hit_points, ":hp", ":agent", 1),
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 32), #strong blow
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  (store_random_in_range, ":dearm", 0,100),
	  (le, ":dearm", 12), #because arm decap happened 75% of the time  
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_hand_l),
		(this_or_next|eq, ":bone2", hb_hand_l),
		(this_or_next|eq, ":bone", hb_forearm_l),
		(eq, ":bone2", hb_forearm_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left hand!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_hand_r),
		(this_or_next|eq, ":bone2", hb_hand_r),
		(this_or_next|eq, ":bone", hb_forearm_r),
		(eq, ":bone2", hb_forearm_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right hand!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_legs_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 30), #strongest blow of all because legs are harder to decap
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_foot_l),
		(this_or_next|eq, ":bone2", hb_foot_l),
		(this_or_next|eq, ":bone", hb_thigh_l),
		(this_or_next|eq, ":bone2", hb_thigh_l),
	    (this_or_next|eq, ":bone", hb_calf_l),
		(eq, ":bone2", hb_calf_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		    (agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left leg!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_foot_r),
		(this_or_next|eq, ":bone2", hb_foot_r),
		(this_or_next|eq, ":bone", hb_thigh_r),
		(this_or_next|eq, ":bone2", hb_thigh_r),
	    (this_or_next|eq, ":bone", hb_calf_r),
		(eq, ":bone2", hb_calf_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
			(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right leg!", 0xff0000),
	  (try_end), 
   ]) 

error
插入代码块:
SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 111; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 111; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 111; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has chopped of Looter his right hand!
 SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 107; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 107; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 107; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has beheaded Looter!

error explanation (partly)
插入代码块:
operation 1704 equals agent_is_human #(agent_is_human,<agent_id>),
operation 1718 equals agent_get_troop_id # (agent_get_troop_id,<destination>, <agent_id>),
operation 1710 equals agent_get_position # (agent_get_position,<position_no>,<agent_id>),

Ok, I think I know whats wrong. I suppose "common_battle_decapitation" trigger is placed before other two in your mission template? If yes, I assume it goes as follows:

1.agent is alive
2.agent is hit
3."common_battle_decapitation" fires first becouse of appear order
4.decapitation happens
5.agent is killed
6."common_battle_arms_decapitation" fires next
7.trigger tries to check if hit agent is human BUT said agent was already REMOVED in "common_battle_decapitation" trigger.
8.error
9.everyone dies

Thats my guess. Probably putting "agent_is_active" before "agent_is_human" would fix it.

 
EmielRegis 说:
builder of the gods 说:
Im feeling really dumb right now but i just can't figure out this error
It happens on hit, what i am making is head, hand, leg decapitation and the code works fine and decaps the message is shown alright but still it gives an error on opcode pointing to agent_is_human what is like super strange

code:
插入代码块:
common_battle_decapitation = ( #head
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1),
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  #general needs end
	  (try_begin),
		(this_or_next|eq, ":bone", hb_head),
		(this_or_next|eq, ":bone2", hb_head),
		(this_or_next|eq, ":bone", hb_shoulder_l),
		(this_or_next|eq, ":bone2", hb_shoulder_l),
		(this_or_next|eq, ":bone", hb_shoulder_r),
		(eq, ":bone2", hb_shoulder_r),
		#power and helmet condition begin 
		(ge, ":damage", 32),
		#(agent_get_item_slot, ":helmet", ":agent", 4),
		#(item_get_head_armor, ":head_armor", ":helmet"),
		#(lt, ":head_armor", 40),
		#power and helmet condition end
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(spawn_scene_prop, "spr_head"),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
      
		# fake head
        (assign, ":head_id", reg0),
      
		(prop_instance_enable_physics, ":head_id", 1),
		(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
		#(agent_equip_item, ":agent", "itm_unvisible"), #unvisible helmet
		(agent_equip_item, ":agent", "itm_decaphead"),
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has beheaded {s60}!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_arms_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param, ":agent", 1), #store hitted agent
	  (store_trigger_param, ":dealer", 2), #store dealer
	  (store_trigger_param, ":damage", 3), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
			
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  (store_agent_hit_points, ":hp", ":agent", 1),
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 32), #strong blow
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  (store_random_in_range, ":dearm", 0,100),
	  (le, ":dearm", 12), #because arm decap happened 75% of the time  
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_hand_l),
		(this_or_next|eq, ":bone2", hb_hand_l),
		(this_or_next|eq, ":bone", hb_forearm_l),
		(eq, ":bone2", hb_forearm_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left hand!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_hand_r),
		(this_or_next|eq, ":bone2", hb_hand_r),
		(this_or_next|eq, ":bone", hb_forearm_r),
		(eq, ":bone2", hb_forearm_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(spawn_scene_prop, "spr_hand"),
	    (assign, ":hand_id", reg0),
		(prop_instance_enable_physics, ":hand_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_handchop, 1),
			(assign, ":new_hand_item", "itm_decaphand"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_decaphand"),
			(agent_set_slot, ":agent", slot_agent_right_handchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		(try_begin),
			(lt, ":damage", ":hp"),
			(agent_get_wielded_item,":weapon",":agent",0),
			(ge, ":weapon", 0),
			(agent_get_wielded_item_slot_no, ":weapon_slot_number", ":agent", 0),
			(val_add, ":weapon_slot_number", 1),
			(agent_unequip_item, ":agent", ":weapon", ":weapon_slot_number"),
			(position_move_y, pos4, 5),
			(position_rotate_z, pos4, 90),
			(set_spawn_position, pos4),
			(spawn_item, ":weapon", 0, 180),
		(try_end),
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right hand!", 0xff0000),
	  (try_end), 
   ])  
   
common_battle_legs_decapitation = ( 
    ti_on_agent_hit, 0, 0, [], #when agent got hit
    [
      (store_trigger_param_1, ":agent"), #store hitted agent
	  (store_trigger_param_2, ":dealer"), #store dealer
	  (store_trigger_param_3, ":damage"), #store damage
	  (store_trigger_param, ":bone", 4), #store hitted agent, #store bone needs wse
	  
	  (assign, ":bone2", reg1), #for double check
      (agent_is_human, ":agent"), # agent is human
	  (agent_is_human, ":dealer"), # agent is human
      (agent_get_troop_id, ":troop_no", ":agent"), #agent get troop id
	  #(neq|troop_is_hero, ":troop_no"), #agent is no hero
	  (ge, ":damage", 30), #strongest blow of all because legs are harder to decap
	  (agent_get_position, pos1, ":agent"),
	  (agent_get_position, pos2, ":dealer"),
	  (get_distance_between_positions, ":distance", pos1, pos2),
	  (is_between, ":distance", 0, 200), #no arrow or very less power hitting
	  (troop_get_type,":victim_gender",":agent"),
	  #general needs end
	  (try_begin),
	    #left hand begin 
		(this_or_next|eq, ":bone", hb_foot_l),
		(this_or_next|eq, ":bone2", hb_foot_l),
		(this_or_next|eq, ":bone", hb_thigh_l),
		(this_or_next|eq, ":bone2", hb_thigh_l),
	    (this_or_next|eq, ":bone", hb_calf_l),
		(eq, ":bone2", hb_calf_l),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"), #both hands chopped
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		    (agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his left leg!", 0xff0000),
		#right hand end
	  (else_try), 
		#left hand begin
		(this_or_next|eq, ":bone", hb_foot_r),
		(this_or_next|eq, ":bone2", hb_foot_r),
		(this_or_next|eq, ":bone", hb_thigh_r),
		(this_or_next|eq, ":bone2", hb_thigh_r),
	    (this_or_next|eq, ":bone", hb_calf_r),
		(eq, ":bone2", hb_calf_r),
		(play_sound_at_position, "snd_decapitation", pos0),
		(copy_position, pos2, pos9),
		(set_spawn_position, pos0),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
		(particle_system_burst, "psys_decap_blood", pos2, 5),
	    (spawn_scene_prop, "spr_leg"),
	    (assign, ":leg_id", reg0),
		(prop_instance_enable_physics, ":leg_id", 1),
		#check if one or two decap hands
		(try_begin),
			(agent_slot_eq, ":agent", slot_agent_left_legchop, 1),
			(assign, ":new_hand_item", "itm_invisible_leg"),
		(else_try),
			(assign, ":new_hand_item", "itm_invisible_leg"),
			(agent_set_slot, ":agent", slot_agent_right_legchop, 1),
		(try_end),
		(agent_equip_item, ":agent", ":new_hand_item"),
		(store_agent_hit_points, ":hp", ":agent", 1),
		#drop weapon (because he has no hand anymore)
		#bleed
		(agent_set_animation, ":agent", "anim_bleeding", 1),
		#scream
		(try_begin),
			(eq, ":victim_gender", 1),
			(agent_play_sound, ":agent", "snd_woman_hit"),
		(else_try),	
			(agent_play_sound, ":agent", "snd_man_hit"),
		(try_end),
		#telling of the chopping
		(str_store_troop_name, s60, ":troop_no"),
		(agent_get_troop_id, ":troop_no_2", ":dealer"),
		(str_store_troop_name, s61, ":troop_no_2"),
		(display_message, "@{s61} has chopped of {s60} his right leg!", 0xff0000),
	  (try_end), 
   ]) 

error
插入代码块:
SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 111; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 111; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 111; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has chopped of Looter his right hand!
 SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 107; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 107; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 107; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has beheaded Looter!

error explanation (partly)
插入代码块:
operation 1704 equals agent_is_human #(agent_is_human,<agent_id>),
operation 1718 equals agent_get_troop_id # (agent_get_troop_id,<destination>, <agent_id>),
operation 1710 equals agent_get_position # (agent_get_position,<position_no>,<agent_id>),

Ok, I think I know whats wrong. I suppose "common_battle_decapitation" trigger is placed before other two in your mission template? If yes, I assume it goes as follows:

1.agent is alive
2.agent is hit
3."common_battle_decapitation" fires first becouse of appear order
4.decapitation happens
5.agent is killed
6."common_battle_arms_decapitation" fires next
7.trigger tries to check if hit agent is human BUT said agent was already REMOVED in "common_battle_decapitation" trigger.
8.error
9.everyone dies

Thats my guess. Probably putting "agent_is_active" before "agent_is_human" would fix it.

Yes i had the same idea so i changed the second block to~ Agent2 and third to agent3 but still a error code will try agent is active today tho
 
builder of the gods 说:
Yes i had the same idea so i changed the second block to~ Agent2 and third to agent3 but still a error code will try agent is active today tho

Changing name wont fix anything. In each trigger you storing same agent id no matter how you name variable. Local variables dont exist outside their [] brackets so same name is acceptable.
 
builder of the gods 说:
插入代码块:
SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 111; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 111; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 111; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has chopped of Looter his right hand!
 SCRIPT WARNING ON OPCODE 1704: Invalid Agent ID: 107; LINE NO: 5: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 107; LINE NO: 7: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. SCRIPT WARNING ON OPCODE 1710: Invalid Agent ID: 107; LINE NO: 9: 
 At Mission Template [9] mst_lead_charge Trigger [19] Consequences. At Mission Template [9] mst_lead_charge Trigger [19] Consequences. godarcher has beheaded Looter!
[/spoiler]

error explanation (partly)
插入代码块:
operation 1704 equals agent_is_human #(agent_is_human,<agent_id>),
operation 1718 equals agent_get_troop_id # (agent_get_troop_id,<destination>, <agent_id>),
operation 1710 equals agent_get_position # (agent_get_position,<position_no>,<agent_id>),
you did start well there by finding the operations. Now lets go further to fix the bugs.

1) where did this come from?
(assign, ":bone2", reg1),

(copy_position, pos2, pos9),

(assign, ":head_id", reg0),
...


2) triggers are called in a sequence (trigger 1, trigger 2, ....). So as you have multiple triggers for the event "agent was hit", you need to add sanity checks for each one (validate if the agent is still alive and well)

My suggestion would be to rewrite the entire thing as one trigger, and transfer the majority of the code to scripts... but thats for when you feel confortable with clean code

So lets examine the error:

2.1) mst_lead_charge Trigger [19]
which one is trigger #19? You should know this, just copying 3 triggers don't tell us anything. Looks like your third trigger, but again, you should check this.

2.2) you need the sanity checks when working with instances. That applies to agents, parties, props, ....
插入代码块:
  # "script_cf_agent_still_alive"
  ("cf_agent_still_alive",
    [
      (store_script_param_1, ":agent_id"),
      (agent_is_active, ":agent_id"),
      (agent_is_alive, ":agent_id"),
  ]),
I like to call a script for that, so I don't forget the operations. But the important part is: check if the agent was not deleted, and check if he is still alive (HP left)

When the agent dies (HP is zero) the game will eventually remove the reference (Invalid Agent ID: 111) to clear up memory. You don't control the when this happens. If it is dead, it will soon be removed.

You need that check on all triggers

2.3) LINE NO: 7:
Again you need to find trigger #19 and count the lines. This will take you to the operation and code that is exploding. Count from 0: line 0, line 1, line 2, ..., line 7

2.4]) Include rgl_log.txt debug messages when testing your code. Otherwise you are just guessing things are working, and you get lost when they don't
https://forums.taleworlds.com/index.php/topic,347990.msg8335287.html#msg8335287



If you want to check a decapitation OSP with better coding I would recommend the VC module source. It includes different % chance for the player x bots, tests if the weapon is sword, axe, etc, correct bones, logging, ... all in easy to read scripts



EmielRegis 说:
7.trigger tries to check if hit agent is human BUT said agent was already REMOVED in "common_battle_decapitation" trigger.
8.error
9.everyone dies

Thats my guess. Probably putting "agent_is_active" before "agent_is_human" would fix it.

Yes and no. The problem from third trigger is because the agent was removed, but that doesn't mean the sanity check will fix things. It will only fix the immediate issue (the warning), but not the feature itself (see item 1 above)

You need to keep debugging and fixing your code
 
builder of the gods 说:
Somebody knows how to make an scene prop orientated animation?

sure, @Somebody is a coding wizard, he knows it for sure  :mrgreen:

jk aside, all you need to do is get Lav's module source and check the section on props. The operations for animation are well described there. If you need further help, bring your code here once you have things started
 
kalarhan 说:
EmielRegis 说:
7.trigger tries to check if hit agent is human BUT said agent was already REMOVED in "common_battle_decapitation" trigger.
8.error
9.everyone dies

Thats my guess. Probably putting "agent_is_active" before "agent_is_human" would fix it.

Yes and no. The problem from third trigger is because the agent was removed, but that doesn't mean the sanity check will fix things. It will only fix the immediate issue (the warning), but not the feature itself (see item 1 above)

You need to keep debugging and fixing your code

You are wrong. If agent is decapitated and killed there is no need to check if he has arm or leg cut out. Therefore Just checking if decapitation fired and killed agent using "agent_is_active" should fix that bug.
 
EmielRegis 说:
You are wrong. If agent is decapitated and killed there is no need to check if he has arm or leg cut out. Therefore Just checking if decapitation fired and killed agent using "agent_is)active" should fix that bug.

read it again, because you clearly missed the point of the quote

Yes and no. The problem from third trigger is because the agent was removed, but that doesn't mean the sanity check will fix things. It will only fix the immediate issue (the warning), but not the feature itself (see item 1 above)

You need to keep debugging and fixing your code
 
Reread and I still think I stand correct. If head is chooped next triggers wont execute. If not chopped will work as intended.
 
EmielRegis 说:
Reread and I still think I stand correct.

it was not your question, but if you really want to understand it and couldn't, we may try going a bit deeper:

bugs are like a house of cards. A bug usually hides others. You can't fix them by simple looking at the immediate and obvious problem, you need to use a holistic view and take the entire feature into account.

the triggers have several coding issues that the author is missing, which needs fixing. Right now he only observed the obvious error that exploded in the game (red text), but even if he fixes that part, the feature will still not work properly, even if no warning are displayed in the game.

Warning in the game != all the bugs in your code

That is why I told him that besides the sanity check (first step) he also needs to check and debug the code further, to fix the other issues.
 
kalarhan 说:
EmielRegis 说:
Reread and I still think I stand correct.

it was not your question, but if you really want to understand it and couldn't, we may try going a bit deeper:

bugs are like a house of cards. A bug usually hides others. You can't fix them by simple looking at the immediate and obvious problem, you need to use a holistic view and take the entire feature into account.

the triggers have several coding issues that the author is missing, which needs fixing. Right now he only observed the obvious error that exploded in the game (red text), but even if he fixes that part, the feature will still not work properly, even if no warning are displayed in the game.

Warning in the game != all the bugs in your code

That is why I told him that besides the sanity check (first step) he also needs to check and debug the code further, to fix the other issues.

Thx for advice but I really know how bugs work and what they can do.

Tell why putting "agent_is_active" wont fix problem entirely.  The problem is : trigger tries to check id of removed agent. Solution : check first if such agent even exist at the moment.  Simple. Where is bug potential here? What not gonna work?
 
状态
不接受进一步回复。
后退
顶部 底部