United States Intelligence
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Parameters (new in v 1.04)

Go down

Parameters (new in v 1.04) Empty Parameters (new in v 1.04)

Post  DirTyDeeDs Wed Sep 16, 2009 2:43 pm

I found this code example of multiple selectable mission parameters.

cobra4v320 wrote:Okay I figured out how to get it to work:

Description.ext:
Code:
class Params   
{   
   
class View   
{   
   title="View Distance";
   values[]={0,1,2,3,4,5,6,7,8,9};
   texts[]={"1000m","2000m","3000m","4000m","5000m","6000m","7000m","8000m","9000m","10000m"};
   default = 0;
};   
   
   
class Grass   
{   
   title="Grass";
   values[]={0,1,2,3,4};
   texts[]={"No Grass", "Default MP", "Default SP", "More", "Max"};
   default = 0;
};   
   
   
class Environment   
{   
         title="Enable Environment";
   values[]={0,1};
   texts[]={"True","False"};
   default = 1;
};   
   
   
class Missiontime   
{   
         title="Time Of Day";
   values[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
   texts[]={"00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"};
   default=5;
};   
   
                };

Init.sqf
Code:
viewparam = (paramsArray select 0);
if (viewparam == 0) then {setViewDistance 1000};
if (viewparam == 1) then {setViewDistance 2000};
if (viewparam == 2) then {setViewDistance 3000};
if (viewparam == 3) then {setViewDistance 4000};
if (viewparam == 4) then {setViewDistance 5000};
if (viewparam == 5) then {setViewDistance 6000};
if (viewparam == 6) then {setViewDistance 7000};
if (viewparam == 7) then {setViewDistance 8000};
if (viewparam == 8) then {setViewDistance 9000};
if (viewparam == 9) then {setViewDistance 10000};

grassparam = (paramsArray select 1);
if (grassparam == 0) then {setTerrainGrid 50};
if (grassparam == 1) then {setTerrainGrid 25};
if (grassparam == 2) then {setTerrainGrid 12.5};
if (grassparam == 3) then {setTerrainGrid 6.25};
if (grassparam == 4) then {setTerrainGrid 3.125};

environment = (paramsarray select 2);
if (environment == 0) then {enableEnvironment true};
if (environment == 1) then {enableEnvironment false};

timeparam = (paramsArray select 3);
if (timeparam == 0) then {skiptime 0};
if (timeparam == 1) then {skiptime 1};
if (timeparam == 2) then {skiptime 2};
if (timeparam == 3) then {skiptime 3};
if (timeparam == 4) then {skiptime 4};
if (timeparam == 5) then {skiptime 5};
if (timeparam == 6) then {skiptime 6};
if (timeparam == 7) then {skiptime 7};
if (timeparam == 8) then {skiptime 8};
if (timeparam == 9) then {skiptime 9};
if (timeparam == 10) then {skiptime 10};
if (timeparam == 11) then {skiptime 11};
if (timeparam == 12) then {skiptime 12};
if (timeparam == 13) then {skiptime 13};
if (timeparam == 14) then {skiptime 14};
if (timeparam == 15) then {skiptime 15};
if (timeparam == 16) then {skiptime 16};
if (timeparam == 17) then {skiptime 17};
if (timeparam == 18) then {skiptime 18};
if (timeparam == 19) then {skiptime 19};
if (timeparam == 20) then {skiptime 20};
if (timeparam == 21) then {skiptime 21};
if (timeparam == 22) then {skiptime 22};
if (timeparam == 23) then {skiptime 23};
DirTyDeeDs
DirTyDeeDs
Uber Spammer Jedi
Uber Spammer Jedi

Posts : 802
Join date : 2008-07-25
Age : 52
Location : Live Free Or Die

http://usi-team.xippy.org/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum