jik
Knight
Ok when I compile my scripts, I get this error:
WARNING: Script can fail at operation #61. Use cf_ at the beginning of it's name: joust_unhorsing
Here is the script, but I don't understand the error...
WARNING: Script can fail at operation #61. Use cf_ at the beginning of it's name: joust_unhorsing
Here is the script, but I don't understand the error...
###script_joust_unhorsing
###Checks the horsing chance when hit while jousting. $joust_mark is set here for the first strike
###Of course, if you are unhorsed (here) you don't get to strike back
###Animations and messages done here too
###Inputs : param 1 = agent getting hit
### param 2 = range the strike happened at
###Outputs: $joust_mark is set if it is currently 0 (showing this is the first strike)
("joust_unhorsing",
[(store_script_param,":victim",1),
(store_script_param,":striker",2),
(store_script_param,":hit_range",3),
(assign,":joust_bonus",0),
###Setting up regs for display messages########################################
(assign,reg40,":hit_range"), #
(agent_get_troop_id,":temp_id", ":striker"), #
(str_clear, s30), #
(str_store_troop_name,s30,":temp_id"), ##S30 has the Striker Troop name #
(agent_get_troop_id,":temp_id", ":victim"), #
(str_clear, s31), #
(str_store_troop_name,s31,":temp_id"), ##S31 has the Victim Troop name #
###End of regs setup for display messages######################################
###to remove redundancy, animation stuff should go here:
(assign,":jossled",0),
(try_begin),
(gt,"$joust_mark",550), ##If a mark has been set, victim gets pentalty if above 550
(try_begin),###penalties for the victim's early swing
(is_between,"$joust_mark",591,600),
(assign,":joust_bonus",20),
(else_try),
(is_between,"$joust_mark",581,590),
(assign,":joust_bonus",15),
(else_try),
(is_between,"$joust_mark",571,580),
(assign,":joust_bonus",12),
(else_try),
(is_between,"$joust_mark",561,570),
(assign,":joust_bonus",,
(else_try),
(is_between,"$joust_mark",551,560),
(assign,":joust_bonus",4),
(try_end),###End of penalties for the victim's early swing
(else_try),
(neq,"$joust_mark",0), ##can't be zero for this test
(le,":hit_range",450), ##If a mark has been set, striker gets pentalty if below 450
(try_begin),###penalties for the striker's late swing
(is_between,":hit_range",400,410),
(is_between,"$joust_mark",450,550),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",411,420),
(is_between,"$joust_mark",455,545),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",421,430),
(is_between,"$joust_mark",460,540),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",431,440),
(is_between,"$joust_mark",470,530),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",441,450),
(is_between,"$joust_mark",480,520),
(assign,":jossled",1),
(try_end),###End of penalties for the striker's late swing
(try_end),
(try_begin),
(eq,":jossled",1), ##you struck to late and are not able to hit back...
(agent_set_animation, ":striker", "anim_strike2_abdomen_front"),
(display_message,"@{s30} was jossled, and unable to return a thrust..."),
(agent_set_slot,":striker",slot_agent_jousting,-1), ##they have thrusted, no more chances
(try_end),
(eq,":jossled",0),
(agent_set_animation, ":striker", "anim_release_joust"),
(display_message,"@{s30} strikes {s31} at range {reg56}notches!",0x991111),
###End of animations stuff
(play_sound,"snd_crowd_shouts"),
(play_sound,"snd_hit_wood_metal"), ##sound of the lance breaking
(play_sound,"snd_blunt_hit"),
(try_begin),
(eq,"$joust_mark",0), #if 0, this is first strike, set the mark
(assign,"$joust_mark",":hit_range"),
(try_end),
(try_begin),#+/- 90-100 on range from 500
(this_or_next|is_between,":hit_range",400,411),
(is_between,":hit_range",591,601),
(assign,":unhorse_chance",5),
(else_try),#+/- 80-90
(this_or_next|is_between,":hit_range",411,421),
(is_between,":hit_range",581,591),
(assign,":unhorse_chance",10),
(else_try),#+/- 70-80
(this_or_next|is_between,":hit_range",421,431),
(is_between,":hit_range",571,581),
(assign,":unhorse_chance",15),
(else_try),#+/- 60-70
(this_or_next|is_between,":hit_range",431,441),
(is_between,":hit_range",561,571),
(assign,":unhorse_chance",20),
(else_try),#+/- 50-60
(this_or_next|is_between,":hit_range",441,451),
(is_between,":hit_range",551,561),
(assign,":unhorse_chance",30),
(else_try),#+/- 40-50
(this_or_next|is_between,":hit_range",451,461),
(is_between,":hit_range",541,551),
(assign,":unhorse_chance",40),
(else_try),#+/- 30-40
(this_or_next|is_between,":hit_range",461,471),
(is_between,":hit_range",531,541),
(assign,":unhorse_chance",50),
(else_try),#+/- 20-30
(this_or_next|is_between,":hit_range",471,481),
(is_between,":hit_range",521,531),
(assign,":unhorse_chance",60),
(else_try),#+/- 10-20
(this_or_next|is_between,":hit_range",481,491),
(is_between,":hit_range",511,521),
(assign,":unhorse_chance",70),
(else_try),#+/- 5-10
(this_or_next|is_between,":hit_range",491,496),
(is_between,":hit_range",506,511),
(assign,":unhorse_chance",80),
(else_try),#+/- 0-5
(is_between,":hit_range",496,506),
(assign,":unhorse_chance",90),
(try_end),
(val_add,":unhorse_chance",":joust_bonus"), ##Can be more than 100% if victim is off balance
(assign,reg41,":unhorse_chance"),
(display_message,"@there was a {reg41}% chance to unhorse",0x1111aa),
(store_random_in_range,":percent",1,101), ##Roll percentage against the chance to unhorse
(try_begin),
(le,":percent",":unhorse_chance"), ##is he unhorsed?
(agent_set_slot,":victim",slot_agent_jousting,-1), ##YES, make sure he doesn't get a swing.
(agent_set_hit_points,":victim",0,0), ##they are off thier horse, KO them.
(agent_deliver_damage_to_agent,":striker",":victim"),
(play_sound,"snd_body_fall_big"), ##sound of falling
(try_end),
(agent_set_slot,":striker",slot_agent_jousting,-1), ##they have thrusted, no more chances
]
),
###Checks the horsing chance when hit while jousting. $joust_mark is set here for the first strike
###Of course, if you are unhorsed (here) you don't get to strike back
###Animations and messages done here too
###Inputs : param 1 = agent getting hit
### param 2 = range the strike happened at
###Outputs: $joust_mark is set if it is currently 0 (showing this is the first strike)
("joust_unhorsing",
[(store_script_param,":victim",1),
(store_script_param,":striker",2),
(store_script_param,":hit_range",3),
(assign,":joust_bonus",0),
###Setting up regs for display messages########################################
(assign,reg40,":hit_range"), #
(agent_get_troop_id,":temp_id", ":striker"), #
(str_clear, s30), #
(str_store_troop_name,s30,":temp_id"), ##S30 has the Striker Troop name #
(agent_get_troop_id,":temp_id", ":victim"), #
(str_clear, s31), #
(str_store_troop_name,s31,":temp_id"), ##S31 has the Victim Troop name #
###End of regs setup for display messages######################################
###to remove redundancy, animation stuff should go here:
(assign,":jossled",0),
(try_begin),
(gt,"$joust_mark",550), ##If a mark has been set, victim gets pentalty if above 550
(try_begin),###penalties for the victim's early swing
(is_between,"$joust_mark",591,600),
(assign,":joust_bonus",20),
(else_try),
(is_between,"$joust_mark",581,590),
(assign,":joust_bonus",15),
(else_try),
(is_between,"$joust_mark",571,580),
(assign,":joust_bonus",12),
(else_try),
(is_between,"$joust_mark",561,570),
(assign,":joust_bonus",,
(else_try),
(is_between,"$joust_mark",551,560),
(assign,":joust_bonus",4),
(try_end),###End of penalties for the victim's early swing
(else_try),
(neq,"$joust_mark",0), ##can't be zero for this test
(le,":hit_range",450), ##If a mark has been set, striker gets pentalty if below 450
(try_begin),###penalties for the striker's late swing
(is_between,":hit_range",400,410),
(is_between,"$joust_mark",450,550),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",411,420),
(is_between,"$joust_mark",455,545),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",421,430),
(is_between,"$joust_mark",460,540),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",431,440),
(is_between,"$joust_mark",470,530),
(assign,":jossled",1),
(else_try),
(is_between,":hit_range",441,450),
(is_between,"$joust_mark",480,520),
(assign,":jossled",1),
(try_end),###End of penalties for the striker's late swing
(try_end),
(try_begin),
(eq,":jossled",1), ##you struck to late and are not able to hit back...
(agent_set_animation, ":striker", "anim_strike2_abdomen_front"),
(display_message,"@{s30} was jossled, and unable to return a thrust..."),
(agent_set_slot,":striker",slot_agent_jousting,-1), ##they have thrusted, no more chances
(try_end),
(eq,":jossled",0),
(agent_set_animation, ":striker", "anim_release_joust"),
(display_message,"@{s30} strikes {s31} at range {reg56}notches!",0x991111),
###End of animations stuff
(play_sound,"snd_crowd_shouts"),
(play_sound,"snd_hit_wood_metal"), ##sound of the lance breaking
(play_sound,"snd_blunt_hit"),
(try_begin),
(eq,"$joust_mark",0), #if 0, this is first strike, set the mark
(assign,"$joust_mark",":hit_range"),
(try_end),
(try_begin),#+/- 90-100 on range from 500
(this_or_next|is_between,":hit_range",400,411),
(is_between,":hit_range",591,601),
(assign,":unhorse_chance",5),
(else_try),#+/- 80-90
(this_or_next|is_between,":hit_range",411,421),
(is_between,":hit_range",581,591),
(assign,":unhorse_chance",10),
(else_try),#+/- 70-80
(this_or_next|is_between,":hit_range",421,431),
(is_between,":hit_range",571,581),
(assign,":unhorse_chance",15),
(else_try),#+/- 60-70
(this_or_next|is_between,":hit_range",431,441),
(is_between,":hit_range",561,571),
(assign,":unhorse_chance",20),
(else_try),#+/- 50-60
(this_or_next|is_between,":hit_range",441,451),
(is_between,":hit_range",551,561),
(assign,":unhorse_chance",30),
(else_try),#+/- 40-50
(this_or_next|is_between,":hit_range",451,461),
(is_between,":hit_range",541,551),
(assign,":unhorse_chance",40),
(else_try),#+/- 30-40
(this_or_next|is_between,":hit_range",461,471),
(is_between,":hit_range",531,541),
(assign,":unhorse_chance",50),
(else_try),#+/- 20-30
(this_or_next|is_between,":hit_range",471,481),
(is_between,":hit_range",521,531),
(assign,":unhorse_chance",60),
(else_try),#+/- 10-20
(this_or_next|is_between,":hit_range",481,491),
(is_between,":hit_range",511,521),
(assign,":unhorse_chance",70),
(else_try),#+/- 5-10
(this_or_next|is_between,":hit_range",491,496),
(is_between,":hit_range",506,511),
(assign,":unhorse_chance",80),
(else_try),#+/- 0-5
(is_between,":hit_range",496,506),
(assign,":unhorse_chance",90),
(try_end),
(val_add,":unhorse_chance",":joust_bonus"), ##Can be more than 100% if victim is off balance
(assign,reg41,":unhorse_chance"),
(display_message,"@there was a {reg41}% chance to unhorse",0x1111aa),
(store_random_in_range,":percent",1,101), ##Roll percentage against the chance to unhorse
(try_begin),
(le,":percent",":unhorse_chance"), ##is he unhorsed?
(agent_set_slot,":victim",slot_agent_jousting,-1), ##YES, make sure he doesn't get a swing.
(agent_set_hit_points,":victim",0,0), ##they are off thier horse, KO them.
(agent_deliver_damage_to_agent,":striker",":victim"),
(play_sound,"snd_body_fall_big"), ##sound of falling
(try_end),
(agent_set_slot,":striker",slot_agent_jousting,-1), ##they have thrusted, no more chances
]
),