Tüfekçi Başı said:Crouching triggers are as you write. a = [ trigger1, trigger2, trigger3]
But this is "bodyguard triggers".
bodyguard triggers is a list with 3 triggers inside it, so what is the issue?
Tüfekçi Başı said:Crouching triggers are as you write. a = [ trigger1, trigger2, trigger3]
But this is "bodyguard triggers".
kalarhan said:Tüfekçi Başı said:Crouching triggers are as you write. a = [ trigger1, trigger2, trigger3]
But this is "bodyguard triggers".
bodyguard triggers is a list with 3 triggers inside it, so what is the issue?
+ bodyguard_triggers + crouching_triggers
+ bodyguard_triggers
+ crouching_triggers
kalarhan said:khanh93vn said:Guys, Is there any code in triggers to read/write files on disks? For example: write the number of bandit parties on the map to a txt file while the game is running, and it can be read in-game
you are asking two different things
For SP (not MP + database/website)
1) Is there code to write to disk? Kind of. If you enable EDIT MODE you can use rgl_log.txt and print any message/text you want to
1.1) You can then parse the .txt and use the data on logs, graphs, a second screen, external UI, bug testing, etc
2) Can I read stored information and use it in-game, like in a presentation? Kind of. You can't read from any file in disk, but you can store your info on slots/global variables/name string and use it on your code (those are saved on your savegame files)
VC used both for testing and a small part of that code is still available with its modsys if you want to see examples
Tüfekçi Başı said:...just bodyguard triggers work.
Tüfekçi Başı said:I converted bodyguard trigger to 3 new triggers and I added them in body of mt. They works fine.
("encounter_attack_cannons",
[(eq, "$encountered_party_friendly", 0),
(neg|troop_is_wounded, "trp_player"),
(party_get_current_terrain,":terrain","p_main_party"),
(eq, "$fin_cannon", 1),# for cannons
(neq,":terrain",7),
(neq,":terrain",0),
],
"Charge the enemy(cannons).",
[
(assign, "$g_battle_result", 0),
(assign, "$g_engaged_enemy", 1),
(party_get_template_id, ":encountered_party_template", "$g_encountered_party"),
(try_begin),
(eq, ":encountered_party_template", "pt_village_farmers"),
(unlock_achievement, ACHIEVEMENT_HELP_HELP_IM_BEING_REPRESSED),
(try_end),
(call_script, "script_calculate_renown_value"),
(call_script, "script_calculate_battle_advantage"),
(set_battle_advantage, reg0),
(set_party_battle_mode),
(try_begin),
(eq, "$g_encounter_type", enctype_fighting_against_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(eq, "$g_encounter_type", enctype_catched_during_village_raid),
(assign, "$g_village_raid_evil", 0),
(set_jump_mission,"mt_village_raid"),
(party_get_slot, ":scene_to_use", "$g_encounter_is_in_village", slot_castle_exterior),
(jump_to_scene, ":scene_to_use"),
(else_try),
(set_jump_mission,"mt_lead_charge_cannons"),
(call_script, "script_setup_random_scene_cannon"),
(try_end),
(assign, "$g_next_menu", "mnu_simple_encounter"),
(jump_to_menu, "mnu_battle_debrief"),
(change_screen_mission),
]),
# script_setup_random_scene
# Input: arg1 = center_no, arg2 = mission_template_no
# Output: none
("setup_random_scene_cannon",
[
(party_get_current_terrain, ":terrain_type", "p_main_party"),
(assign, ":scene_to_use", "scn_random_scene"),
(try_begin),
(eq, ":terrain_type", rt_steppe),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,10),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_1"),
(else_try),
(is_between,":battle_scene",10,20),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_2"),
(else_try),
(is_between,":battle_scene",20,30),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_3"),
(else_try),
(is_between,":battle_scene",30,40),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_4"),
(else_try),
(is_between,":battle_scene",40,50),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_5"),
(else_try),
(is_between,":battle_scene",50,60),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_6"),
(else_try),
(is_between,":battle_scene",60,70),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_7"),
(else_try),
(is_between,":battle_scene",70,80),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_8"),
(else_try),
(is_between,":battle_scene",80,90),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_9"),
(else_try),
(is_between,":battle_scene",90,95),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_10"),
(else_try),
(is_between,":battle_scene",95,100),
(assign, ":scene_to_use", "scn_random_scene_steppe_custom_11"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_plain),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,4),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_1"),
(else_try),
(is_between,":battle_scene",4,7),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_2"),
(else_try),
(is_between,":battle_scene",7,10),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_3"),
(else_try),
(is_between,":battle_scene",10,13),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_4"),
(else_try),
(is_between,":battle_scene",13,16),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_5"),
(else_try),
(is_between,":battle_scene",16,19),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_6"),
(else_try),
(is_between,":battle_scene",19,22),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_7"),
(else_try),
(is_between,":battle_scene",22,25),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_8"),
(else_try),
(is_between,":battle_scene",25,28),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_9"),
(else_try),
(is_between,":battle_scene",28,31),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_10"),
(else_try),
(is_between,":battle_scene",31,34),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_11"),
(else_try),
(is_between,":battle_scene",34,37),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_12"),
(else_try),
(is_between,":battle_scene",37,40),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_13"),
(else_try),
(is_between,":battle_scene",40,43),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_14"),
(else_try),
(is_between,":battle_scene",43,46),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_15"),
(else_try),
(is_between,":battle_scene",46,49),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_16"),
(else_try),
(is_between,":battle_scene",49,52),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_17"),
(else_try),
(is_between,":battle_scene",52,55),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_18"),
(else_try),
(is_between,":battle_scene",55,58),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_19"),
(else_try),
(is_between,":battle_scene",58,61),
(assign, ":scene_to_use", "scn_random_scene_plain_custom_20"),
(else_try),
(is_between,":battle_scene",61,64),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_1"),
(else_try),
(is_between,":battle_scene",64,67),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_2"),
(else_try),
(is_between,":battle_scene",67,70),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_3"),
(else_try),
(is_between,":battle_scene",70,73),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_4"),
(else_try),
(is_between,":battle_scene",73,76),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_5"),
(else_try),
(is_between,":battle_scene",76,79),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_6"),
(else_try),
(is_between,":battle_scene",79,82),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_7"),
(else_try),
(is_between,":battle_scene",82,85),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_8"),
(else_try),
(is_between,":battle_scene",85,87),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_9"),
(else_try),
(is_between,":battle_scene",87,89),
(assign, ":scene_to_use", "scn_random_scene_plain_mountain_custom_10"),
(else_try),
(is_between,":battle_scene",89,91),
(assign, ":scene_to_use", "scn_random_scene_plain_river_custom_1"),
(else_try),
(is_between,":battle_scene",91,93),
(assign, ":scene_to_use", "scn_random_scene_plain_river_custom_2"),
(else_try),
(is_between,":battle_scene",93,96),
(assign, ":scene_to_use", "scn_random_scene_plain_river_custom_3"),
(else_try),
(is_between,":battle_scene",96,99),
(assign, ":scene_to_use", "scn_random_scene_plain_river_custom_4"),
(else_try),
(is_between,":battle_scene",99,100),
(assign, ":scene_to_use", "scn_random_scene_plain_river_custom_5"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_snow),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,10),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_1"),
(else_try),
(is_between,":battle_scene",10,20),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_2"),
(else_try),
(is_between,":battle_scene",20,30),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_3"),
(else_try),
(is_between,":battle_scene",30,40),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_4"),
(else_try),
(is_between,":battle_scene",40,50),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_5"),
(else_try),
(is_between,":battle_scene",50,60),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_6"),
(else_try),
(is_between,":battle_scene",60,70),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_7"),
(else_try),
(is_between,":battle_scene",70,80),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_8"),
(else_try),
(is_between,":battle_scene",80,90),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_9"),
(else_try),
(is_between,":battle_scene",90,95),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_10"),
(else_try),
(is_between,":battle_scene",95,100),
(assign, ":scene_to_use", "scn_random_scene_snow_custom_11"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_desert),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,10),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_1"),
(else_try),
(is_between,":battle_scene",10,20),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_2"),
(else_try),
(is_between,":battle_scene",20,30),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_3"),
(else_try),
(is_between,":battle_scene",30,40),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_4"),
(else_try),
(is_between,":battle_scene",40,50),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_5"),
(else_try),
(is_between,":battle_scene",50,60),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_6"),
(else_try),
(is_between,":battle_scene",60,70),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_7"),
(else_try),
(is_between,":battle_scene",70,80),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_8"),
(else_try),
(is_between,":battle_scene",80,90),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_9"),
(else_try),
(is_between,":battle_scene",90,100),
(assign, ":scene_to_use", "scn_random_scene_desert_custom_10"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_steppe_forest),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,20),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_1"),
(else_try),
(is_between,":battle_scene",20,40),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_2"),
(else_try),
(is_between,":battle_scene",40,60),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_3"),
(else_try),
(is_between,":battle_scene",60,80),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_4"),
(else_try),
(is_between,":battle_scene",80,100),
(assign, ":scene_to_use", "scn_random_scene_steppe_forest_custom_5"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_forest),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,10),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_1"),
(else_try),
(is_between,":battle_scene",10,20),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_2"),
(else_try),
(is_between,":battle_scene",20,30),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_3"),
(else_try),
(is_between,":battle_scene",30,40),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_4"),
(else_try),
(is_between,":battle_scene",40,50),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_5"),
(else_try),
(is_between,":battle_scene",50,60),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_6"),
(else_try),
(is_between,":battle_scene",60,70),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_7"),
(else_try),
(is_between,":battle_scene",70,80),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_8"),
(else_try),
(is_between,":battle_scene",80,90),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_9"),
(else_try),
(is_between,":battle_scene",90,100),
(assign, ":scene_to_use", "scn_random_scene_plain_forest_custom_10"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_snow_forest),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,20),
(assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_1"),
(else_try),
(is_between,":battle_scene",20,40),
(assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_2"),
(else_try),
(is_between,":battle_scene",40,60),
(assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_3"),
(else_try),
(is_between,":battle_scene",60,80),
(assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_4"),
(else_try),
(is_between,":battle_scene",80,100),
(assign, ":scene_to_use", "scn_random_scene_snow_forest_custom_5"),
(try_end),
(else_try),
(eq, ":terrain_type", rt_desert_forest),
(store_random_in_range,":battle_scene",1,100),
(try_begin),
(is_between,":battle_scene",1,20),
(assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_1"),
(else_try),
(is_between,":battle_scene",20,40),
(assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_2"),
(else_try),
(is_between,":battle_scene",40,60),
(assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_3"),
(else_try),
(is_between,":battle_scene",60,80),
(assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_4"),
(else_try),
(is_between,":battle_scene",80,100),
(assign, ":scene_to_use", "scn_random_scene_desert_forest_custom_5"),
(try_end),
(try_end),
(jump_to_scene,":scene_to_use"),
]),
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_6"), #Bilecik - Constantinople
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_1"), #Constantinople - Bilecik
(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_6"), #Bilecik - Constantinople
(call_script, "script_set_trade_route_between_centers", "p_town_6", "p_town_2"), #Constantinople - Not to Bilecik, to Thir
HyperCharge said:(call_script, "script_set_trade_route_between_centers", "p_town_1", "p_town_6"), #Bilecik - Constantinople
["ready_bow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_bow,
[1.5, "anim_human", combat+500, combat+530, blend_in_ready|arf_make_custom_sound, pack2f(0.14, 0.44)],
],
You can, which would be 1.5. Although that time will be modified by each troops attribute/skill points which might be an extra complication.Oliveran said:I'm making an archer AI. Currently I have a code that "perfectly" calculates how far forward it's supposed to aim to hit a moving target. However, I've hit a "sort of" barrier here. There's a combat status operation:
agent_get_combat_state, Where combat state 3 is "preparing a melee attack or firing a ranged weapon". Setting a target position to aim for, when it's about to fire the attack, causing it to never release it's shot as shown in the video.
So, because I must wait for the AI to draw the bow or xbow fully; is there any way to know how long time the draw animation takes? So I can set the position to aim for properly.
Edit:
Looking at the module_animation for "ready_bow". It says this:
Where the second list, with [1.5, "anim_human", combat+500, combat+530, blend_in_ready|arf_make_custom_sound, pack2f(0.14, 0.44)],Code:["ready_bow", acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_bow, [1.5, "anim_human", combat+500, combat+530, blend_in_ready|arf_make_custom_sound, pack2f(0.14, 0.44)], ],
I wonder if I can get the time the animation takes from this?
Yes, but I wanted the question to imply that I want to know how much the attribute affects the timeRuthven said:You can, which would be 1.5. Although that time will be modified by each troops attribute/skill points which might be an extra complication.
zidozido said:reassign fiefs
Masterancza said:How to force game to display troop upgrading cost at party screen?
I've seen this feature in various mods but I can't find out how to do it
Script 'game_get_upgrade_cost' is determining the upgrade cost but there's no single line about displaying it on party screen.
Masterancza said:How to force game to display troop upgrading cost at party screen?
I've seen this feature in various mods but I can't find out how to do it
Script 'game_get_upgrade_cost' is determining the upgrade cost but there's no single line about displaying it on party screen.