Scenes: Fog, Skyboxes and the such...

Users who are viewing this thread

Turanien

Despite being able to successfully play created maps on the Einherjar server, I cannot for the life of me force the weather, the skybox nor the sun to change. Any help appreciated?

Yoshiboy? The maps in your Hunt mod have varied weather scenes, perhaps you could suggest the answer?
 

Yoshiboy

Count
M&BWB
Hi, you can set the time of day by adding this to the mission template.

Code:
      (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_hunt_2"),
			(assign,"$g_time_of_day",1),
		(else_try),
			(eq,":current_scene","scn_multi_scene_hunt_5"),
			(assign,"$g_time_of_day",17),
		(else_try),	
			(eq,":current_scene","scn_multi_scene_6"),
			(assign,"$g_time_of_day",7),
		(else_try),	
			(eq,":current_scene","scn_multi_scene_hunt_8"),
			(assign,"$g_time_of_day",1),
		(else_try),
			(eq,":current_scene","scn_multi_scene_hunt_3"),
			(assign,"$g_time_of_day",0),
		(else_try),	
			(assign,"$g_time_of_day",15),
		(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.
		# - Yoshiboy
		
		]),

Note that you can also set fog at any time, but rain currently doesn't work.
 

Harmast

Master Knight
WF&S
Won't the rain work if you use set_global_cloud_amount (with or without set_global_haze_amount)? I'm pretty sure I saw this working when I experimented with it.
 

Kabs

Sergeant at Arms
Yoshiboy said:
Hi, you can set the time of day by adding this to the mission template.

Code:
      (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_hunt_2"),
			(assign,"$g_time_of_day",1),
		(else_try),
			(eq,":current_scene","scn_multi_scene_hunt_5"),
			(assign,"$g_time_of_day",17),
		(else_try),	
			(eq,":current_scene","scn_multi_scene_6"),
			(assign,"$g_time_of_day",7),
		(else_try),	
			(eq,":current_scene","scn_multi_scene_hunt_8"),
			(assign,"$g_time_of_day",1),
		(else_try),
			(eq,":current_scene","scn_multi_scene_hunt_3"),
			(assign,"$g_time_of_day",0),
		(else_try),	
			(assign,"$g_time_of_day",15),
		(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.
		# - Yoshiboy
		
		]),

Note that you can also set fog at any time, but rain currently doesn't work.

Hey Yoschiboy!, 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) for a test, 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 a single map (multi_scene_1) for a test first, but it should be useable to work on a server where clients can join and get the information from server/or via the newly created module files.

here a list of weather code templates that i have gathered:

(ti_before_mission_start, 0, 0, [],
[
      (store_current_scene,":scene"),
      (try_begin),
        (eq,":scene","scn_Raven_Hours_prussian_outskirts_by_kabs"),
        # assign specific scene weather here
      (else_try),
        (eq,":scene","scn_Raven_Hours_prussian_outskirts_by_kabs"),
        # assign specific scene weather here
      (else_try),
        # assign default scene weather here
      (end_try),
])

(ti_before_mission_start, 0, 0, [],
      [
        (scene_set_day_time, 15),
        ]),

(ti_before_mission_start, 0, 0, [],
[
      #(assign,reg1,"$g_daytime"),
      #(display_message,"@client time is: {reg1}"),
      #(scene_set_day_time, "$g_daytime"),
      # (set_rain)
      # set_global_cloud_amount
      # set_global_haze_amount
      (store_current_scene,":scene"),
      (try_begin),
        (eq,":scene","scn_multi_scene_1"),
        (assign,"$g_time_of_day",20),
            (set_fog_distance, 50, [0xFF736252]),
        # assign specific scene weather here
      (else_try),
        (eq,":scene","scn_multi_scene_1"),
        (assign,"$g_time_of_day",20),
            (set_fog_distance, 50, [0xFF736252]),
      (else_try),
        (assign,"$g_time_of_day",20),
            (set_fog_distance, 50, [0xFF736252]),
        # assign default scene weather here
      (end_try),
    # 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.
      # - Yoshiboy
])

To make some more rain in your scenes (more often), you can use the set_rain operation. The full "formula" for set_rain is (set_rain,<rain-type>,<strength>). The rain types are 1 as normal rain and 2 as snow, strength can be anywhere in the range of 0-100. So, if you'd want rain in your scene, you would use this script.
Code: [Auswählen]
(set_rain, 1, 75), #Rather rainy.

For snow, however, you could use the same thing, expect change the "rain type".
Code: [Auswählen]
(set_rain, 2, 75), #Rather snowy.

Now, if you want it to be more often, or common, then you'd simply have to make a mission templates trigger, where you'd run a check before the mission begins if you want the rain or not. One trigger would be something like this.
Code: [Auswählen]
rain = (
    ti_before_mission_start, 0, ti_once, [],
  [
      (store_random_in_range, ":rain_power", 0,100),
      (set_rain, 1, ":rain_power"),
  ])

We first make sure the trigger is run before the mission starts or actually loads in by using ti_before_mission_start on the check interval, and we also are sure that the trigger is run only once by ti_once. In the conditions block, we have nothing, however, this is not the case in the consuqences block. There, we store a random number from 0 to 100 and assign the rain to be rain type 1, that means it will not be snow, and put the rain's power as the random number to make sure you never get the same, dull rain.

Though, for the fog, the formula is (set_fog_distance, <distance_in_meters>, [fog_color]). The distance in meters is exactly what it says ... the distance in meters! What it means is that, when you set the distance_in_meters as 100, for example, then the rain will be pretty much un-noticeable because you have set the fog 100 meters away from you. The fog_color is the color of the fog in Hexadecimal code, e.g for white it should be something like "0x0FF000" or similar.

So, you could use the exactly same thing for fog.
Code: [Auswählen]
fog = (
    ti_before_mission_start, 0, ti_once, [],
  [
      (store_random_in_range, ":fog_distance", 25,100),
      (set_fog_distance, ":fog_distance", 0x0000FF),
  ])

Notice how we changed the random number from 0,100 to 25,100. That's because if the random number gets to be 0 or something like 5, you won't be able to see anything at all. Now, to include those basic scripts and get them work, you would simply add them to your wanted mission templates by simply typing them out there, such ast his 'fog,' and 'rain,'. Notice the comma.

and here a Weather admin pannel that i allready tested and it works fine:

***************************************
1.Intro
***************************************

It all starts at the "module_mission_templates.py". Here it is programmed what will be at start of multiplayer scenes.



Rule1:Ever make a clear line between the first and last # to the other scripts side!!!!!!
*****************************************************************************************



**************************************
2. The "module_scripts.py" (1)
**************************************

this essential Script to find in "module_scripts.py" short lines after script begin there should be the fatal code "(scene_set_day_time, 16)," who is making all the weather so boring same sunny. into this we now put the script order and add them varials.
In die "module_scripts.py":

####################################################################
    (scene_set_day_time, "$g_multiplayer_daytime"),
    (set_rain, "$g_multiplayer_niederschlag_art" , "$g_multiplayer_niederschlag_staerke"),########## downcoming: 1.Var=Art (1=Rain, 2=Snow) 2.Var= hardness (sightable 0-100)
    (set_global_haze_amount, "$g_multiplayer_nebel_staerke"), ############ fog (sightable 90 -100)
#    (set_fog_distance, "$g_multiplayer_nebel_entfernung", 0xbfbfbf), ############# not working got so let the # before it!
    (set_global_cloud_amount, "$g_multiplayer_wolken"), ############clouds (0-100)
    (set_postfx, "$g_multiplayer_postfx"), #########dont know about it very good
####################################################################


NOTE: ADD AS WRITTEN AS IT IS HERE ALL TIME !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




*********************************
3. Die "module_presentations.py"
**********************************

NOTE: ADD ALL WITHIN THE FIRST AND LAST #

BLOCK1

(val_sub, ":cur_y", ":cur_y_adder"),

      (create_text_overlay, reg0, "str_valid_vote_ratio", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),

      (create_number_box_overlay, "$g_presentation_obj_admin_panel_30", 50, 101),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_30", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_30", "$g_multiplayer_valid_vote_ratio"),

###########################################################################
###########################################################################
### Uhrzeit
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_daytime", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_99", 1, 24),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_99", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_99", "$g_multiplayer_daytime"),
### Niederschlag Staerke
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_niederschlag_staerke", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_98", 0, 251),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_98", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_98", "$g_multiplayer_niederschlag_staerke"),
### Niederschlag Art
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_niederschlag_art", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_97", 1, 3),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_97", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_97", "$g_multiplayer_niederschlag_art"),
### Nebel Staerke
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_nebel_staerke", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_96", 1, 101),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_96", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_96", "$g_multiplayer_nebel_staerke"),
### wolken
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_wolken", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_94", 0, 101),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_94", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_94", "$g_multiplayer_wolken"),
### postfx
      (val_sub, ":cur_y", ":cur_y_adder"),
      (create_text_overlay, reg0, "str_postfx", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),
      (create_number_box_overlay, "$g_presentation_obj_admin_panel_93", 0, 12),
      (position_set_x, pos1, 390),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, "$g_presentation_obj_admin_panel_93", pos1),
      (overlay_set_val, "$g_presentation_obj_admin_panel_93", "$g_multiplayer_postfx"),
###########################################################################
###########################################################################
      (val_sub, ":cur_y", ":cur_y_adder"),

      (create_text_overlay, reg0, "str_auto_team_balance_limit", 0),
      (position_set_x, pos1, 0),
      (position_set_y, pos1, ":cur_y"),
      (overlay_set_position, reg0, pos1),


BLOCK2


(else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_41"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_anti_cheat, ":value"),

###########################################################################
###########################################################################
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_99"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_daytime, ":value"),
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_98"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_niederschlag_staerke, ":value"),
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_97"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_niederschlag_art, ":value"),
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_96"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_nebel_staerke, ":value"),
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_94"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_wolken, ":value"),
      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_93"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_postfx, ":value"),

###########################################################################
###########################################################################

      (else_try),
        (eq, ":eek:bject", "$g_presentation_obj_admin_panel_42"),
        (multiplayer_send_int_to_server, multiplayer_event_admin_set_disallow_ranged_weapons, ":value"),
      (try_end),
      ]),






******************************
4. The "module_variables.py"
******************************

reserved_variables = [
    "g_multiplayer_daytime",
    "g_multiplayer_niederschlag_staerke",
    "g_multiplayer_niederschlag_art",
    "g_multiplayer_nebel_staerke",
    "g_multiplayer_nebel_entfernung",
    "g_multiplayer_wolken",
    "g_multiplayer_postfx",

    "g_presentation_obj_admin_panel_99",
    "g_presentation_obj_admin_panel_98",
    "g_presentation_obj_admin_panel_97",
    "g_presentation_obj_admin_panel_96",
    "g_presentation_obj_admin_panel_95",
    "g_presentation_obj_admin_panel_94",
    "g_presentation_obj_admin_panel_93",
]






***************************
5. The "header_common.py"
***************************
BLOCK1

NOTE: PUT THIS TO THE "END" OF "CLIENT" EVENTS!!!!!!!

#############################################################################################
multiplayer_event_admin_set_daytime                          = 201

multiplayer_event_admin_set_niederschlag_staerke              = 202
multiplayer_event_admin_set_niederschlag_art                  = 203

multiplayer_event_admin_set_nebel_staerke                    = 204
multiplayer_event_admin_set_nebel_entfernung                  = 205

multiplayer_event_admin_set_wolken                  = 206

multiplayer_event_admin_set_postfx                  = 207

#############################################################################################


BLOCK2

NOTE: ON "END" OF THE "SERVER" EVENTS PUT THIS !!!!!!!!!!!!


#########################################################################################################
multiplayer_event_daytime_at_player                          = 301

multiplayer_event_niederschlag_staerke_at_player              = 302
multiplayer_event_niederschlag_art_at_player                  = 303

multiplayer_event_nebel_staerke_at_player                    = 304
multiplayer_event_nebel_entfernung_at_player                  = 305

multiplayer_event_wolken_at_player                            = 306

multiplayer_event_postfx_at_player                            = 307
#########################################################################################################







*********************************
6. The "module_scripts.py" (2)
*********************************
BLOCK1

NOTE: A COMMENCE SEARCH FOR


        ###############
        #CLIENT EVENTS#
        ###############


AND PUT THE FOLLOWING TEXT ABOVE IT !!!!!!!!!!!!

#################################################################################################
# SERVER WETTER EVENTS
#################################################################################################
### Uhrzeit   
  (eq,":event_type", multiplayer_event_admin_set_daytime),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", 0, 25),  #condition checks are done
          (assign, "$g_multiplayer_daytime", ":value"),
        (try_end),
      (else_try),
### Niederschlag
  (eq,":event_type", multiplayer_event_admin_set_niederschlag_staerke),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", -1, 250),  #condition checks are done
          (assign, "$g_multiplayer_niederschlag_staerke", ":value"),
        (try_end),
      (else_try),

  (eq,":event_type", multiplayer_event_admin_set_niederschlag_art),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", 0, 3),  #condition checks are done
          (assign, "$g_multiplayer_niederschlag_art", ":value"),
        (try_end),
      (else_try),
### Nebel
  (eq,":event_type", multiplayer_event_admin_set_nebel_staerke),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", -1, 100),  #condition checks are done
          (assign, "$g_multiplayer_nebel_staerke", ":value"),
        (try_end),

      (else_try),
  (eq,":event_type", multiplayer_event_admin_set_nebel_entfernung),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", -1, 100),  #condition checks are done
          (assign, "$g_multiplayer_nebel_entfernung", ":value"),
        (try_end),
      (else_try),
### wolken 

  (eq,":event_type", multiplayer_event_admin_set_wolken),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", -1, 101),  #condition checks are done
          (assign, "$g_multiplayer_wolken", ":value"),
        (try_end),
      (else_try),
### postfx
  (eq,":event_type", multiplayer_event_admin_set_postfx),
  (store_script_param, ":value", 3),
        (try_begin),
          (player_is_admin, ":player_no"),#validity check
          (is_between, ":value", 0, 12),  #condition checks are done
          (assign, "$g_multiplayer_postfx", ":value"),
        (try_end),
      (else_try),
#################################################################################################
# ENDE SERVER WETTER EVENTS
#################################################################################################




BLOCK2


NOTE: AND THIS AT END OF "module_scripts.py" TEXT !!!!!!!!!!!!!


#################################################################################################
# WETTER CLIENT EVENTS
#################################################################################################

### Uhrzeit     
  (else_try),
          (eq, ":event_type", multiplayer_event_daytime_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_daytime", ":value"),
### Niederschlag
  (else_try),
          (eq, ":event_type", multiplayer_event_niederschlag_staerke_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_niederschlag_staerke", ":value"),
  (else_try),
          (eq, ":event_type", multiplayer_event_niederschlag_art_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_niederschlag_art", ":value"),
### Nebel
  (else_try),
          (eq, ":event_type", multiplayer_event_nebel_staerke_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_nebel_staerke", ":value"),
  (else_try),
          (eq, ":event_type", multiplayer_event_nebel_entfernung_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_nebel_entfernung", ":value"),
### wolken
  (else_try),
          (eq, ":event_type", multiplayer_event_wolken_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_wolken", ":value"),
### postfx
  (else_try),
          (eq, ":event_type", multiplayer_event_postfx_at_player),
          (store_script_param, ":value", 3),
          (assign, "$g_multiplayer_postfx", ":value"),
       
#####################################################
# ENDE WETTER CLIENT EVENTS
#####################################################



Rule2: LOOK THAT THERE IS EVER A "(else_try)," between every event !!!!!!!!!!!!!!!!
***************************************************************************************




*****************************
7. The "module_strings.py"
*****************************

NOTE: ADD THIS TO END OF THE CODE!!!!!!!

#####################################################
  ("daytime", "Uhrzeit"),
  ("niederschlag_staerke", "Niederschlagstaerke (%)"),
  ("niederschlag_art", "Art: 1=Regen 2=Schnee"),
  ("nebel_staerke", "Nebelstaerke (%)"),
  ("nebel_entfernung", "Nebelentfernung"),
  ("Wolken", "Wolken (%)"),
  ("postfx", "postfx"),
#####################################################


So that should do it!

Now batch the module files and look admin server panel.

ALSO NOTE:

ALL USERS NEED THE NEW BATCHED MOD FILES BECAUSE SOME OF
THE WEATHER EFFECTS CANT BE LOADED BEFORE, MAYBE THIS WILL
NEED A RESTART OF SERVER AFTER SETTING AND LOADING FROM USERS!!!!!!

thanks in advance

kabs
 

Kabs

Sergeant at Arms
Ok Gyus, i solved the problem where to add the specific line!

go in your module_mission_templates.py (youll need the module system official download 1.132v and phyton installed to look on the module system files*think all should that know..*).

there you have to add the code of yoschi or any other of these "ti_before_mission_start" for each multiplayer game mode (each have a code string on its own).

so.. in templates.py a commence search for:

multiplayer_server_before_mission_start_common

now over your marked text, you will see the firsts multiplayer gamemode name.

and at the end of its string here:

(call_script, "script_multiplayer_init_mission_variables"),
        (call_script, "script_multiplayer_remove_destroy_mod_targets"),
        (call_script, "script_multiplayer_remove_headquarters_flags"),
        ]),

you will have to add the code like my here and let a free line between end of the upper code string and the lower one:

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

thats was it for the first game mode and only as you see in my code for 1 map "multi_scene_1" (thats ruins for native module)

to add more maps or other codes, just study the codes of my last post.

then you will have to add the code for all gamemodes you want to have them so again in templates.py a commence search for:

multiplayer_server_before_mission_start_common

and you will see over the marked text the new/other gamemode.

add the code at the right place again and then finished the second gamemode.

then again for the rest of gamemodes you wish to have your map with the new weather and its finished.

but Attention !

# 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.

as Yoschi told us. Have fun with mapping in other style multi scenes/maps !

Kabs
 

Flanged

Sergeant Knight
Kabs, or Yoshi, do you know if it's possible to use this method in Quick Battle scenes for 1.011? 

I added this to header_operations, since it did not exist already in 1.011:

scene_set_day_time      = 1266 # (scene_set_day_time, <value>), #value in hours (0-23), must be called within ti_before_mission_start triggers

It's added at the same place it would be in the Warband module system. 

Then I added Yoshi's script to my Quick Battle mission templates, changing the scene names of course to the ones I want to use.  It compiles with no errors, but makes no difference in the scenes themselves.

Is there another method to set the time of day in the older version of the module system, or is it simply impossible?

Thanks for any help you can give.
 

Sinisterius

Most likely impossible to use that command, because it doesn't exist in the actual code.

I use fog to simulate a day/night cycle in my RomePW mod.
 

Kabs

Sergeant at Arms
Flanged said:
Kabs, or Yoshi, do you know if it's possible to use this method in Quick Battle scenes for 1.011? 

I added this to header_operations, since it did not exist already in 1.011:

scene_set_day_time      = 1266 # (scene_set_day_time, <value>), #value in hours (0-23), must be called within ti_before_mission_start triggers

It's added at the same place it would be in the Warband module system. 

Then I added Yoshi's script to my Quick Battle mission templates, changing the scene names of course to the ones I want to use.  It compiles with no errors, but makes no difference in the scenes themselves.

Is there another method to set the time of day in the older version of the module system, or is it simply impossible?

Thanks for any help you can give.

why do u use an older ?????
 

Flanged

Sergeant Knight
Sinisterius said:
Most likely impossible to use that command, because it doesn't exist in the actual code.

I use fog to simulate a day/night cycle in my RomePW mod.

Thanks for the tip Sinisterius, I'll give that a try, although I was hoping to have the "street lights" showing at night to give some scenes a bit of extra atmosphere.  I guess using fog, the light_night scene prop won't activate it's light.  It's a shame it's not possible.

Kabs said:
why do u use an older ?????

The whole mod is already built in 1.011, and I'm only making a Quick Battle mini-mod for it - it would take too long to port it all over to Warband.

I'll probably move on to Warband once this mod's finished - though I hate some of the fighting animations in it.
 

Sinisterius

Flanged said:
Thanks for the tip Sinisterius, I'll give that a try, although I was hoping to have the "street lights" showing at night to give some scenes a bit of extra atmosphere.  I guess using fog, the light_night scene prop won't activate it's light.  It's a shame it's not possible.
Actually, I'm pretty sure that the light_night scene prop will activate it's light anyway. All you need to do is call the set_fog_distance, distance, color command. For the distance I suggest 50-75 and for the color use 0x333333.
 

Flanged

Sergeant Knight
Excellent, it works perfectly, apart from the sun which I already know a way to get rid of.  Thanks again.
 
Top Bottom