OSP Code Combat Spear Bracing Kit (Updated)

正在查看此主题的用户

Hello all.

Tell me, please, why some common spears are marked as unusable by AI in the sense of spearwall (light_lance, lance, heavy lance)?
If I give "usable" spear for the mounted troop will it be able to brace spears while being mounted (and make bugs in my game)? Or spear bracing work only for infantry? Will it work for dismounted troops with spears (dismounted by order or because of the death of their horses)?
Sorry for fool questions, I'm not good in programming.
 
Infantry are the only troops that may brace spears.

Lances are lances, not pikes or spears. They're made to be used to shatter through armour on horseback, not to be braced against the ground.
 
Berserker Pride 说:
Frisian dude I'm going to post all my code for the spearwall triggers hopefully it helps you out.
########################Begin#################################
spearwall_trigger_1 = (0.2, 0, ti_once, [], [
        (assign,"$spear_in_position",0),
        (assign,"$setting_use_spearwall",1),
        (try_for_agents,":agent"),
          (agent_set_slot,":agent",slot_agent_spearwall,0),
          (agent_set_slot,":agent",slot_agent_x,0),
          (agent_set_slot,":agent",slot_agent_y,0),
          (agent_set_slot,":agent",slot_agent_z,0),
          (agent_set_slot,":agent",slot_agent_speed,0),
        (try_end),
        ])

spearwall_trigger_2 = (0.2, 0, 0, [(eq,"$setting_use_spearwall",1)], [
        (set_fixed_point_multiplier, 100),
        (try_for_agents,":agent"),
          (agent_is_alive,":agent"),
          (agent_get_slot,":eek:ldagentx",":agent",slot_agent_x),
          (agent_get_slot,":eek:ldagenty",":agent",slot_agent_y),
          (agent_get_slot,":eek:ldagentz",":agent",slot_agent_z),
          (agent_get_position, pos1, ":agent"),
          (position_get_x,":agentx",pos1),
          (position_get_y,":agenty",pos1),
          (position_get_z,":agentz",pos1),
          (position_set_x,pos2,":eek:ldagentx"),
          (position_set_y,pos2,":eek:ldagenty"),
          (position_set_z,pos2,":eek:ldagentz"),
          (position_set_x,pos1,":agentx"),
          (position_set_y,pos1,":agenty"),
          (position_set_z,pos1,":agentz"),
          (get_distance_between_positions,":speed",pos1,pos2),
          (agent_set_slot,":agent",slot_agent_x,":agentx"),
          (agent_set_slot,":agent",slot_agent_y,":agenty"),
          (agent_set_slot,":agent",slot_agent_z,":agentz"),
          (agent_set_slot,":agent",slot_agent_speed,":speed"),
        (try_end),
        ])

spearwall_trigger_3 = (0, 0, 0, [(eq,"$spear_in_position",1),(this_or_next|game_key_clicked, gk_attack),
        (this_or_next|game_key_clicked, gk_defend),(this_or_next|game_key_clicked, gk_defend),
        (this_or_next|game_key_clicked, gk_move_forward),(this_or_next|game_key_clicked, gk_move_backward),
        (this_or_next|game_key_clicked, gk_move_left),(this_or_next|game_key_clicked, gk_move_right),
        (this_or_next|game_key_clicked, gk_equip_primary_weapon),(this_or_next|game_key_clicked, gk_equip_secondary_weapon),
        (this_or_next|game_key_clicked, gk_action),(game_key_clicked, gk_sheath_weapon)
        ],
      [(get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (display_message,"@Releasing spear.",0x6495ed),
        (agent_set_animation, ":player", "anim_release_thrust_staff"),
        (assign,"$spear_in_position",0),
        ])

spearwall_trigger_4 = (0.2, 0, 0, [(eq,"$setting_use_spearwall",1)], [
        (try_for_agents,":agent"),
          (agent_get_horse,":horse",":agent"),
          (neg|gt,":horse",0),
          (agent_get_slot,":speartimer",":agent",slot_agent_spearwall),
          (lt,":speartimer",10),
          (val_add,":speartimer",2),
          (agent_set_slot,":agent",slot_agent_spearwall,":speartimer"),
        (try_end),
        ])

spearwall_trigger_5 = (3, 0, 0, [(eq,"$spear_in_position",1)],[
        (get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (agent_set_animation, ":player", "anim_spearwall_hold"),
        ])

spearwall_trigger_6 = (0.1, 0, 0, [(eq,"$setting_use_spearwall",1)], [
        (get_player_agent_no,":player"),
        (agent_get_team,":playerteam",":player"),
        (try_for_agents,":agent"),
          (agent_is_alive,":agent"),
          (neq,":agent",":player"),
          (agent_is_human,":agent"),
          (agent_get_horse,":horse",":agent"),
          (neg|gt,":horse",0),
          (agent_get_slot,":speartimer",":agent",slot_agent_spearwall),
          (ge,":speartimer",10),
          (agent_get_simple_behavior,":state",":agent"),
          (agent_get_team,":team1",":agent"),
          (agent_get_class,":class",":agent"),
          (team_get_movement_order,":eek:rder",":team1",":class"),
          (assign,":continue",0),
          (try_begin),
              (neq,":team1",":playerteam"),
              (this_or_next|eq,":state",aisb_hold),
              (this_or_next|eq,":state",aisb_flock),
              (eq,":state",aisb_go_to_pos),
              (assign,":continue",1),
          (else_try),
              (this_or_next|eq,":eek:rder",mordr_hold),
              (eq,":eek:rder",mordr_stand_ground),
              (this_or_next|eq,":state",aisb_hold),
              (this_or_next|eq,":state",aisb_flock),
              (this_or_next|eq,":state",aisb_melee),
              (eq,":state",aisb_go_to_pos),
              (assign,":continue",1),
          (try_end),
          (eq,":continue",1),
          (assign,":continue",0),
          (try_begin),
              (eq,":team1",":playerteam"),
              #(eq,"$rout",0),
              (assign,":continue",1),
          (else_try),
              #(eq,"$airout",0),
              (assign,":continue",1),
          (try_end),
          (eq,":continue",1),
          (assign,":continue",0),
          (agent_get_wielded_item, ":handone", ":agent", 0),
          (agent_get_wielded_item, ":handtwo", ":agent", 1),
          (assign,":speardist",145),
          (try_for_range,":spear","itm_pitch_fork","itm_wooden_shield"),
              (this_or_next|eq,":handone",":spear"),
              (eq,":handtwo",":spear"),
              (assign,":continue",1),
              (try_begin),
                (eq,":spear","itm_war_spear"),
                (assign,":speardist",160),
              (else_try),
                (eq,":spear","itm_spear_e_2-5m"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_light_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_heavy_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_pike"),
                (assign,":speardist",255),
              (else_try),
                (eq,":spear","itm_ashwood_pike"),
                (assign,":speardist",160),
              (else_try),
                (eq,":spear","itm_awlpike"),
                (assign,":speardist",170),
              (else_try),
                (eq,":spear","itm_pitch_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_military_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_battle_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_boar_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_glaive"),
                (assign,":speardist",167),
              (else_try),
                (eq,":spear","itm_poleaxe"),
                (assign,":speardist",180),
              (else_try),
                (eq,":spear","itm_polehammer"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_shortened_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_fauchard"),
                (assign,":speardist",140),
              (else_try),
                (eq,":spear","itm_halberd_e"),
                (assign,":speardist",150),
              (else_try),
                (eq,":spear","itm_halberd_f"),
                (assign,":speardist",150),
              (else_try),
                (eq,":spear","itm_knight_polehammer_a"),
                (assign,":speardist",155),
              (else_try),
                (eq,":spear","itm_knight_polehammer_b"),
                (assign,":speardist",150),
              (else_try),
                (eq,":spear","itm_bill"),
                (assign,":speardist",160),
              (else_try),
                (eq,":spear","itm_midland_lance"),
                (assign,":speardist",290),
              (else_try),
                (eq,":spear","itm_kushan_lance"),
                (assign,":speardist",270),
              (else_try),
                (eq,":spear","itm_cataphract_lance"),
                (assign,":speardist",260),
              (else_try),
                (eq,":spear","itm_mercenary_lance"),
                (assign,":speardist",290),
              (else_try),
                (eq,":spear","itm_tudor_spear"),
                (assign,":speardist",190),
              (else_try),
                (eq,":spear","itm_dark_jousting_pike"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_jousting_pike"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_sheep_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_daka_spear"),
                (assign,":speardist",130),
              (else_try),
                (eq,":spear","itm_jousting_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_double_sided_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_staff"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_quarter_staff"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_iron_staff"),
                (assign,":continue",0),
              (try_end),
          (try_end),
          (eq,":continue",1),
          (assign,":victim",-1),
          (agent_get_position,pos1,":agent"),
          (try_for_agents,":possible_victim"),
              (agent_is_alive,":possible_victim"),
              (neg|agent_is_human,":possible_victim"),
              (agent_get_rider,":rider",":possible_victim"),
              (ge,":rider",0),
              (agent_get_team,":team2",":rider"),
              (teams_are_enemies,":team1",":team2"),
              (agent_get_position,pos2,":possible_victim"),
              (get_distance_between_positions,":dist",pos1,pos2),
              (lt,":dist",":speardist"),
              (neg|position_is_behind_position,pos2,pos1),
              (agent_get_slot,":speed",":possible_victim",slot_agent_speed),
              (ge,":speed",120), # Remember to change this if the timing on speed checks changes
              (assign,":victim",":possible_victim"),
          (try_end),
          (gt,":victim",-1),
          (agent_set_animation, ":agent", "anim_spearwall_hold"),
          (agent_play_sound,":victim","snd_metal_hit_high_armor_high_damage"),
          (store_agent_hit_points,":hp",":victim",0),
          (store_agent_hit_points,":eek:ldhp",":victim",1),
          (val_div,":speed",2), # Remember to change this if the timing on speed checks changes
          (val_sub,":speed",15),
          (val_sub,":hp",":speed"),
          (val_max,":hp",0),
          (agent_set_slot,":agent",slot_agent_spearwall,0),
          (agent_get_horse,":playerhorse",":player"),         
          (agent_set_hit_points,":victim",":hp",0),
          (agent_deliver_damage_to_agent,":victim",":victim"),
          (try_begin),
              (eq,":victim",":playerhorse"),
              (store_agent_hit_points,":hp",":victim",1),
              (val_sub,":eek:ldhp",":hp"),
              (assign,reg1,":eek:ldhp"),
              (display_message,"@Your horse received {reg1} damage from a braced spear!",0xff4040),
          (try_end),
        (try_end),
        ])
spearwall_trigger_7 = (0.1, 0, 0, [(eq,"$spear_in_position",1)], [
        (get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (store_agent_hit_points,":hp",":player",1),
        (lt,":hp","$spear_hp"),
        (display_message,"@The injury causes your grip on the spear to slip!",0xff4040),
        (agent_set_animation, ":player", "anim_release_thrust_staff"),
        (assign,"$spear_in_position",0),
        ])

spearwall_trigger_8 = (0.1, 0, 0, [(eq,"$spear_in_position",1)], [
        (get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (agent_get_slot,":speartimer",":player",slot_agent_spearwall),
        (ge,":speartimer",10),
        (assign,":victim",-1),
        (agent_get_position,pos1,":player"),
        (try_for_agents,":possible_victim"),
          (agent_is_alive,":possible_victim"),
          (neg|agent_is_human,":possible_victim"),
          (agent_get_rider,":rider",":possible_victim"),
          (ge,":rider",0),
          (neg|agent_is_ally,":rider"),
          (agent_get_position,pos2,":possible_victim"),
          (get_distance_between_positions,":dist",pos1,pos2),
          (lt,":dist","$spear_dist"),
          (neg|position_is_behind_position,pos2,pos1),
          (agent_get_slot,":speed",":possible_victim",slot_agent_speed),
          (ge,":speed",120), # Remember to change this if the timing on speed checks changes
          (assign,":victim",":possible_victim"),
        (try_end),
        (gt,":victim",-1),
        (agent_play_sound,":victim","snd_metal_hit_high_armor_high_damage"),
        (store_agent_hit_points,":hp",":victim",0),
        (store_agent_hit_points,":eek:ldhp",":victim",1),
        (val_div,":speed",2), # Remember to change this if the timing on speed checks changes
        (val_sub,":speed",15),
        (val_sub,":hp",":speed"),
        (val_max,":hp",0),
        (agent_set_hit_points,":victim",":hp",0),
        (agent_deliver_damage_to_agent,":victim",":victim"),
        (agent_set_slot,":player",slot_agent_spearwall,0),
        (store_agent_hit_points,":hp",":victim",1),
        (val_sub,":eek:ldhp",":hp"),
        (assign,reg1,":eek:ldhp"),
        (display_message,"@Spear-wall dealt {reg1} damage!"),
        ])
spearwall_trigger_9 = (0, 0, 2, [(key_clicked, key_b),(eq,"$setting_use_spearwall",1)],
      [(assign,":continue",0),
        (get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (agent_get_wielded_item, ":handone", ":player", 0),
        (agent_get_wielded_item, ":handtwo", ":player", 1),
        (assign,"$spear_dist",145),
        (try_for_range,":spear","itm_pitch_fork","itm_wooden_shield"),
            (this_or_next|eq,":handone",":spear"),
            (eq,":handtwo",":spear"),
            (assign,":continue",1),
              (try_begin),
                (eq,":spear","itm_war_spear"),
                (assign,"$spear_dist",160),
              (else_try),
                (eq,":spear","itm_spear_e_2-5m"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_light_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_heavy_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_pike"),
                (assign,"$spear_dist",255),
              (else_try),
                (eq,":spear","itm_ashwood_pike"),
                (assign,"$spear_dist",160),
              (else_try),
                (eq,":spear","itm_awlpike"),
                (assign,"$spear_dist",170),
              (else_try),
                (eq,":spear","itm_pitch_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_military_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_battle_fork"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_boar_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_glaive"),
                (assign,"$spear_dist",167),
              (else_try),
                (eq,":spear","itm_poleaxe"),
                (assign,"$spear_dist",180),
              (else_try),
                (eq,":spear","itm_polehammer"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_shortened_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_fauchard"),
                (assign,"$spear_dist",140),
              (else_try),
                (eq,":spear","itm_halberd_e"),
                (assign,"$spear_dist",150),
              (else_try),
                (eq,":spear","itm_halberd_f"),
                (assign,"$spear_dist",150),
              (else_try),
                (eq,":spear","itm_knight_polehammer_a"),
                (assign,"$spear_dist",155),
              (else_try),
                (eq,":spear","itm_knight_polehammer_b"),
                (assign,"$spear_dist",150),
              (else_try),
                (eq,":spear","itm_bill"),
                (assign,"$spear_dist",160),
              (else_try),
                (eq,":spear","itm_midland_lance"),
                (assign,"$spear_dist",290),
              (else_try),
                (eq,":spear","itm_kushan_lance"),
                (assign,"$spear_dist",270),
              (else_try),
                (eq,":spear","itm_cataphract_lance"),
                (assign,"$spear_dist",260),
              (else_try),
                (eq,":spear","itm_mercenary_lance"),
                (assign,"$spear_dist",290),
              (else_try),
                (eq,":spear","itm_tudor_spear"),
                (assign,"$spear_dist",190),
              (else_try),
                (eq,":spear","itm_dark_jousting_pike"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_jousting_pike"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_sheep_spear"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_daka_spear"),
                (assign,"$spear_dist",130),
              (else_try),
                (eq,":spear","itm_jousting_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_double_sided_lance"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_staff"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_quarter_staff"),
                (assign,":continue",0),
              (else_try),
                (eq,":spear","itm_iron_staff"),
                (assign,":continue",0),
              (try_end),
        (try_end),
        (eq,":continue",1),
      (agent_get_horse,":horse",":player"),
        (neg|gt,":horse",0),
        (neq, "$spear_in_position", 1),
        (display_message,"@Bracing spear for charge.",0x6495ed),
        (agent_set_animation, ":player", "anim_spearwall_hold"),
        (assign, "$spear_in_position", 1),
        (store_agent_hit_points,"$spear_hp",":player",1),
        ])
      ########################End#####################
Just notice that the first block of weapon reaches uses the local variable :speardist and the second set uses the global $spear_dist hopefully the code helps.

That did help actually. Thanks a lot. :grin:
The only thing different from what I had, apart from some of your polearms, were those lines of ###'s. :???:
 
Mercenary you should add the horse rearing to the spearbrace code.  Its a really easy addition its just one line right after ":victim" is assigned for both the player spearbrace trigger and the ai one.
(gt,":victim",-1),
          (agent_set_animation, ":agent", "anim_spearwall_hold"),
          (agent_play_sound,":victim","snd_metal_hit_high_armor_high_damage"),
          (agent_set_animation,":victim","anim_horse_rear"),
          (store_agent_hit_points,":hp",":victim",0),
          (store_agent_hit_points,":eek:ldhp",":victim",1),
You could also add damage to the rider of the horse as well.  But I don't know if I like that.  I noticed you used the agent_get_rider operation earlier in this trigger.  The horses rearing makes a huge difference to the effectiveness of spearmen.  Before the horse would take 70 or so damage then smash through your lines.  The horse's rider usually removed one of my spearmen's heads in the process.  Now the horse rears, stops, and gets mobbed by everyone. 

EDIT yea for sure Frisian dude.  The agent set animation line goes right after  (agent_play_sound,":victim","snd_metal_hit_high_armor_high_damage"), It goes in twice once for you and once in the trigger for the ai.
 
Huh, that's pretty cool too. Mind if I use it?

Berserker Pride 说:
EDIT yea for sure Frisian dude.  The agent set animation line goes right after  (agent_play_sound,":victim","snd_metal_hit_high_armor_high_damage"), It goes in twice once for you and once in the trigger for the ai.
Yepyep, done that. It works nicely. :smile:
 
Hello everybody.
Sorry for the noob question.. :oops:
Where EXACTLY should I put the text to make the spear bracing script work?
Could someone give me the step-by-step instructions?
Sorry again,
 
would it be possible to make this affect infantry to? so that if they charged they could either be impaled on impact or simply made so that you could brace your spear and release to impale charging infantry?
 
Thanks alot mercenary, this is something that I thought needed to be added as soon as I found out about couched lance.
 
Ruina 说:
Hello everybody.
Sorry for the noob question.. :oops:
Where EXACTLY should I put the text to make the spear bracing script work?
Could someone give me the step-by-step instructions?
Sorry again,
This is not txt editing. Use the Module System.
 
The Mercenary 说:
EDIT: Oh yeah, I forgot. You need to copy the code part into mission templates, any mission where you feel that you need to be able to skewer horses.
Hit your keyboard randomly. You'll find it eventually.
I don't quite understand what exactly you mean by this?  After I have done everything above, I still need to do this?  And what code?  The top one?

Thanks!

Also, I am going to put this in my mod, and will credit you guys. 

EDIT:

When it compiles mission template, it keeps saying.  "Usage of unassigned global variable $setting_use_spearwall
along with the occasional $rout
and $airout
 
Um... with the bits where it scrolls through all the spears in the mod, wouldn't it be simpler to just list the ones you do want then bung a try_else with no conditions at the end for all the others?
 
So say I only want pikes to be braceable...
插入代码块:
                            (try_begin),
                            (eq,":spear","itm_pike"),
                            (assign,":speardist",255),
                            (else_try),
                            (eq,":spear","itm_ashwood_pike"),
                            (assign,":speardist",255),
                            (else_try),
                            (eq,":spear","itm_awlpike"),
                            (assign,":speardist",170),
                            (else_try),
                            (assign,":continue",0),
                            (try_end),
Like that.

Unfortunately I can't test it since the compiler keeps giving me errors related to $setting_use_spearwall, telling me I never assigned it. Where IS it meant to be assigned... I'm probably just being dim here. :neutral:
 
Yeah, CinuzIta asked me if he could see how I had it and comparing ours he got his working, but when I tried his I got buttloads of $rout and $airout errors. Without trying to use his but rather my 'own' I get these errors instead:
插入代码块:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting scripts...
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
ERROR: Usage of unassigned local variable: :agent_class
ERROR: Usage of unassigned local variable: :agent_class
WARNING: Local variable never used: enemy_perc_infantry
WARNING: Local variable never used: enemy_perc_archer
WARNING: Local variable never used: prev_RSS
WARNING: Local variable never used: j
WARNING: Local variable never used: cur_num
WARNING: Local variable never used: cut_in_angle
WARNING: Local variable never used: no_infantry
Exporting mission_template data...
Exporting game menus data...
Error: Unable to find object:trp_custom_battle_fac_7_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_7_troops
Error: Unable to find object:trp_custom_battle_fac_8_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_8_troops
Error: Unable to find object:trp_custom_battle_fac_9_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_9_troops
Error: Unable to find object:trp_custom_battle_fac_10_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_10_troops
Error: Unable to find object:trp_custom_battle_fac_11_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_11_troops
Error: Unable to find object:trp_custom_battle_fac_12_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_12_troops
Error: Unable to find object:trp_custom_battle_fac_13_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_13_troops
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...

______________________________

Script processing has ended.
Press any key to exit. . .
I think the WARNING: LOCAL VARIABLES NEVER USED have something to do with this. (The rest doesn't. Though I don't understand why it even mentions that wooden_stick, there is no wooden_stick in mod_scripts.py!)
Jubal 说:
So say I only want pikes to be braceable...
插入代码块:
                            (try_begin),
                            (eq,":spear","itm_pike"),
                            (assign,":speardist",255),
                            (else_try),
                            (eq,":spear","itm_ashwood_pike"),
                            (assign,":speardist",255),
                            (else_try),
                            (eq,":spear","itm_awlpike"),
                            (assign,":speardist",170),
                            (else_try),
                            (assign,":continue",0),
                            (try_end),
Like that.

Unfortunately I can't test it since the compiler keeps giving me errors related to $setting_use_spearwall, telling me I never assigned it. Where IS it meant to be assigned... I'm probably just being dim here. :neutral:
Ah, I see. I'll give that a shot.

插入代码块:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting scripts...
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
ERROR: Usage of unassigned local variable: :agent_class
ERROR: Usage of unassigned local variable: :agent_class
WARNING: Local variable never used: enemy_perc_infantry
WARNING: Local variable never used: enemy_perc_archer
WARNING: Local variable never used: prev_RSS
WARNING: Local variable never used: j
WARNING: Local variable never used: cur_num
WARNING: Local variable never used: cut_in_angle
WARNING: Local variable never used: no_infantry
Exporting mission_template data...
Exporting game menus data...
Error: Unable to find object:trp_custom_battle_fac_7_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_7_troops
Error: Unable to find object:trp_custom_battle_fac_8_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_8_troops
Error: Unable to find object:trp_custom_battle_fac_9_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_9_troops
Error: Unable to find object:trp_custom_battle_fac_10_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_10_troops
Error: Unable to find object:trp_custom_battle_fac_11_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_11_troops
Error: Unable to find object:trp_custom_battle_fac_12_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_12_troops
Error: Unable to find object:trp_custom_battle_fac_13_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_13_troops
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...

______________________________

Script processing has ended.
Press any key to exit. . .
Well, it built exactly the same. So, I'm guessing it should still work exactly the same, so your version does seem an improvement, jubal.
 
Hmm. After Jubal's change not much happened. The pikemen still don't brace their pikes, but now the sergeants that carry bills no longer brace their bills either. Ofcourse, I suppose that that counts as a solution to my old invisible horsekilling beam. :neutral:

Oddly enough my sound seems to be gone again aswell. Though I've had that before.

Re-entering all the bits of mod_temp code except for the spears and range and stuff (with the lot of else_try's) and I got a whole ****eload of new errors:
插入代码块:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting scripts...
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
Error: Unable to find object:itm_wooden_stick
ERROR: Illegal Identifier:itm_wooden_stick
ERROR: Usage of unassigned local variable: :agent_class
ERROR: Usage of unassigned local variable: :agent_class
WARNING: Local variable never used: enemy_perc_infantry
WARNING: Local variable never used: enemy_perc_archer
WARNING: Local variable never used: prev_RSS
WARNING: Local variable never used: j
WARNING: Local variable never used: cur_num
WARNING: Local variable never used: cut_in_angle
WARNING: Local variable never used: no_infantry
Exporting mission_template data...
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $setting_use_spearwall
WARNING: Usage of unassigned global variable: $rout
WARNING: Usage of unassigned global variable: $airout
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
WARNING: Usage of unassigned global variable: $setting_use_spearwall
Error: Unable to find object:itm_wooden_shield
ERROR: Illegal Identifier:itm_wooden_shield
Exporting game menus data...
Error: Unable to find object:trp_custom_battle_fac_7_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_7_troops
Error: Unable to find object:trp_custom_battle_fac_8_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_8_troops
Error: Unable to find object:trp_custom_battle_fac_9_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_9_troops
Error: Unable to find object:trp_custom_battle_fac_10_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_10_troops
Error: Unable to find object:trp_custom_battle_fac_11_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_11_troops
Error: Unable to find object:trp_custom_battle_fac_12_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_12_troops
Error: Unable to find object:trp_custom_battle_fac_13_troops
ERROR: Illegal Identifier:trp_custom_battle_fac_13_troops
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $setting_use_spearwall
WARNING: Global variable never used: $rout
WARNING: Global variable never used: $airout
WARNING: Global variable never used: $setting_use_spearwall

______________________________

Script processing has ended.
Press any key to exit. . .
 
COGlory 说:
I keep getting the same thing.  Along with $rout and $airout
$rout and $airout belong to chel's battle morale system. $rout will be set to 1 if player's troops' morale drop and they re routed. $airout works similar way for enemy side. Just comment the line if you dont have battle morale yet
 
后退
顶部 底部