IRONFRONT FANS FORUM
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Tayuk

Avatar / Picture

Admin
Registered:
Posts: 455
Reply with quote  #1 
Some missions you may have played have an extra button called Parameters, here is one way that the mission maker does it.
This particular example gives you options for the time of day, the weather, the view distance, enviromental effects and grass detail level. All four of the following files would need to be in your mision folder with your mission.sqm file.

In your description.ext file you would want this code:-
Code:

};

class Params {

class TimeofDay {

title = "Time of Day (2100 Summer is default)";

values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};

texts[] = {"0330 hrs - Summer", "0430 hrs - Summer", "0830 hrs - Summer", "1200 hrs - Summer", "1500 hrs - Summer", "1800 hrs - Summer", "2100 hrs - Summer", "2230 hrs - Summer", "Midnight Full Moon - Summer", "0530 hrs - Winter", "0830 hrs - Winter", "1030 hrs - Winter", "1200 hrs - Winter", "1500 hrs - Winter", "1700 hrs - Winter", "2200 hrs - Winter", "Midnight Full Moon - Winter"};

default = 6;

code = "TimeofDay = %1";

};

class Weather {

title = "Weather Conditions";

values[] = {0,1,2,3,4};

texts[] = {"Clear", "Overcast", "Light Fog", "Heavy Fog", "Storm"};

default = 0;

code = "Weather = %1";

};

class Environment {

title = "Enable Environment";

values[] = {0, 1};

texts[] = {"False", "True"};

default = 1;

code = "Environment = %1";

};

class Visibility {

title = "Visibility Range";

values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};

texts[] = {"2000m", "2500m", "3000m", "3500m", "4000m", "4500m", "5000m", "5500m", "6000m", "6500m", "7000m", "7500m", "8000m","8500m","9000m","9500m","10000m"};

default = 2;

code = "Visibility = %1";

};

class Grass {

title = "Grass Resolution";

values[] = {0, 1, 2, 3, 4};

texts[] = {"No Grass", "Small Grass", "Medium Grass", "Large Grass", "Max Grass"};

default = 4;

code = "Grass = %1";

};

};



Your Init.sqf file would need this code

 

Code:

processParamsArray = [] execVM "ParamsArray.sqf";
[] execVM "setMissionConditions.sqf";

Then this file called "ParamaArray.sqf"

Code:

for [ { _i = 0 }, { _i < count(paramsArray) }, { _i = _i + 1 } ] do
{
_paramName =(configName ((missionConfigFile >> "Params") select _i));
_paramValue = (paramsArray select _i);
_paramCode = ( getText (missionConfigFile >> "Params" >> _paramName >> "code"));
_code = format[_paramCode, _paramValue];
call compile _code;
};

Then this script called "SetMissionConditions.sqf"

Code:

// DECLARE VARIABLES AND FUNCTIONS
private ["_timeOfDay","_weather","_environment","_visibility","_grass","_MissionOvercast","_MissionFog","_MissionRain"];

// WAIT FOR PARAMSARRAY TO BE PROCESSED
waitUntil {scriptDone processParamsArray};

// Conditions are set in the parameters screen (during mission set-up).
_timeOfDay = TimeOfDay;
_weather = weather;
_environment = Environment;
_visibility = Visibility;
_grass = Grass;

// SETS THE TIME OF DAY
switch (_timeOfDay) do {
case 0: {setDate [1944, 7, 16, 3, 30]}; // Early Morning
case 1: {setDate [1944, 7, 16, 4, 30]}; // Dawn
case 2: {setDate [1944, 7, 16, 8, 30]}; // Morning
case 3: {setDate [1944, 7, 16, 12, 0]}; // Noon
case 4: {setDate [1944, 7, 16, 15, 0]}; // Afternoon
case 5: {setDate [1944, 7, 16, 18, 0]}; // Evening
case 6: {setDate [1944, 7, 16, 21, 0]}; // Dusk
case 7: {setDate [1944, 7, 16, 22, 30]}; // Night
case 8: {setDate [1944, 7, 16, 0, 0]}; // Midnight
case 9: {setDate [1944, 11, 17, 5, 30];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"}; // Winter Early Morning
case 10: {setDate [1944, 11, 17, 8, 30];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"}; // Winter Dawn
case 11: {setDate [1944, 11, 17, 10, 30];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"};// Winter Mid Morning
case 12: {setDate [1944, 11, 17, 12, 0];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"}; // Winter Noon
case 13: {setDate [1944, 11, 17, 15, 00];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"};// Winter Afternoon
case 14: {setDate [1944, 11, 17, 17, 00];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"};// Winter Evening
case 15: {setDate [1944, 11, 17, 22, 00];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"};// Winter Night
case 16: {setDate [1944, 11, 17, 0, 0];nul = [player, 0.01] execvm "SimpleBreathFog.sqf"};// Winter Night

};

// SETS THE WEATHER CONDITIONS

switch (_weather) do {
case 0: {_MissionOvercast = 00.00; _MissionFog = 00.00; _MissionRain = 00.00}; // Clear
case 1: {_MissionOvercast = 00.60; _MissionFog = 00.10; _MissionRain = 00.30}; // Overcast
case 2: {_MissionOvercast = 00.60; _MissionFog = 00.8125; _MissionRain = 00.10}; // Light Fog
case 3: {_MissionOvercast = 00.60; _MissionFog = 00.96; _MissionRain = 00.20}; // Heavy Fog
case 4: {_MissionOvercast = 01.00; _MissionFog = 00.50; _MissionRain = 01.00}; // Storm

};

0 setOvercast _MissionOvercast;
0 setFog _MissionFog;
0 setRain _MissionRain;

// SETS WHETHER OR NOT THE AMBIENT LIFE AND SOUND IS ACTIVE

switch (_environment) do {
case 0: {enableEnvironment false}; // ambient life and sounds off
case 1: {enableEnvironment true}; // ambient life and sounds on

};

// SETS THE IN-GAME VIEW DISTANCE

switch (_visibility) do {
case 0: {setViewDistance 2000};
case 1: {setViewDistance 2500};
case 2: {setViewDistance 3000};
case 3: {setViewDistance 3500};
case 4: {setViewDistance 4000};
case 5: {setViewDistance 4500};
case 6: {setViewDistance 5000};
case 7: {setViewDistance 5500};
case 8: {setViewDistance 6000};
case 9: {setViewDistance 6500};
case 10: {setViewDistance 7000};
case 11: {setViewDistance 7500};
case 12: {setViewDistance 8000};
case 13: {setViewDistance 8500};
case 14: {setViewDistance 9000};
case 15: {setViewDistance 9500};
case 16: {setViewDistance 10000};

};

// SETS THE RESOLUTION OF THE GRASS

switch (_grass) do {
case 0: {setTerrainGrid 50}; // no grass
case 1: {setTerrainGrid 25}; // little grass
case 2: {setTerrainGrid 12.5}; // medium grass
case 3: {setTerrainGrid 6.25}; // large grass
case 4: {setTerrainGrid 3.125}; // maximum grass

};



To have it snow in the winter, you have to have the functions module and the cold day module on the map. You will also need to set the weather to overcast before the mission starts.
For the Inviroment options to work I think you have to have the Inviroment modules on the map, i.e. enviroment colors, effects etc. (along with the functions module).

I have made changes to the times of day to suit Ironfront (since we have no night vision all the night time's have a moon to give some light). 

I have not written these scripts, unfortunately the original author is not known, but i have made slight changes to suit Ironfront. 

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.