Dusk Voyager said:# script_decide_run_away_or_not
# Input: none
# Output: none
("decide_run_away_or_not",
[
(store_script_param, ":cur_agent", 1),
(store_script_param, ":mission_time", 2),
(assign, ":force_retreat", 0),
(agent_get_team, ":agent_team", ":cur_agent"),
(agent_get_division, ":agent_division", ":cur_agent"),
(try_begin),
(lt, ":agent_division", 9), #static classes
(team_get_movement_order, ":agent_movement_order", ":agent_team", ":agent_division"),
(eq, ":agent_movement_order", mordr_retreat),
(assign, ":force_retreat", 1),
(try_end),
(agent_get_slot, ":is_cur_agent_running_away", ":cur_agent", slot_agent_is_running_away),
(try_begin),
(eq, ":is_cur_agent_running_away", 0),
(try_begin),
(eq, ":force_retreat", 1),
(agent_start_running_away, ":cur_agent"),
(agent_set_slot, ":cur_agent", slot_agent_is_running_away, 1),
(else_try),
(ge, ":mission_time", 45), #first 45 seconds anyone does not run away whatever happens.
(agent_get_slot, ":agent_courage_score", ":cur_agent", slot_agent_courage_score),
(store_agent_hit_points, ":agent_hit_points", ":cur_agent"),
(val_mul, ":agent_hit_points", 4),
(try_begin),
(agent_is_ally, ":cur_agent"),
(val_sub, ":agent_hit_points", 100), #ally agents will be more tend to run away, to make game more funnier/harder
(try_end),
(val_mul, ":agent_hit_points", 10),
(store_sub, ":start_running_away_courage_score_limit", 3500, ":agent_hit_points"),
(lt, ":agent_courage_score", ":start_running_away_courage_score_limit"), #if (courage score < 3500 - (agent hit points * 40)) and (agent is not running away) then start running away, average hit points : 50, average running away limit = 1500
(agent_get_troop_id, ":troop_id", ":cur_agent"), #for now do not let heroes to run away from battle
(neg|troop_is_hero, ":troop_id"),
(agent_start_running_away, ":cur_agent"),
(agent_set_slot, ":cur_agent", slot_agent_is_running_away, 1),
(try_end),
(else_try),
(neq, ":force_retreat", 1),
(agent_get_slot, ":agent_courage_score", ":cur_agent", slot_agent_courage_score),
(store_agent_hit_points, ":agent_hit_points", ":cur_agent"),
(val_mul, ":agent_hit_points", 4),
(try_begin),
(agent_is_ally, ":cur_agent"),
(val_sub, ":agent_hit_points", 100), #ally agents will be more tend to run away, to make game more funnier/harder
(try_end),
(val_mul, ":agent_hit_points", 10),
(store_sub, ":stop_running_away_courage_score_limit", 3700, ":agent_hit_points"),
(ge, ":agent_courage_score", ":stop_running_away_courage_score_limit"), #if (courage score > 3700 - agent hit points) and (agent is running away) then stop running away, average hit points : 50, average running away limit = 1700
(agent_stop_running_away, ":cur_agent"),
(agent_set_slot, ":cur_agent", slot_agent_is_running_away, 0),
(try_end),
]), #ozan(3, 0, 0, [
(try_for_agents, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(store_mission_timer_a,":mission_time"),
(ge,":mission_time",3),
(call_script, "script_decide_run_away_or_not", ":agent_no", ":mission_time"),
(try_end),
], []), #controlling courage score and if needed deciding to run away for each agentBut you might have to modify the script a bit to help agents find their way with minimal damage especially in sieges.castle_attack_walls_defenders_sally
castle_attack_walls_belfry
castle_attack_walls_ladder
quick_battle_battle
quick_battle_siege
["new_ani", 0, amf_play|amf_priority_die|amf_start_instantly,
[14.2, "new_ani", 0, 177, arf_cyclic]],
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1,":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(try_begin),
(eq, ":troop_no", "trp_dancing_damsel"),
(agent_set_animation, ":agent_no", "anim_new_ani"),
(display_message, "@Debug: dancing animation started."),
(try_end),
]),
Why not just add visitors to the site and then move them from the spawn entry point?Arch3r said:Has anyone tried using the spawn_agent operation for multiplayer?
(try_begin),
(eq,"$background_type",cb_belorussian),
(troop_add_item, "trp_player","itm_mosk_armyak",0),
(troop_add_item, "trp_player","itm_ukrine_prosta_shapka",0),
(troop_add_item, "trp_player","itm_bread",0),
(troop_add_item, "trp_player","itm_dried_meat",0),
(troop_add_item, "trp_player","itm_cabbages",0),
(troop_add_item, "trp_player","itm_cabbages",0),
(else_try),
(eq,"$background_type",cb_westerneu),
(troop_add_item, "trp_player","itm_evropa_odejda_sela_b",0),
(troop_add_item, "trp_player","itm_evropa_shlapa_b",0),
(troop_add_item, "trp_player","itm_bread",0),
(troop_add_item, "trp_player","itm_bread",0),
(troop_add_item, "trp_player","itm_smoked_fish",0),
(troop_add_item, "trp_player","itm_dried_meat",0),
(try_end),
(
"choose_skill",mnf_disable_all_keys,"You spot a battle-ready men in the distance.",
"none",
[(assign,"$current_string_reg",10)],
[
("begin_adventuring",[],"See what trouble is afoot.",[
(set_show_messages, 0),
]),
]
),
Caba`drin said:(assign, ":target_agent", -1),
(assign, ":close_dist", 999),
(agent_get_look_position, pos1, ":player"),
(try_for_agents, ":agent"),
#add in checks for agent being alive, human, ally, whatever you need
(agent_get_position, pos2, ":agent"),
(neg|position_is_behind_position, pos2, pos1),
(position_has_line_of_sight_to_position, pos2, pos1),
(get_distance_between_positions, ":distance", pos2, pos1),
(lt, ":distance", ":close_dist"),
(assign, ":close_dist", ":distance"), #My bad. Forgot this obvious line originally.
(assign, ":target_agent", ":agent"),
(try_end),
Yes. The animation played in lighting speed and repeats itself. I could not find a way to slow the animation down though. Should I change settings in OpenBRF of the animation? Would that help? Else I can make a mt trigger that restarts the animation when it is finished, however that is quite some extra work.Lumos said:I've successfully created looping animations using amf_use_cycle_period along with arf_cyclic on their sub-entries. Did you try with that?
It was mostly for the storing of the agent in reg0.Somebody said:Why not just add visitors to the site and then move them from the spawn entry point?Arch3r said:Has anyone tried using the spawn_agent operation for multiplayer?
They're hardcoded. You might be able to suppress them with (set_show_messages, 0) but it will probably suppress chat as well.minnakodunum said:Is there any way to disable battle log in multiplayer? To make it only for chat?
(party_set_slot, "p_village_66", slot_village_bound_center, "p_town_13"),
(store_faction_of_party, ":town_faction", "p_town_13"),
(call_script, "script_give_center_to_faction_aux", "p_village_66", ":town_faction"),