Indeed.FreefallGeek said:And to verify, this only works if the client is running the modified module as well, correct? Meaning it's impossible to have someone connect with a Native module and see the weather effects?
Nay :OCavalier Francesco said:Arch3r without any insult but You should upload it in a Rar file if you want..
chadz said:just wanted to bump this - with the newest function send_message_to_url and receive_url_reply it's possible to query an http url with the weather data at "script_game_quick_start" (gets loaded when you click on the "multiplayer" button in the main menu).
with the reply you can fill the variables for time, rain and fog. So the client has the correct weather data when he joins a server (although all servers would have to have the same weather at the same time) After the first map I'm using a similar script like archer, sending the new fog/rain/time variables to the client.
Used this in cRPG, and it allows for real day/life cycles every time the map changes - it's really nice to see you can play long enough until you see the sun rise
common_siege_assign_men_to_belfry = (
0, 0, ti_once,
[
(call_script, "script_cf_siege_assign_men_to_belfry"),
], [])
##Arch3r OS commons
#Day time
common_random_multiplayer_weather = (
ti_before_mission_start, 0, 0,
[ ], [
(scene_set_day_time, "$day_time"), #time, random between 4 - 22
])
##Arch3r OS serverside above
#Day time
common_random_multiplayer_weather_server = (
ti_on_multiplayer_mission_end, 0, 0,
[ ], [
(try_begin),
(multiplayer_is_server),
## (store_current_scene,":cur_scene"), #Later, when set_rain works check for snow scenes
(store_random_in_range, "$rain_strength", 50,150),
(store_random_in_range, "$fog_dist", 40,250),
(store_random_in_range, "$day_time", 4,22),
(multiplayer_get_my_player, ":my_player_no"),
(get_max_players, ":num_players"),
(try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
(player_is_active, ":player_no"),
(neq, ":player_no", ":my_player_no"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_return_day_time, "$day_time"),
(multiplayer_send_int_to_player, ":player_no", multiplayer_event_return_weather, "$rain_strength", "$fog_dist"),
(try_end),
(try_end),
])
##Arch3r OS serverside above
##Arch3r OS clientside under
common_random_multiplayer_weather_client = (
ti_after_mission_start, 0, 0,
[ ], [
##Arch3r OS disabled, set_rain is broken
## (try_begin),
## (lt, "$rain_strength", 100),
### (set_rain,":rain_type",multiplayer_event_return_weather), #1=rain 2=snow (depends on scene), strength between 10-100
## (set_rain, 1 ,"$rain_strength"), #1=rain 2=snow (depends on scene), strength between 10-100
## (else_try),
## (set_rain,0,0), #1=rain 2=snow (depends on scene), strength between 10-100
## (try_end),
(try_begin),
(lt, "$fog_dist", 110),
(set_fog_distance, "$fog_dist", 0xbfbfbf), #fog distance between 20-250, color is grey
(else_try),
(set_fog_distance, 1000000000, 0xbfbfbf), #fog distance between 20-250, color is grey
(try_end),
])
##Arch3r OS
common_random_multiplayer_weather,
common_random_multiplayer_weather_client,
multiplayer_event_return_max_num_bots = 106
tournament_triggers = [
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest"),
(assign, "$g_arena_training_num_agents_spawned", 0)]),....
# script_cf_multiplayer_evaluate_poll
(else_try),
(eq, ":event_type", multiplayer_event_return_weather),
(store_script_param, ":value", 3),
(store_script_param, ":value2", 4),
(assign, "$rain_strength", ":value"),
(assign, "$fog_dist", ":value2"),
(else_try),
(eq, ":event_type", multiplayer_event_return_day_time),
(store_script_param, ":value", 3),
(assign, "$day_time", ":value"),
# Input: none
# Output: none (can fail)
("cf_multiplayer_evaluate_poll",
[....
multiplayer_event_show_duel_request = 108
multiplayer_event_start_duel = 109
multiplayer_event_cancel_duel = 110
multiplayer_event_show_server_message = 111
multiplayer_event_return_disallow_ranged_weapons = 112
multiplayer_event_return_weather = 113
multiplayer_event_return_day_time = 114
multiplayer_event_return_fog = 115
...
("multiplayer_server_before_mission_start_common",
[
(try_begin),
(scene_allows_mounted_units),
(assign, "$g_horses_are_avaliable", 1),
(else_try),
(assign, "$g_horses_are_avaliable", 0),
(try_end),
(scene_set_day_time, 15), this forces 15 pm
(assign, "$g_multiplayer_mission_end_screen", 0),
("multiplayer_server_before_mission_start_common",
[
(try_begin),
(scene_allows_mounted_units),
(assign, "$g_horses_are_avaliable", 1),
(else_try),
(assign, "$g_horses_are_avaliable", 0),
(try_end),
# (scene_set_day_time, 15),
(assign, "$g_multiplayer_mission_end_screen", 0),
Ahhh not sure if its enough to comment as i had your script already in! lolArch3r said:Oh alright, thanks for this...that automatically randomizes it?
Meneldur said:There is default ti_on_mission_start who controls daytime and take these great script out of effect!
Its module_scripts. Search for script_multiplayer_server_before_mission_start_common
Code:("multiplayer_server_before_mission_start_common", [ (try_begin), (scene_allows_mounted_units), (assign, "$g_horses_are_avaliable", 1), (else_try), (assign, "$g_horses_are_avaliable", 0), (try_end), (scene_set_day_time, 15), this forces 15 pm (assign, "$g_multiplayer_mission_end_screen", 0),
comment the defined day-time:
("multiplayer_server_before_mission_start_common",
[
(try_begin),
(scene_allows_mounted_units),
(assign, "$g_horses_are_avaliable", 1),
(else_try),
(assign, "$g_horses_are_avaliable", 0),
(try_end),
# (scene_set_day_time, 15),
(assign, "$g_multiplayer_mission_end_screen", 0),
Hello,
there will be a way to put a variable range?
because I changed the number 15 with 0.4 and get that night, but
the idea is to have a number between 0 and 20, for example:
(scene_set_day_time, 0-20)?
bye
Okay so how would i get the fog, and rain. Because i commented it but all it is doing is making it so its dawn!Meneldur said:There is default ti_on_mission_start who controls daytime and take these great script out of effect!
Its module_scripts. Search for script_multiplayer_server_before_mission_start_common
Code:("multiplayer_server_before_mission_start_common", [ (try_begin), (scene_allows_mounted_units), (assign, "$g_horses_are_avaliable", 1), (else_try), (assign, "$g_horses_are_avaliable", 0), (try_end), (scene_set_day_time, 15), this forces 15 pm (assign, "$g_multiplayer_mission_end_screen", 0),
comment the defined day-time:
("multiplayer_server_before_mission_start_common",
[
(try_begin),
(scene_allows_mounted_units),
(assign, "$g_horses_are_avaliable", 1),
(else_try),
(assign, "$g_horses_are_avaliable", 0),
(try_end),
# (scene_set_day_time, 15),
(assign, "$g_multiplayer_mission_end_screen", 0),
Now it all works