@Jarv, at the moment it is only occuring 1 per hour, in that it checks if the player is within range 1 time every hour, you I presume want it to fire every frame so should set this to 0,
(1,
[
(try_for_parties, ":parties"),
(party_is_active, ":parties"),
(assign, ":main", "p_main_party"),
(party_get_position, pos1, ":main"),
(party_get_position, pos2, ":parties"),
(get_distance_between_positions, ":distance_to_region_node", pos1, pos2),
(lt,":distance_to_region_node", 300),
(try_begin),
(eq, ":parties", "p_town_6"),
(display_message, "@You are now entering Anorien.", 0x0000FF),
(else_try),
(eq, ":parties", "p_town_8"),
(display_message, "@You are now entering Belfalas.", 0x0000FF),
(try_end),
(try_end),
]),
It's in centimeters, as there's another operation calledJarvisimo said:Also, another question - what unit of distance is the 300 in (lt,":distance_to_region_node", 300),?
[color=navy](get_distance_between_positions_in_meters)[/color]
(0,
[
(try_for_parties, ":parties"),
(party_is_active, ":parties"),
(assign, ":main", "p_main_party"),
(party_get_position, pos1, ":main"),
(party_get_position, pos2, ":parties"),
(get_distance_between_positions, ":distance_to_region_node", pos1, pos2),
(lt,":distance_to_region_node", 300),
(try_begin),
(eq, ":parties", "p_town_6"),
(eq, "$inregion",0),
(display_message, "@You are now entering Anorien.", 0x0000FF),
(assign, "$inregion",1),
(else_try),
(eq, ":parties", "p_town_8"),
(eq, "$inregion",0),
(display_message, "@You are now entering Belfalas.", 0x0000FF),
(assign, "$inregion",1),
(try_end),
(gt,":distance_to_region_node", 300),
(try_begin),
(eq, ":parties", "p_town_6"),
(eq, "$inregion",1),
(display_message, "@You are now leaving Anorien.", 0x0000FF),
(assign, "$inregion",0),
(else_try),
(eq, ":parties", "p_town_8"),
(eq, "$inregion",1),
(display_message, "@You are now leaving Belfalas.", 0x0000FF),
(assign, "$inregion",0),
(try_end),
(try_end),
]),
#set your fixed point multiplier
(party_get_position, pos1, "p_main_party"),
(try_for_range, ":center_no"),
(party_get_position, pos2, ":center_no"),
(get_distance_between_positions, ":distance_to_region_node", pos1, pos2),
(lt, ":distance_to_region_node", 300), #also check for boundary (region around 300 units)
(party_get_slot, ":old_distance", ":center_no", slot_center_whatever),
(assign, reg1, -1),
(try_begin), #going in
(gt, ":old_distance", ":distance_to_region_node"),
(assign, reg1, 1),
(else_try),
(lt, ":old_distance", ":distance_to_region_node"),
(assign, reg1, 0),
(try_end),
(try_begin), #display message
(neq, reg1, -1),
(party_set_slot, ":center_no", slot_center_whatever, ":distance_to_region_node"),
(str_store_party_name_link, s1, ":center_no"),
(display_message, "@You are now {reg1?entering:leaving} {s1}.", 0x0000FF),
(try_end),
(else_try), #party outside domain
(party_set_slot, ":center_no", slot_center_whatever, 9999),
(try_end),
(0, [
(try_begin),
(eq, "$inregion", 0), # The main party is not in a region
(party_get_position, pos1, "p_main_party"),
(try_begin),
(party_get_position, pos2, "p_town_6"),
(get_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", 300),
(display_message, "@You are now entering Anorien.", 0x0000FF),
(assign, "$inregion", 1),
(else_try),
(party_get_position, pos2, "p_town_8"),
(get_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", 300),
(display_message, "@You are now entering Belfalas.", 0x0000FF),
(assign, "$inregion", 1),
(try_end),
(else_try),
(eq, "$inregion", 1), # Just so we're safe from rogue inregion values
(party_get_position, pos1, "p_main_party"),
(try_begin),
(party_get_position, pos2, "p_town_6"),
(get_distance_between_positions, ":dist", pos1, pos2),
(ge, ":dist", 300),
(display_message, "@You are now leaving Anorien.", 0x0000FF),
(assign, "$inregion", 0),
(else_try),
(party_get_position, pos2, "p_town_8"),
(get_distance_between_positions, ":dist", pos1, pos2),
(ge, ":dist", 300),
(display_message, "@You are now leaving Belfalas.", 0x0000FF),
(assign, "$inregion", 0),
(try_end),
(try_end),
]),
jacobhinds said:openbrf is a file editor you can download, just google it. then find the piece of armour you want to change in the resource folder of whatever module you're using (use ctrl-f in openbrf because there are a lot of .brf files in the resource folder) and apply feminized frame to that item.
Oh Lumos, you are quite the flirt. I'm blushing.Lumos said:Your indentation is nearly perfect as it is
Any operation you know of that will accept a range? It seems horribly inefficient to iterate through every party and then to an is_between.Lav said:It happens because (try_for_parties) does not accept a range, it iterates through all parties. Including Sargoth itself. And since it's calculated strength definitely matches the (ge) criteria...
("smithy_anvil", 0,"smithy_anvil","bo_smithy_anvil",
[
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(prop_instance_get_variation_id, ":var_id", ":instance_no"),
(eq, ":var_id", 1),
(set_fixed_point_multiplier, 1),
(position_get_x, ":attacker_agent_id", pos2),
(get_player_agent_no, ":player_agent"),
(agent_get_player_id, ":player_id",":player_agent"),
(agent_is_human, ":player_agent"),
(eq, ":player_agent", ":attacker_agent_id"),
(multiplayer_send_int_to_player, ":player_id", multiplayer_event_show_bk_mode, ":player_agent"),
(try_end),
]),
]),
(else_try),
(eq, ":event_type", multiplayer_event_show_bk_mode),
(store_script_param, ":value_player_no", 3),
(try_begin),
(agent_is_active, ":value_player_no"),
(neq,":value_player_no",0),
(try_begin),
(neg|agent_slot_eq, ":value_player_no", slot_agent_in_bk_mode, ":value_player_no"),
(agent_set_slot, ":value_player_no", slot_agent_in_bk_mode, ":value_player_no"),
(display_message, "@Berserker mode activated!", 0xFF001eff),
(else_try),
(agent_slot_eq, ":value_player_no", slot_agent_in_bk_mode, ":value_player_no"),
(agent_set_slot, ":value_player_no", slot_agent_in_bk_mode, -1),
(display_message, "@Berserker mode cancelled!", 0xFF001eff),
(try_end),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(set_fixed_point_multiplier, 1),
(position_get_x, ":attacker_agent_id", pos2),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(prop_instance_get_variation_id, ":var_id", ":instance_no"),
(eq, ":var_id", 1),
(neg|agent_is_non_player, ":attacker_agent_id"), #makes sure that the agent that hit the anvil is controlled by a player (it can be a bot too); it also removes the necessity of putting player_is_active below, since we know that this operation will only be false if the agent is controlled by a player, and if we negate it (neg|) will result that it will be true if the agent is controlled by a player
(agent_get_player_id, ":player_id", ":attacker_agent_id"),
(player_is_active, ":player_id"), #we already know that the agent is controlled by a player, but we put this check because most modders forgot about it normally (you can delete this line, the result will be the same)
(str_clear, s1),
###do your verifications below, agent get slot, compare the things, give superpowers to the agent id and make a proper output message stored in s1
(multiplayer_send_string_to_player, ":player_id", multiplayer_event_show_server_message, s1),
(try_end),
]),
Could happen if someone leaves and another player joins the server.K.A. said:Thanks, i undestand now. Last thing, i noticed that agent id changes when dies. Is it the same for player id ?
Player ID should stay the same unless they rejoin the server. If you really want the berserk status to be persistent even if a player leaves track it by the player's unique id.K.A. said:Thanks, i undestand now. Last thing, i noticed that agent id changes when dies. Is it the same for player id ?
Use the ubiquitousThe Dark Robin said:Any operation you know of that will accept a range? It seems horribly inefficient to iterate through every party and then to an is_between.
try_for_range
Minor nitpick: try_for_parties followed by party_get_template_id with an is_between check.cmpxchg8b said:If you want to iterate through all bandit parties on the map, your only option is using try_for_parties with an is_between check.