Weather Native - Fog / rain..

正在查看此主题的用户

Alphα

Section Moderator
Hello there,

Is there a simple way to add weather to a scene? I saw this possibility through a props on NoGK mod and others.
Thanks,

Alpha,
 
Ikaguia 说:
you'd need to change the module itself for you and for everyone else who uses it.
something like this:
插入代码块:
	#script_multiplayer_event_mission_end
	("multiplayer_event_mission_end",[
		##WEATHER CHANGES
		(try_begin),
			(multiplayer_is_server),
			(eq, ":scn", "scn_enterprise_dyeworks"),
			(assign, "$g_rain_type", 2),#Clear, Rain, Snow
			(store_random_in_range, "$g_rain_amount", 0, 100),
			(store_random_in_range, "$g_round_day_time", 0, 24),
			(store_random_in_range, "$g_fog_distance", 10, 10000),#higher distance means less fog
			(val_min, "$g_fog_distance", 999),
			(get_max_players, ":num_players"),
			(try_for_range, ":player", 1, ":num_players"),
				(player_is_active, ":player"),
				(multiplayer_send_3_int_to_player, ":player", multiplayer_event_weather, var_day_time,		"$g_round_day_time"),
				(multiplayer_send_3_int_to_player, ":player", multiplayer_event_weather, var_rain_type,		"$g_rain_type"),
				(multiplayer_send_3_int_to_player, ":player", multiplayer_event_weather, var_rain_amount,	"$g_rain_amount"),
				(multiplayer_send_3_int_to_player, ":player", multiplayer_event_weather, var_fog_dist,		"$g_fog_distance"),
			(try_end),
		(try_end),
		##WEATHER CHANGES
		]),
	#script_multiplayer_server_before_mission_start_common
	("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),
		##WEATHER CHANGES
		(set_rain, "$g_rain_type", "$g_rain_amount"),
		(scene_set_day_time, "$g_round_day_time"),
		(set_fog_distance, "$g_fog_distance"),#fog colour?
		(try_begin),
			(multiplayer_is_server),
			(try_begin),
				(eq,"$g_rain_type",0),
				(str_store_string,s1,"@Clear"),
			(else_try),
				(eq,"$g_rain_type",1),
				(str_store_string,s1,"@Rainy"),
			(else_try),
				(str_store_string,s1,"@Snowy"),
			(try_end),
			(assign,reg1,"$g_rain_amount"),
			(str_store_string, s1, "@Weather set to {s1} with {reg1} strenght"),
			(assign,reg1,"$g_round_day_time"),
			(str_store_string, s2, "@Day time set to {reg1}"),
			(assign,reg1,"$g_fog_distance"),
			(str_store_string, s3, "@Fog distance set to {reg1}"),
			(server_add_message_to_log, s1),
			(server_add_message_to_log, s2),
			(server_add_message_to_log, s3),
		(try_end),
		##WEATHER CHANGES
		(assign, "$g_multiplayer_mission_end_screen", 0),
		(get_max_players, ":num_players"),
		(try_for_range, ":player_no", 0, ":num_players"),
			(player_is_active, ":player_no"),
			(call_script, "script_multiplayer_init_player_slots", ":player_no"),
			(assign, ":initial_gold", multi_initial_gold_value),
			(val_mul, ":initial_gold", "$g_multiplayer_initial_gold_multiplier"),
			(val_div, ":initial_gold", 100),
			(player_set_gold, ":player_no", ":initial_gold"),
			(player_set_slot, ":player_no", slot_player_first_spawn, 1), #not required in siege, bt, fd
		(try_end),
		]),

third thing you should know, is that any player that join the server, will either have to rejoin it to have any of those changes apply, or wait till the next map starts

in your case, you'd need to check for the scene props themselves and not the scenes but other than that its all the same
 
Thanks. btw is that just working with one map?
插入代码块:
(eq, ":scn", "scn_enterprise_dyeworks"),

Could we create new props to set the time, weather and fog by values? I mean var1 var2.

Some help appreciated  :dead:
 
since you want to use scene_props to set those values, you'd need to instead of using that first script to assign the values to the global variables, make a loop trought all the scene props of the type you'll use and check their values, all that in the 2nd script
 
后退
顶部 底部