OSP Code MP Arch3r OS: Random weather for multiplayer gamemodes (fixed)

Users who are viewing this thread

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?
 
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?
Indeed.

Cavalier Francesco said:
Arch3r without any insult but You should upload it in a Rar file if you want..
Nay :O
 
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 :smile:
 
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 :smile:

**************************
i would really like to know, how to give the data to clients without them to must rejoin server/restart game to let them see the newly added weather Chadz !
**************************

but man the thing for me is, that i wanted to make this for multi_scene_1 (that should be Ruins?, but i tested and changed them all), and there seems nothing to happen for me. I added this code to module_mission_templates.py in 3 positions (before the first code, as last code and between some lines of game_modus_battle:

(ti_before_mission_start, 5, 0, [],
      [
      #(assign,reg1,"$g_daytime"),
      #(display_message,"@client time is: {reg1}"),
      #(scene_set_day_time, "$g_daytime"),

(store_current_scene,":current_scene"),
      (try_begin),
        (eq,":current_scene","scn_multi_scene_1"),
        (assign,"$g_time_of_day",1),
(else_try),
        (assign,"$g_time_of_day",20),
(end_try),

      (scene_set_day_time,"$g_time_of_day"),   
   
      # Setting the time server side then sending it to the clients is currently impossible.
      # This is due to the fact that the client must request data from the server "before_before_mission_start" as it were. Which it cannot recieve in time.
      # There is no trigger flag "before_before_mission_start" and there is no way to send this data before the mission template is loaded due to the server list and such being hardcoded.
      # by Yoshiboy
      ]),

i want to make the weather fixed for any map i want in mm mod module.

also i dont know where are all the lines for triggering all the gamemodes and to put this code are...

thanks in advance

kabs
 
Hello i probleme I have all make decently but I always have errors

module_mission

Code:
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)]),....


module script

Code:
  # 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",
   [....

header common


Code:
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
...

Help me pleaseee
 
:grin: 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  :grin:
 
Arch3r said:
Oh alright, thanks for this...that automatically randomizes it?
:neutral: Ahhh not sure  if its enough to comment as  i had your script already in!  lol
I can only asure that these lines actively overwrite every try to get weather random.

Didnt get the rain/ snow system working so far....
 
Meneldur said:
:grin: 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  :roll:
 
Meneldur said:
:grin: 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  :grin:
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!
 
Back
Top Bottom