Hello Gokiller, I'm having some problems. I want to create a new sections for the Infantry in order to divide it. But I want diferents names for each faction and each unit tipe. I tryed it but doesn't work, i don't know if it isn't possible or ir cause I did something wrong.
I'm getting this error: 'int' object is not callable.
First of all, the unit types that I want for each faction was:
Spoiler
Faction 1
- Maestrazgo's Ift
- Northern Ift
- Cavalry
- Specialist
Faction 2
- Liberal Ift
- Royal Infantry
- Cavalry
- Specialist
As I want diferent unit types for each faction I supposed that I need to create 4 new unit types and assign them the units (I dont know if this is possible or not)
Now I'm going to sow you what I did.
module_strings:
#Unit Selection
("infantry", "Infantry"),
("infantry1", "Maestrazgo's Ift"),
("infantry2", "Northern Ift"),
("infantry3", "Liberal Ift"),
("infantry4", "Royal Infantry"),
("cavalry", "Cavalry"),
("specialists", "Specialists"),
("ranker", "Ranker"),
("equipment", "Equipment:"),
("random", "Random"),
("howitzer", "Howitzer"),
("cannon", "Cannon"),
module_presentations:
### REGIMENT SELECT ###
(try_begin),
#(is_between,":my_team_no",0,2), #Player has selected a team - load regiment presentation
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0x000000),
(overlay_set_alpha, reg0, 0xD0),
(position_set_x, pos1, 110),
(position_set_y, pos1, 660),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 5500),
(position_set_y, pos1, 1600),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0x000000),
(overlay_set_alpha, reg0, 0xD0),
(position_set_x, pos1, 110),
(position_set_y, pos1, 610),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 5500),
(position_set_y, pos1, 1600),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0x000000),
(overlay_set_alpha, reg0, 0xD0),
(position_set_x, pos1, 240),
(position_set_y, pos1, 660),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 5500),
(position_set_y, pos1, 1600),
(overlay_set_size, reg0, pos1),
(create_mesh_overlay, reg0, "mesh_white_plane"),
(overlay_set_color, reg0, 0x000000),
(overlay_set_alpha, reg0, 0xD0),
(position_set_x, pos1, 370),
(position_set_y, pos1, 660),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 5500),
(position_set_y, pos1, 1600),
(overlay_set_size, reg0, pos1),
(create_button_overlay, "$g_presentation_obj_select_infantry", "str_infantry", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_infantry),
(overlay_set_color,"$g_presentation_obj_select_infantry",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_infantry",0xFFFFFF),
(try_end),
(position_set_x, pos1, 125),
(position_set_y, pos1, 660),
(overlay_set_position, "$g_presentation_obj_select_infantry", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_infantry", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_infantry",100),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_infantry",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_infantry",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_infantry",1000),
(create_button_overlay, "$g_presentation_obj_select_infantry1", "str_infantry1", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_infantry1),
(overlay_set_color,"$g_presentation_obj_select_infantry1",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_infantry1",0xFFFFFF),
(try_end),
(position_set_x, pos1, 125),
(position_set_y, pos1, 660),
(overlay_set_position, "$g_presentation_obj_select_infantry1", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_infantry1", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_infantry1",100),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_infantry1",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_infantry1",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_infantry1",1000),
(create_button_overlay, "$g_presentation_obj_select_infantry2", "str_infantry2", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_infantry2),
(overlay_set_color,"$g_presentation_obj_select_infantry2",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_infantry2",0xFFFFFF),
(try_end),
(position_set_x, pos1, 125),
(position_set_y, pos1, 610),
(overlay_set_position, "$g_presentation_obj_select_infantry2", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_infantry3", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_infantry2",100),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_infantry2",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_infantry2",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_infantry2",1000),
(create_button_overlay, "$g_presentation_obj_select_infantry3", "str_infantry3", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_infantry3),
(overlay_set_color,"$g_presentation_obj_select_infantry3",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_infantry3",0xFFFFFF),
(try_end),
(position_set_x, pos1, 125),
(position_set_y, pos1, 660),
(overlay_set_position, "$g_presentation_obj_select_infantry3", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_infantry3", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_infantry3",100),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_infantry3",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_infantry3",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_infantry3",1000),
(create_button_overlay, "$g_presentation_obj_select_infantry4", "str_infantry4", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_infantry4),
(overlay_set_color,"$g_presentation_obj_select_infantry4",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_infantry4",0xFFFFFF),
(try_end),
(position_set_x, pos1, 125),
(position_set_y, pos1, 610),
(overlay_set_position, "$g_presentation_obj_select_infantry4", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_infantry4", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_infantry4",100),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_infantry4",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_infantry4",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_infantry4",1000),
(create_button_overlay, "$g_presentation_obj_select_cavalry", "str_cavalry", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_cavalry),
(overlay_set_color,"$g_presentation_obj_select_cavalry",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_cavalry",0xFFFFFF),
(try_end),
(position_set_x, pos1, 255),
(position_set_y, pos1, 660),
(overlay_set_position, "$g_presentation_obj_select_cavalry", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_cavalry", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_cavalry",250),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_cavalry",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_cavalry",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_cavalry",1000),
(create_button_overlay, "$g_presentation_obj_select_artillery", "str_specialists", 0),
(try_begin),
(eq, "$g_multiplayer_select_presentation_unit_type", troop_select_type_artillery),
(overlay_set_color,"$g_presentation_obj_select_artillery",0xECEB82),
(else_try),
(overlay_set_color,"$g_presentation_obj_select_artillery",0xFFFFFF),
(try_end),
(position_set_x, pos1, 370),
(position_set_y, pos1, 660),
(overlay_set_position, "$g_presentation_obj_select_artillery", pos1),
#(position_set_x, pos1, 1500),
#(position_set_y, pos1, 1500),
#(overlay_set_size, "$g_presentation_obj_select_artillery", pos1),
(troop_set_slot,"trp_x_pos","$g_presentation_obj_select_artillery",400),
(troop_set_slot,"trp_y_pos","$g_presentation_obj_select_artillery",660),
(troop_set_slot,"trp_x_size","$g_presentation_obj_select_artillery",1000),
(troop_set_slot,"trp_y_size","$g_presentation_obj_select_artillery",1000),
(else_try),
(eq,":object","$g_presentation_obj_select_back"),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_team_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_infantry"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_infantry),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_infantry1"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_infantry1),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_infantry2"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_infantry2),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_infantry3"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_infantry3),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_infantry4"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_infantry4),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_cavalry"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_cavalry),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
(else_try),
(eq,":object","$g_presentation_obj_select_artillery"),
(assign, "$g_multiplayer_select_presentation_unit_type",troop_select_type_artillery),
(presentation_set_duration, 0),
(start_presentation,"prsnt_multiplayer_item_select"),
module_constants:
troop_select_type_infantry = 1
troop_select_type_infantry1 = 1
troop_select_type_infantry2 = 2
troop_select_type_infantry3 = 1
troop_select_type_infantry4 = 2
troop_select_type_cavalry = 3
troop_select_type_artillery = 4
module_scripts:
# script_multiplayer_get_unit_type_for_select_presentation
# Input: arg1 = troop_id
# Output: reg0 = unit_type
("multiplayer_get_unit_type_for_select_presentation",
[
(try_begin),
(this_or_next|is_between, ":troop_no", "trp_british_infantry","trp_british_infantry2"), # Brits
(assign,":unit_type",troop_select_type_infantry1),
(else_try)
(this_or_next|is_between, ":troop_no", "trp_british_infantry2","trp_british_hussar"), # Brits
(assign,":unit_type",troop_select_type_infantry2),
(else_try)
(this_or_next|is_between, ":troop_no", "trp_french_infantry","trp_french_infantry2"), # French
(assign,":unit_type",troop_select_type_infantry3),
(else_try)
(this_or_next|is_between, ":troop_no", "trp_french_infantry2","trp_french_hussar"), # French
(assign,":unit_type",troop_select_type_infantry4),
(try_begin), # Cavalry
(this_or_next|is_between, ":troop_no", "trp_british_hussar","trp_british_arty"), # Brits
(this_or_next|is_between, ":troop_no", "trp_french_hussar","trp_french_arty"), # French
(this_or_next|is_between, ":troop_no", "trp_prussian_dragoon","trp_prussian_arty"), # Prussian
(this_or_next|is_between, ":troop_no", "trp_russian_hussar","trp_russian_arty"), # Russian
(is_between, ":troop_no", "trp_austrian_hussar","trp_austrian_arty"), # Austrian
(assign,":unit_type",troop_select_type_cavalry),
(else_try),
(this_or_next|is_between, ":troop_no", "trp_british_arty","trp_french_infantry"), # Brits
(this_or_next|is_between, ":troop_no", "trp_french_arty","trp_prussian_infantry"), # French
(this_or_next|is_between, ":troop_no", "trp_prussian_arty","trp_russian_partizan"), # Prussian
(this_or_next|is_between, ":troop_no", "trp_russian_arty","trp_austrian_infantry"), # Russian
(is_between, ":troop_no", "trp_austrian_arty","trp_british_arty_commander"), # Austrian
(assign,":unit_type",troop_select_type_artillery),
(try_end),
(assign,reg0,":unit_type"),
]),
And this is how it looks ingame:
So if you or anyone can help I will be so grateful.
Cheers.
Mercuri