-
Content Count
734 -
Joined
-
Last visited
-
Medals
Everything posted by meatball
-
Created a new thread to pull together a few discussions about creating weather in Arma 3 and move it over to the proper forum.
-
Created a new thread to pull together a few discussions about creating weather in Arma 3.
-
Man, is it me, or is it way more difficult than it should be to keep the weather and time synch'd up between a server and clients (original join and JIP's)? If 3 hours have passed in mission, it should synch that up with clients joining later, and if it's raining on the server, it should be raining on all the clients. I see posts about this going back over 10 years and it's still seems difficult to do. Am I missing something somewhere?
-
Quick comment/suggestion to folks using the revive script. One of the things I've found that works out great is that you can easily add Mission parameters that players can choose to change settings with Revive (and other scripts as well). To do that you just need to add some code to description.ext and then make some tweaks to the script you want it to change. So for example, I want the players to be able to turn on/off the Advanced wounding system if they want, and also set the maximum number of 'lives' they get. So I did the following: In your description.ext file set up a Class section for Parameters (Params). // Set Changeable Parameters in the Mission Start Up class Params { // paramArray[0] class advancedWounding { title = "Use Advanced Wounding System?"; values[] = {0,1}; texts[] = {"No","Yes"}; default = 0; }; // paramsArray[1] class maxRespawns { title = "Number of Times a Player may Respawn (Counts both revives and manual revives)"; values[] = {1,3,5,10,20,999}; texts[] = {"1","3","5","10","20","Unlimited"}; default = 20; }; }; Then in your =BTC=_revive_init.sqf you can pull those values and plug them into the init. So for mine I have the following at the top of my file: // Options from description.ext advWound = (paramsArray select 0); // Select Parameter for Advanced Wounding System. maxRespawns = (paramsArray select 1); // Select Parameter for Number of Respawns Then you can just reference those variables in the init file, so I have the following two tweaked: BTC_r_new_system = advWound; //WIP - set 1 to activate it ... BTC_lifes = maxRespawns; // Set a max number of revives if previous set to limited number of lives. (Counts both times you get revived and times respawned. I use Parameters all over the place to let players choose all sorts of variables like Time of Day, Weather, Revive settings and even the amount/skill of AI in mission and it really let's them tailor to their playstyle.
-
ArmA3 Classnames - no discussions
meatball replied to memphisbelle's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I just spent some time manually going through the editor and copying/pasting all the class names for units into a text file with the new version for my use and thought I'd share. I did not include Civilian units, nor any of the static defenses, but think I have everything else. Since I did manually cut/paste, there very well could be some missing or screwed up class names in the list. If you notice anything, let me know. :) Note: Does not include Static Classes nor any Civilian or Ambient Life Units ------------- BluFor - NATO Men: B_Soldier_A_F, B_soldier_AR_F, B_medic_F, B_crew_F, B_engineer_F, B_soldier_exp_F, B_Soldier_GL_F, B_helicrew_F, B_Helipilot_F, B_soldier_M_F, B_soldier_AA_F, B_soldier_AT_F, B_officer_F, B_soldier_PG_F, B_Pilot_F, B_soldier_repair_F, B_Soldier_F, B_soldier_LAT_F, B_Soldier_lite_F, B_Soldier_SL_F, B_Soldier_TL_F, B_soldier_UAV_F Men (Diver): B_diver_F, B_diver_exp_F, B_diver_TL_F Men (Recon): B_recon_exp_F, B_recon_JTAC_F, B_recon_M_F, B_recon_medic_F, B_recon_F, B_recon_LAT_F, B_recon_TL_F Men (Sniper): B_sniper_F, B_spotter_F Men (Story): B_Competitor_F, B_Story_Colonel_F, B_Story_Tank_Commander_F, B_Story_Protagonist_F, B_Story_Pilot_F, B_Story_SF_Captain_F, B_Story_Engineer_F, B_RangeMaster_F Men (Support): B_Soldier_AAR_F, B_support_AMG_F, B_support_AMort_F, B_Soldier_AAA_F, B_Soldier_AAT_F, B_support_GMG_F, B_support_MG_F, B_support_Mort_F Air: B_Heli_Light_01_armed_F, B_Heli_Attack_01_F, B_Heli_Light_01_F, B_Heli_Transport_01_F, B_Heli_Transport_01_camo_F Armored: B_APC_Wheeled_01_cannon_F, B_APC_Tracked_01_AA_F, B_APC_Tracked_01_rcws_F, B_MBT_01_cannon_F, B_MBT_01_arty_F, B_MBT_01_mlrs_F Autonomous: B_UAV_01_F, B_UAV_02_F, B_UAV_02_CAS_F, B_UGV_01_F, B_UGV_01_rcws_F Cars: B_Truck_01_mover_F, B_Truck_01_box_F, B_Truck_01_transport_F, B_Truck_01_covered_F, B_MRAP_01_F, B_MRAP_01_gmg_F, B_MRAP_01_hmg_F, B_Quadbike_01_F Ships: B_Boat_Transport_01_F, B_Lifeboat, B_Boat_Armed_01_minigun_F Submarine: B_SDV_01_F Supports: B_APC_Tracked_01_CRV_F, B_Truck_01_ammo_F, B_Truck_01_fuel_F, B_Truck_01_medical_F, B_Truck_01_Repair_F ------------ BluFor - FIA Men: B_G_Soldier_A_F, B_G_Soldier_AR_F, B_G_medic_F, B_G_engineer_F, B_G_Soldier_exp_F, B_G_Soldier_GL_F, B_G_Soldier_M_F, B_G_officer_F, B_G_Soldier_F, B_G_Soldier_LAT_F, B_G_Soldier_lite_F, B_G_Soldier_SL_F, B_G_Soldier_TL_F Men (Story): I_G_Story_Protagonist_F Cars: B_G_Offroad_01_F, B_G_Offroad_01_armed_F, B_G_Quadbike_01_F, B_G_Van_01_transport_F Ships: B_G_Boat_Transport_01_F Supports: B_G_Van_01_fuel_F ------------ Opfor - CSAT Men: O_Soldier_A_F, O_Soldier_AR_F, O_medic_F, O_crew_F, O_engineer_F, O_soldier_exp_F, O_Soldier_GL_F, O_helicrew_F, O_helipilot_F, O_soldier_M_F, O_Soldier_AA_F, O_Soldier_AT_F, O_officer_F, O_soldier_PG_F, O_Pilot_F, O_soldier_repair_F, O_Soldier_F, O_Soldier_LAT_F, O_Soldier_lite_F, O_Soldier_SL_F, O_Soldier_TL_F, O_soldier_UAV_F Men (Diver): O_diver_F, O_diver_exp_F, O_diver_TL_F Men (Recon): O_recon_exp_F, O_recon_JTAC_F, O_recon_M_F, O_recon_medic_F, O_recon_F, O_recon_LAT_F, O_recon_TL_F Men (Sniper): O_sniper_F, O_spotter_F Men (Story): O_Story_CEO_F, O_Story_Colonel_F Men (Support): O_Soldier_AAR_F, O_support_AMG_F, O_support_AMort_F, O_Soldier_AAA_F, O_Soldier_AAT_F, O_support_GMG_F, O_support_MG_F, O_support_Mort_F Men (Urban): O_soldierU_A_F, O_soldierU_AAR_F, O_soldierU_AAA_F, O_soldierU_AAT_F, O_soldierU_AR_F, O_soldierU_medic_F, O_engineer_U_F, O_soldierU_exp_F, O_SoldierU_GL_F, O_soldierU_M_F, O_soldierU_AA_F, O_soldierU_AT_F, O_soldierU_repair_F, O_soldierU_F, O_soldierU_LAT_F, O_SoldierU_SL_F, O_soldierU_TL_F Air: O_Heli_Attack_02_F, O_Heli_Attack_02_black_F, O_Heli_Light_02_F, O_Heli_Light_02_unarmed_F Armored: O_MBT_02_arty_F, O_APC_Tracked_02_cannon_F, O_APC_Wheeled_02_rcws_F, O_MBT_02_cannon_F, O_APC_Tracked_02_AA_F Autonomous: O_UAV_02_F, O_UAV_02_CAS_F, O_UAV_01_F, O_UGV_01_F, O_UGV_01_rcws_F Cars: O_MRAP_02_F, O_MRAP_02_gmg_F, O_MRAP_02_hmg_F, O_Quadbike_01_F, O_Truck_02_transport_F, O_Truck_02_covered_F Supports: O_Truck_02_Ammo_F, O_Truck_02_fuel_F, O_Truck_02_medical_F, O_Truck_02_box_F ----------------- Independant - AAF Men: I_Soldier_A_F, I_Soldier_AR_F, I_medic_F, I_crew_F, I_engineer_F, I_Soldier_exp_F, I_Soldier_GL_F, I_helicrew_F, I_helipilot_F, I_Soldier_M_F, I_Soldier_AA_F, I_Soldier_AT_F, I_officer_F, I_pilot_F, I_Soldier_repair_F, I_soldier_F, I_Soldier_LAT_F, I_Soldier_lite_F, I_Soldier_SL_F, I_Soldier_TL_F, I_soldier_UAV_F Men (Diver): I_diver_F, I_diver_exp_F, I_diver_TL_F Men (Sniper): I_sniper_F, I_spotter_F Men (Story): I_Story_Colonel_F Men (Support): I_Soldier_AAR_F, I_support_AMG_F, I_support_AMort_F, I_Soldier_AAA_F, I_Soldier_AAT_F, I_support_GMG_F, I_support_MG_F, I_support_Mort_F Air: I_Plane_Fighter_03_AA_F, I_Plane_Fighter_03_CAS_F, I_Heli_Transport_02_F Armored: I_APC_Wheeled_03_cannon_F Autonomous: I_UAV_01_F, I_UAV_02_F, I_UAV_02_CAS_F, I_UGV_01_F, I_UGV_01_rcws_F Cars: I_Quadbike_01_F, I_MRAP_03_F, I_MRAP_03_gmg_F, I_MRAP_03_hmg_F, I_Truck_02_transport_F, I_Truck_02_covered_F Ships: I_Boat_Transport_01_F, I_Boat_Armed_01_minigun_F Submarines: I_SDV_01_F Supports: I_Truck_02_ammo_F, I_Truck_02_fuel_F, I_Truck_02_medical_F, I_Truck_02_box_F -
By the way, I had added in my own comments to help me remember what everything does in the revive init, you're free to use/ignore :) /* Created by =BTC= Giallustio version 0.93 Official release Visit us at: http://www.blacktemplars.altervista.org/ 06/03/2012 */ ////////////////// EDITABLE \\\\\\\\\\\\\\\\\\\\\\\\\\ BTC_r_new_system = 0; //WIP - set 1 to activate it BTC_r_wait_for_revive = 1;//If BTC_r_new_system set to 1 you can choose if you want or not a revive time available after death (Similar to wounding system in ACE) BTC_r_action = 0;//[NOT IMPLEMENTED] - 0 if you don't want the healing animation (ACE style), 1 if you want the animations (You can't stop the animation) BTC_r_med_fa = 1;//0 for only first aid kit, 1 if you don't have a medikit you need a first aid kit, 2 only medikit BTC_r_cpr_time = 60; BTC_r_trans_ratio = 100; BTC_revive_time_min = 5; // How long, in seconds, until an unconscious player will be able to be revived. BTC_revive_time_max = 600; // How long, in seconds, that a player will stay unconscious, awaiting revival. BTC_who_can_revive = ["Man"]; // All players "Man" can revive. BTC_loop_check = 0; BTC_disable_respawn = 1; // 0 = Self Respawn enabled, 1 = Self Respawn disabled. BTC_respawn_gear = 1; // 0 = Respawn player with default gear when respawned. 1 = Respawn player with new/picked up gear when respawned. BTC_active_lifes = 1; // Limit the number of lives (respawns & revives) a player can have? (0 = No, 1 = Yes) BTC_lifes = 10; // Set a max number of revives if previous set to limited number of lives. (Counts both times you get revived and times respawned. BTC_spectating = 0;//Allows players to spectate action while unconcious. 0 = disable; 1 = can spectate units group; 2 = can spectate side units; 3 = can spectate all units BTC_spectating_view = [0,0];//To force a view set the first number of the array to 1. The second one is the view mode: 0 = first person; 1 = behind the back; 2 = High; 3 = free BTC_s_mode_view = ["First person","Behind the back","High","Free"]; BTC_black_screen = 1;//Black screen + button while unconscious or action wheel and clear view BTC_action_respawn = 1;//if black screen is set to 0 you can choose if you want to use the action wheel or the button. Keep in mind that if you don't use the button, the injured player can use all the action, frag too.... BTC_camera_unc = 1; BTC_camera_unc_type = ["Behind the back","High","Free"]; BTC_respawn_time = 0; BTC_active_mobile = 1;//Active mobile respawn (You have to put in map the vehicle and give it a name. Then you have to add one object per side to move to the mobile (BTC_base_flag_west,BTC_base_flag_east) - (1 = yes, 0 = no)) BTC_mobile_respawn = 1;//Active the mobile respawn fnc (1 = yes, 0 = no) BTC_mobile_respawn_time = 30;//Secs delay for mobile vehicle to respawn BTC_need_first_aid = 1;//You need a first aid kit to revive (1 = yes, 0 = no) BTC_pvp = 0; // Allow revive option for the enemy, 0 = Disable, 1 = Enable) BTC_injured_marker = 1; BTC_3d_can_see = ["Man"]; BTC_3d_distance = 30; BTC_3d_icon_size = 0.5; BTC_3d_icon_color = [1,0,0,1]; BTC_dlg_on_respawn = 1; //1 = Mobile only - 2 Leader group and mobile - 3 = Units group and mobile - 4 = All side units and mobile BTC_objects_actions_west = [bTC_base_flag_west]; // Editable - Objects/Locations available for West side respawn BTC_objects_actions_east = [bTC_base_flag_east]; // Editable - Objects/Locations available for East side respawn BTC_objects_actions_guer = []; // Editable - Objects/Locations available for independant side respawn BTC_objects_actions_civ = []; // Editable - Objects/Locations available for civilian side respawn if (isServer) then { BTC_vehs_mobile_west = [mobile_west_0];//Editable - Include all mobile respawn objects in array for side west, blank out if no mobile respawn (BTC_mobile_respawn = 0) BTC_vehs_mobile_east = [mobile_east_0];//Editable - As above, but for East Side BTC_vehs_mobile_guer = [];//Editable - As above, but for independent side BTC_vehs_mobile_civ = [];//Editable - As above, but for civilian side }; ---------- Post added at 14:22 ---------- Previous post was at 14:19 ---------- Well, in my main mission, I've disabled self respawn, so the player has to be revived by another player. I'd like to just flat out remove the respawn button completely and let them just spectate their body but have no respawn button or action wheel options until they are revived or BTC_revive_time_max expires.
-
I guess my primary question would be, what does the new system actually add in? :) Also, is there any way to give a clear screen/spectator view when a person is down, but hide the Action wheel/respawn button?
-
Hey Gia, awesome release! Can't wait to test it. When you get a chance for the next release, could you maybe add comments for every setting in the init file clarifying what they do? I'd be happy to help :)
-
Agreed, I can't think of any logical reason either you would ever want weather and time not to be exactly synched across servers/clients. The only explanation I can even think of would be that there's some technical issue it's not set up to synch due to bandwidth issues, or something of the sort.
-
I don't think the Dynamic Weather mod works at all in A3 with the new humidity/cloud setup. I haven't been able to get it to work, but maybe someone else has. And if they have, please share, I'd love to just use that. :)
-
Updated my script and cleaned a few things up/added some more comments to help clarify things. Still no idea if JIP weather will work the way I have it set. /* randomWeather.sqf v 0.2 By Meatball Script Requirements: 1) Put this code/script in a file named "randomWeather.sqf" in root mission folder. 2) Create a call in init.sqf that will run on the server and all clients. execVM "randomWeather.sqf"; 3) Have the following code in the "class Params" section of your description.ext to create weather as a selectable parameter for the players. // paramsArray[0] class initialWeather { title = "Initial Weather"; values[] = {0,1,2,3,4,5,6}; texts[] = {"Clear","Overcast","Light Rain","Heavy Rain","Light Fog","Heavy Fog","Random"}; default = 0; }; */ // JIP Check if (!isServer && isNull player) then {isJIP=1;} else {isJIP=0;}; // Set initial Weather from Parameter options chosen by players. if(isServer) then { // Make sure the # in the select below matches what # your initialWeather class is in the description.ext initialWeather = (paramsArray select 5); switch (initialWeather) do{ case 0: {initialOvercast = 0;initialHumidity = 0;initialFog = 0;}; // Clear case 1: {initialOvercast = .65;initialHumidity = .50;initialFog = 0;}; // Overcast case 2: {initialOvercast = .80;initialHumidity = .80;initialFog = .05;}; // Light Rain case 3: {initialOvercast = 1;initialHumidity = 1;initialFog = .05;}; // Heavy Rain case 4: {initialOvercast = .75;initialHumidity = .10;initialFog = .30;}; // Light Fog case 5: {initialOvercast = .85;initialHumidity = .20;initialFog = .50;}; // Heavy Fog case 6: {initialOvercast = random(1);initialHumidity = random(1);initialFog = random(.25);}; // Random }; // Create two random weather forecasts based off current conditions and keep values within proper limits (Overcast/Humidity: 0 - 1, Fog: 0 - 0.5) _randOvercast = round ((random(1)-0.5)*(10^2))/(10^2); _randHumidity = round ((random(1)-0.5)*(10^2))/(10^2); _randFog = round ((random(0.5)-0.25)*(10^2))/(10^2); _randOvercast2 = round ((random(1)-0.5)*(10^2))/(10^2); _randHumidity2 = round ((random(1)-0.5)*(10^2))/(10^2); _randFog2 = round ((random(0.5)-0.25)*(10^2))/(10^2); // Create two random overcast level forecasts and keep between 0 and 1 forecastOvercast = initialOvercast + _randOvercast; if (forecastOvercast > 1) then {forecastOvercast = forecastOvercast - (2*_randOvercast)}; if (forecastOvercast < 0) then {forecastOvercast = forecastOvercast + (abs(2*_randOvercast))}; forecastOvercast2 = forecastOvercast + _randOvercast2; if (forecastOvercast2 > 1) then {forecastOvercast2 = forecastOvercast2 - (2*_randOvercast2)}; if (forecastOvercast2 < 0) then {forecastOvercast2 = forecastOvercast2 + (abs(2*_randOvercast2))}; // Create two random humidity level forecasts and keep between 0 and 1 forecastHumidity = initialHumidity + _randHumidity; if (forecastHumidity > 1) then {forecastHumidity = forecastHumidity - (2*_randHumidity)}; if (forecastHumidity < 0) then {forecastHumidity = forecastHumidity + (abs(2*_randHumidity))}; forecastHumidity2 = forecastHumidity + _randHumidity2; if (forecastHumidity2 > 1) then {forecastHumidity2 = forecastHumidity2 - (2*_randHumidity2)}; if (forecastHumidity2 < 0) then {forecastHumidity2 = forecastHumidity2 + (abs(2*_randHumidity2))}; // Create two random fog level forecasts and keep between 0 and 0.6 forecastFog = initialFog + _randFog; if (forecastFog > 0.6) then {forecastFog = forecastFog - (2*_randFog)}; if (forecastFog < 0) then {forecastFog = forecastFog + (abs(2*_randFog))}; forecastFog2 = forecastFog + _randFog2; if (forecastFog2 > 0.6) then {forecastFog2 = forecastFog2 - (2*_randFog2)}; if (forecastFog2 < 0) then {forecastFog2 = forecastFog2 + (abs(2*_randFog2))}; // Broadcast Initial Weather settings from Parameters Selection publicVariable "initialOvercast"; publicVariable "initialHumidity"; publicVariable "initialFog"; // Broadcast 60 Minute Random Forecast publicVariable "forecastOvercast"; publicVariable "forecastHumidity"; publicVariable "forecastFog"; // Broadcast 120 Minute Random Forecast publicVariable "forecastOvercast2"; publicVariable "forecastHumidity2"; publicVariable "forecastFog2"; }; // Wait until initial and forecast weather forecasts are set up. waitUntil {!isnil "forecastFog2"}; // Debug Hint // hint format ["IO: %1 | IH: %2 | IF: %3 | FO: %4 | FH: %5 | FF: %6 | FO2: %7 | FH2: %8 | FF2: %9",initialOvercast,initialHumidity,initialFog,forecastOvercast,forecastHumidity,forecastFog,forecastOvercast2,forecastHumidity2,forecastFog2]; // Set up initial Weather for the server and non-JIP Players, but keep on same date. (Skiptime commands are required for immediate humidity level changes) if (isServer or isJIP == 0) then { skipTime -24; 86400 setOvercast initialOvercast; 86400 setFog initialFog; simulSetHumidity initialHumidity; skipTime 24; // Set up 60 minute forecast weather after short delay. sleep 60; 3600 setOvercast forecastOvercast; 3600 setFog forecastFog; sleep 3600; simulSetHumidity forecastHumidity; // Set up 120 minute forecast weather after short delay. sleep 60; 3600 setOvercast forecastOvercast2; 3600 setFog forecastFog2; sleep 3600; simulSetHumidity forecastHumidity2; // Set up 180 minute forecast weather after short delay. sleep 60; 3600 setOvercast initialOvercast; 3600 setFog initialFog; sleep 3600; simulSetHumidity initialHumidity; }; // Set up weather for JIP players (Work in Progress, not sure it works) if (isJIP == 1) then { // If server has been running less than 60 minutes, Set up 60 minute forecast weather. if ((3660 - serverTime) > 0) then { (3660 - serverTime) setOvercast forecastOvercast; (3660 - serverTime) setFog forecastFog; sleep (3660 - serverTime); simulSetHumidity forecastHumidity; }; // If server has been running less than 120 minutes, Set up 120 minute forecast weather. if ((7320 - serverTime) > 0) then { (7320 - serverTime) setOvercast forecastOvercast2; (7320 - serverTime) setFog forecastFog2; sleep (7320 - serverTime); simulSetHumidity forecastHumidity2; }; // If server has been running less than 180 minutes, Set up 180 minute forecast weather. if ((10980 - serverTime) > 0) then { (10980 - serverTime) setOvercast initialOvercast; (10980 - serverTime) setFog initialFog; sleep (10980 - serverTime); simulSetHumidity initialHumidity; }; };
-
Set up a really simple weather test mission if anyone wants to mess with it. Use the radio to setRain, setOvercast and simulSetHumidity as well as advance the skipTime by 1 minute blocks. https://dl.dropboxusercontent.com/u/64136645/Testweather.Stratis.pbo.zip setOvercast seems to be the key to weather as you can set humidity to 1 or rain to 1 and nothing will happen until overcast reaches a certain point. Be nice if someone from BIS actually posted up the 'rules' of the weather functions so we could work up some scripts :)
-
Sounds good, let me know how it goes. JIP is a problem for sure. I _think_ they should get the correct/current weather from the server when they connect. The problem is how to keep them in synch with the random changes. So, say they connect 45 minutes in, they'll problem get all the same weather everyone else is seeing at that time, but in 15 minutes when everyone else changes, I don't know if they'll get that correctly. Right now the script sets original weather, and then the first random weather to kick in at 60 minutes, 2nd to kick in at 120 minutes and then it goes back to the original weather at 180 minutes. It won't change after that point, which is fine in my mission because it shouldn't last much more than 3-4 hours, but in other missions that may be in an issue. I'm sure there's a better way to do that so it would continuously loop through random changes, and I might try to figure that out. I bet some of the skilled scripters out there are looking at mine and going, "What the heck is this guy thinking, he's doing it all wrong!" :)
-
So, I'm working through this, and got some of it working. I've gotten to the point where players can choose initial weather and it shows up on all initial players machines and on the server. Additionally, I've got it set to change every hour or so, but it's messy and the new commands are tough to work with. Couple of things I've figured out. 1) setOvercast does not create clouds. All it does is 'darken' the amount of sun that appears to be reaching the ground. 2) simulSetHumidity actually creates the clouds and the rain, but appears to rely on it being overcast enough (not sure of the minimum level) for rain to occur. 3) setOvercast appears to need the 'skipTime -24' / 'skipTime 24' trick to set the Overcast level correctly at mission start, setHumidity does not. 4) You need both setOvercast and simulSetHumidity to be high for it to actually rain. Examples: - Overcast 0, Humidity 0 will be bright and sunny on the ground and have no clouds in the sky. - Overcast 1, Humidity 0 will appear very dark on the ground and the sky will be hazy, but there won't be a cloud in the sky. - Overcast 0, Humidity 1 will appear very sunny on the ground, but the sky will be loaded with clouds. - Overcast 1, Humidity 1 will appear dark on the ground, the sky will be loaded with clouds, and it will start to rain after about 10 seconds. Here's what I have so far: /* randomWeather.sqf v 0.1 By Meatball Script Requirements: 1) Place script as "randomWeather.sqf" in root mission folder. 2) Have a simple call in init.sqf that will run on server and all clients. execVM "randomWeather.sqf"; 3) Have the following listed as a selectable parameter in description.ext // paramsArray[0] class initialWeather { title = "Initial Weather"; values[] = {0,1,2,3,4,5,6}; texts[] = {"Clear","Overcast","Light Rain","Heavy Rain","Light Fog","Heavy Fog","Random"}; default = 0; }; */ // JIP Check if (!isServer && isNull player) then {isJIP=1;} else {isJIP=0;}; if(isServer) then { // Set initial Weather from Parameter options chosen by players. initialWeather = (paramsArray select 0); switch (initialWeather) do{ case 0: {initialCloud = 0;initialRain = 0;initialFog = 0;}; // Clear case 1: {initialCloud = .65;initialRain = .50;initialFog = 0;}; // Overcast case 2: {initialCloud = .80;initialRain = .80;initialFog = .05;}; // Light Rain case 3: {initialCloud = 1;initialRain = 1;initialFog = .05;}; // Heavy Rain case 4: {initialCloud = .75;initialRain = .10;initialFog = .30;}; // Light Fog case 5: {initialCloud = .85;initialRain = .20;initialFog = .50;}; // Heavy Fog case 6: {initialCloud = random(1);initialRain = random(1);initialFog = random(.25);}; // Random }; // Create a random weather forecasts based off current conditions and make sure they stay within proper limits (Rain/Clouds: 0-1, Fog: 0 - .5) _randCloud = round ((random(1)-0.5)*(10^2))/(10^2); _randRain = round ((random(1)-0.5)*(10^2))/(10^2); _randFog = round ((random(0.5)-0.25)*(10^2))/(10^2); _randCloud2 = round ((random(1)-0.5)*(10^2))/(10^2); _randRain2 = round ((random(1)-0.5)*(10^2))/(10^2); _randFog2 = round ((random(0.5)-0.25)*(10^2))/(10^2); // Create random overcast/cloud level forecasts forecastCloud = initialCloud + _randCloud; if (forecastCloud > 1) then {forecastCloud = forecastCloud - (2*_randCloud)}; if (forecastCloud < 0) then {forecastCloud = forecastCloud + (abs(2*_randCloud))}; forecastCloud2 = forecastCloud + _randCloud2; if (forecastCloud2 > 1) then {forecastCloud2 = forecastCloud2 - (2*_randCloud2)}; if (forecastCloud2 < 0) then {forecastCloud2 = forecastCloud2 + (abs(2*_randCloud2))}; // Create random rain/humidity level forecasts forecastRain = initialRain + _randRain; if (forecastRain > 1) then {forecastRain = forecastRain - (2*_randRain)}; if (forecastRain < 0) then {forecastRain = forecastRain + (abs(2*_randRain))}; forecastRain2 = forecastRain + _randRain2; if (forecastRain2 > 1) then {forecastRain2 = forecastRain2 - (2*_randRain2)}; if (forecastRain2 < 0) then {forecastRain2 = forecastRain2 + (abs(2*_randRain2))}; // Create random fog level forecasts forecastFog = initialFog + _randFog; if (forecastFog > 0.6) then {forecastFog = forecastFog - (2*_randFog)}; if (forecastFog < 0) then {forecastFog = forecastFog + (abs(2*_randFog))}; forecastFog2 = forecastFog + _randFog2; if (forecastFog2 > 0.6) then {forecastFog2 = forecastFog2 - (2*_randFog2)}; if (forecastFog2 < 0) then {forecastFog2 = forecastFog2 + (abs(2*_randFog2))}; // Broadcast Initial Weather settings publicVariable "initialCloud"; publicVariable "initialRain"; publicVariable "initialFog"; // Broadcast 60 Minute Forecast publicVariable "forecastCloud"; publicVariable "forecastRain"; publicVariable "forecastFog"; // Broadcast 120 Minute Forecast publicVariable "forecastCloud2"; publicVariable "forecastRain2"; publicVariable "forecastFog2"; }; // Wait until initial and forecast weather settings are setup. waitUntil {!isnil "forecastFog2"}; // Debug Hint // hint format ["IC: %1 | IR: %2 | IF: %3 | FC: %4 | FR: %5 | FF: %6 | FC2: %7 | FR2: %8 | FF2: %9",initialCloud,initialRain,initialFog,forecastCloud,forecastRain,forecastFog,forecastCloud2,forecastRain2,forecastFog2]; // Set up initial Weather for Server/non JIP Players, but keep on same date. (Skiptime commands required for immediate cloud/humidity level changes) if (isServer or isJIP == 0) then { skipTime -24; 86400 setOvercast initialCloud; 86400 setFog initialFog; simulSetHumidity initialRain; skipTime 24; // Set up 60 minute Forecast weather after short delay. sleep 60; 3600 setOvercast forecastCloud; 3600 setFog forecastFog; sleep 3600; simulSetHumidity forecastRain; // Set up 120 minute Forecast weather after short delay. sleep 60; 3600 setOvercast forecastCloud2; 3600 setFog forecastFog2; sleep 3600; simulSetHumidity forecastRain2; // Set up 180 minute Forecast weather after short delay. sleep 60; 3600 setOvercast initialCloud; 3600 setFog initialFog; sleep 3600; simulSetHumidity initialRain; }; // Set up weather for JIP players if (isJIP == 1) then { sleep 60; // Set up 60 minute Forecast weather after short delay. (3660 - serverTime) setOvercast forecastCloud; (3660 - serverTime) setFog forecastFog; sleep (3660 - serverTime); simulSetHumidity forecastRain; // Set up 120 minute Forecast weather after short delay. sleep 60; (7320 - serverTime) setOvercast forecastCloud2; (7320 - serverTime) setFog forecastFog2; sleep (7320 - serverTime); simulSetHumidity forecastRain2; // Set up 180 minute Forecast weather after short delay. sleep 60; (10980 - serverTime) setOvercast initialCloud; (10980 - serverTime) setFog initialFog; sleep (10980 - serverTime); simulSetHumidity initialRain; }; This script is butt ugly and I'm sure the code could be written a lot more efficiently/cleaner. I'm just learning and any input is appreciated. The script does allow the players to select the starting mission weather and correctly sets that up for all players at mission start. It also appears to correctly 'adjust' the weather at the 60 minute intervals I've set on the server and the originally connected player clients. I have run into two issues so far though. 1) setSimulHumidity appears to work almost immediately when called. So while overCast, Fog and Wind can slowly be transitioned over a set period of time, Humidity needs to be set to fire at the end of the transition period, and honestly, it looks a bit goofy with the clouds/rain just stopping all of a sudden whereas the other weather aspects have a smooth transition over time. 2) Almost positive that the JIP code does not work correctly, and I've yet to be able to test it. ---------- Post added at 19:51 ---------- Previous post was at 19:37 ---------- Quick update, to test it out, I created two dummy radio triggers on a map with 0 overcast set as a default. Radio Alpha I set to run "0 setOvercast 1;" and radio Bravo I set to run repeatedly "hint format["Current OC Level: %1",overcast];" I started the mission, ran the bravo radio and it came back with 0 overcast. Ran Alpha and then I saw the overcast level slowly increasing from 0 upwards. After 1 minute it had gone from 0 to 0.0167569. Which means, you need almost exactly an hour for the engine to go from Overcast 0 to Overcast 1, even if you have it set to delay of 0. On the flip side, set two radio triggers up (that both can both run repeatedly) with "simulSetHumidity 0;" and "simulSetHumidity 1;" as the action and you can watch the clouds pop in and pop out immediately on the trigger.
-
Found another good similar conversation in another thread. http://forums.bistudio.com/showthread.php?154391-Volumetric-clouds-in-ARMA-3
-
Secret SimulWeather commands?
meatball replied to austin_medic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Agreed whole heartedly on non-synched weather in MP being crazy at this point in the game. Was playing a TvT the other night, some guys had fog and could only see 500m, others were nice and clear and could see 2000. Guess who was doing better? :) -
Alright, I think I'm getting there. It appears that you need a combination of both setOvercast and simulSetHumidity to get the rain going. Overcast just seems to 'dim' the sun, but doesn't actually create the clouds, the SetHumidity brings out the clouds and rain. I've got it so I can configure the weather through parameters and it seems to be reflected on everyone's machines correctly. The only problem I'm having is getting the weather to randomly change over time. Here's the script I'm using so far. I _know_ my scripting is awful, so any suggestions on how to clean things up or make it more efficient is much appreciated. So in description.ext I have the following block of code in the parameters. class Params { // paramsArray[0] class initialWeather { title = "Initial Weather"; values[] = {0,1,2,3,4,5,6}; texts[] = {"Clear","Overcast","Light Rain","Heavy Rain","Light Fog","Heavy Fog","Random"}; default = 0; }; }; This gives the players the option to choose the starting weather in the setup screen. Then I've created a script that I call in the init.sqf for everyone, server and client. // JIP Check if (!isServer && isNull player) then {isJIP=1;} else {isJIP=0;}; // Wait until player is initialized if (!isDedicated) then {waitUntil {!isNull player && isPlayer player};}; if(isServer) then { initialWeather = (paramsArray select 0); switch (initialWeather) do{ // Clear case 0: {cloudSet = 0;rainSet = 0;fogSet = 0;}; // Overcast case 1: {cloudSet = 0.7;rainSet = 0.5;fogSet = 0;}; // Light Rain case 2: {cloudSet = 0.85;rainSet = 0.8;fogSet = 0.05;}; // Heavy Rain case 3: {cloudSet = 1;rainSet = 1;fogSet = .05;}; // Light Fog case 4: {cloudSet = 0.25;rainSet = 0.25;fogSet = 0.25;}; // Heavy Fog case 5: {cloudSet = 0.5;rainSet = 0.5;fogSet = 0.75;}; // Random case 6: {cloudSet = random(1);rainSet = random(1);fogSet = random(.75);}; }; publicVariable "cloudSet"; publicVariable "rainSet"; publicVariable "fogSet"; }; waitUntil {!isnil "cloudSet"}; if (isServer) then { publicVariable "cloudSet"; publicVariable "rainSet"; publicVariable "fogSet"; }; if (isServer or isJIP == 0) then { //Set up initial Weather for Server/non JIP Players, but keep on same date. skipTime -24; 86400 setOvercast cloudSet; 86400 setFog fogSet; simulSetHumidity rainSet; skipTime 24; } else { // Set Weather for JIP Players 599 setOvercast cloudSet; 599 setFog fogSet; simulSetHumidity rainSet; }; // Set up weather changes and weather update loop. while {isServer} do { _randTFC = random(0.2)-0.1; _randTFR = random(0.2)-0.1; _randTFF = random(0.2)-0.1; cloudSet = cloudSet + _randTFC; if (cloudSet > 1) then {cloudSet = cloudSet - (2*_randTFC)}; if (cloudSet < 0) then {cloudSet = cloudSet + (abs(2*_randTFC))}; rainSet = rainSet + _randTFR; if (rainSet > 1) then {rainSet = rainSet - (2*_randTFR)}; if (rainSet < 0) then {rainSet = rainSet + (abs(2*_randTFR))}; fogSet = fogSet + _randTFF; if (fogSet > 1) then {fogSet = fogSet - (2*_randTFF)}; if (fogSet < 0) then {fogSet = fogSet + (abs(2*_randTFF))}; publicVariable "cloudSet"; publicVariable "rainSet"; publicVariable "fogSet"; sleep 600; }; while {!isServer} do { 599 setOvercast cloudSet; 599 setFog fogSet; simulSetHumidity rainSet; sleep 600; }; Like I said, seems to set the weather correctly for everyone on mission startup, just having a problem with the loops to randomly change/update the weather for everyone. I also bet I've got things a bit bass akward in my attempt to be able to handle server only, clients and JIP's all in the same script and may have stuff completely wrong that I didn't catch with my little bit of testing. Any thoughts/suggestions?
-
Yeah, just seems strange. In a game where something like Time of Day/Weather has such a huge impact on not only immersion, but on fairness between people on other teams (imagine one person logging in as JIP and not getting rain or darkness while another person has rain and/or darkness) I would have thought this would be simple. I know client/server/JIP can be complicated, but yeesh.
-
There's gotta be a way to do it though. If you set a mission slider to 0 Overcast in the mission intel in the editor you get a nice sunny mission at the start. If you set it to 100, you get a heavy overcast sky with a good chance of rain. Makes no sense that you can set that through script. The engine is doing it somehow based on the intel sliders...
-
Anyone know a simple way to handle the delay in the setOvercast effect for a multiplayer game? I'd like to give my players the option to set cloud/rain levels at the start of the game and have it start cloudy or rainy. If you set the sliders it seems to work, but setOvercast does not.
-
Random and/or Parameter Selectable Weather?
meatball posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've been trying to mess around with weather a bit to allow players to select starting weather and make weather truly random/dynamic during a mission and most of the stuff that worked in A2 doesn't work with A3. I know they're using a new weather system, etc., but was hoping we'd have some commands available before release. While the slider available in the mission intel screen is great, I don't want the weather to be the same from mission to mission. Also, the only setting I can seem to change through parameters successfully is Fog level. I missing something, or is there a script that anyone has gotten to work? -
You still have "mobile_east_1" listed as a mobile respawn for east. You either need that on the map, or just remove it so it looks like the _guer or _civ lines...
-
Heh, thanks! Altis is great, and I've already started toying with a few things. :)
-
New Release! v 0.9 Released: Available on Armaholic (Thanks Big!) ChangeLog - Minor tweaks to AI skills levels. Lowered Normal, Hard & Extreme Levels slightly. - Reconfigured triggers for destroyed towers/buildings so they should no longer break every time when the game is patched. - Fixed a problem with Starting script that would sometimes cause the insertion helicopter to crash. - Believe the BTC Revive error message is now fixed. Known Issues (Tested on [Dev] Arma 3 Beta 0.77.109561) - None I _hope_ this will be the last release before the official game goes live. At that point I'll make sure everything works with the official release and release Static Loop 1.0. I'd might also add in random/changeable weather for the mission, but we'll see if I can figure out how to make it work. Enjoy, and as usual, let me know if you notice any issues!
-
Hey Giallustio, I've got a bit of a random question for you. How do you test your revive script when you're doing testing? Any time I want to test anything with revive I have to drag a few friends in to check it out, and if there was a way I could test things out by myself it'd be a lot easier. :)