I have problem that enemy troops are spawning about 10 meters away from my own troops in field battles.
Arch3r said:Does anyone know any tools for module_presentations or has some tips n tricks?
(0, 0, 2,
[
(key_is_down, key_n),
],
[
(multiplayer_is_server),
(multiplayer_get_my_player, ":player_no"),
(player_get_agent_id, ":agent_id", ":player_no"),
(assign, ":scene_prop_1", "spr_aa_powershot"),
(agent_get_position, pos5, ":agent_id"),
(set_spawn_position, pos5),
(spawn_scene_prop, ":scene_prop_1"),
(scene_prop_get_instance, ":scene_prop_id", ":scene_prop_1"),
(prop_instance_get_starting_position, pos5, ":scene_prop_id"),
(agent_get_look_position, pos6, ":agent_id"),
(position_move_y, pos6, 2500),
(prop_instance_animate_to_position, ":scene_prop_id", pos6, 100),
(assign, "$caster_agent_id", ":agent_id"),
(agent_set_slot, ":agent_id", slot_agent_is_caster, 1),
(display_message, "@Powershot created"),
## (multiplayer_send_int_to_server, event_aa_powershot_done, 1),
]),
That is a contradiction: on a proper server, you can't get "my player" or handle a key_is_down operation. You need to have a trigger checking the key_is_down operation on the clients which sends a network message to the server requesting the "power shot", then in the corresponding server network message handler check whether the player is allowed to perform the action, if so apply it. See this old (but good) thread for a basic guide on multiplayer network messages: http://forums.taleworlds.com/index.php/topic,94854.0.html (note that agent_play_sound is synced to nearby clients by the engine, so the specific example in that thread is not necessary unless playing very loud sounds heard at long range).minnakodunum said:Code:(multiplayer_is_server), (multiplayer_get_my_player, ":player_no"),
(0, 0, 2,
[
(multiplayer_is_dedicated_server),
(key_is_down, key_n),
],
[
(assign, ":value", 1),
(multiplayer_send_int_to_server, multiplayer_event_client_send_powershot, ":value"),
]),
(else_try),
(eq, ":event_type", multiplayer_event_client_send_powershot),
(store_script_param, ":value1", 3),
(assign, ":scene_prop_1", "spr_aa_powershot"),
(neq, ":player_no", 0),
(player_get_agent_id, ":agent_id", ":player_no"),
(agent_get_position, pos5, ":agent_id"),
(set_spawn_position, pos5),
(spawn_scene_prop, ":scene_prop_1"),
(scene_prop_get_instance, ":scene_prop_id", ":scene_prop_1"),
(prop_instance_get_starting_position, pos5, ":scene_prop_id"),
(agent_get_look_position, pos6, ":agent_id"),
(position_move_y, pos6, 2500),
(prop_instance_animate_to_position, ":scene_prop_id", pos6, 100),
(agent_set_slot, ":agent_id", slot_agent_is_in_draw_mode, 1),
(get_max_players, ":max_players"),
(try_for_range, ":cur_player", 0, ":max_players"),
(player_is_active, ":cur_player"),
(val_add, ":value1", 1),
(multiplayer_send_int_to_player, ":cur_player", multiplayer_event_client_do_powershot,":value1"),
(try_end),
(else_try),
(else_try),
(eq, ":event_type", multiplayer_event_client_do_powershot),
(store_script_param, ":value2", 3),
(val_add, ":value2", 1),
(str_clear, s1),
(str_store_string, s1,":value2"),
(display_message, "@Powershot created"),
(display_message, "@ {s1} must be a number"),
(else_try),
And would this work if i manage to check key is down trigger in dedicated server?
(10, 0, 0,
[
(multiplayer_is_dedicated_server),
],
[
(assign, ":scene_prop_1", "spr_aa_powershot"),
(try_for_agents, ":agent_id"),
(agent_is_alive, ":agent_id"),
(agent_is_human, ":agent_id"),
(agent_get_position, pos5, ":agent_id"),
(agent_get_look_position, pos6, ":agent_id"),
(position_move_y, pos6, 1000),
(set_spawn_position, pos5),
(spawn_scene_prop, ":scene_prop_1"),
(scene_prop_get_instance, ":scene_prop_id", ":scene_prop_1"),
(prop_instance_get_starting_position, pos5, ":scene_prop_id"),
(prop_instance_animate_to_position, ":scene_prop_id", pos6, 100),
(try_end),
(multiplayer_send_4_int_to_player, ":player_no", multiplayer_event_set_scene_weather, "$mpcoop_time_of_day","$mpcoop_cloud","$mpcoop_haze","$mpcoop_rain"),
(else_try),
(eq, ":event_type", multiplayer_event_set_scene_weather),
(store_script_param, "$mpcoop_time_of_day", 3),
(store_script_param, "$mpcoop_cloud", 4),
(store_script_param, "$mpcoop_haze", 5),
(store_script_param, "$mpcoop_rain", 6),
(set_global_cloud_amount, "$mpcoop_cloud"),
(set_global_haze_amount, "$mpcoop_haze"),
(scene_set_day_time, "$mpcoop_time_of_day"),
(assign, ":rain_amount", "$mpcoop_cloud"),
(assign, ":rain_type", "$mpcoop_rain"),
(try_begin),
(lt, ":rain_amount", 75), #less than = no rain
(assign, ":rain_amount", 0),
(assign, ":rain_type", 0),
(try_end),
(set_rain, ":rain_type" , ":rain_amount"), #1=rain 2=snow
(assign,reg1,"$mpcoop_time_of_day"),
(assign,reg2,"$mpcoop_cloud"),
(assign,reg3,"$mpcoop_haze"),
(assign,reg4,"$mpcoop_rain"),
(display_message,"@DEBUG: time:{reg1} rain:{reg4} cloud:{reg2} haze:{reg3}"),
cmpxchg8b said:Changing weather/time never worked in-scene.
Depends, I would guess that some people only want their scenes to be used by a certain modification or server and therefor won't go along with it with just credits. Just message the creator of the scene and ask for permission.Swordyke said:What are the copyrights on maps made by the community?
I mean, is a simple credit enough to fulfill the copyright-requirements?