Jump to content
Sign in to follow this  
hogmason

Paramaters not working

Recommended Posts

why are none of my parameters working

description.ext

class Params
{
       class DayTime {
	//paramsArray[0]
               title = "Time Of Day";
               values[] = {-6,0,8,13};
	default = 0;
               texts[] = {"Morning", "Clear day", "Sundown", "Night"};        
	};

       class Revive {
	// paramsArray[1]
               title = "Number of Revives";
               values[] = {2000,1000,20,10,7,5};
	default = 1000;
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};                
       };

	class debug {
	// paramsArray[2]
               title = "Debug Y/N";
               values[] = {true,false};
	default = false;
               texts[] = {"yes","no"};
       };

};


init.sqf

if(isNil "paramsArray") then{
   paramsArray = [
       0, // Time of Day
       1000, // Revive
       true, //debug
	20 //task count
   ];
};

HOG_debug = (paramsarray select 2);


Share this post


Link to post
Share on other sites

ok well in game if i select say night for time of day its still day when game loads up and debug yes or no its always no -- to sum it up the default dont work and the selection i choose in game doesnt work.

Share this post


Link to post
Share on other sites

paramsArray = [

0, // Time of Day

1000, // Revive

true, //debug

20 //task count

];

you are commenting inside of an array i think dude - therefore it looks like this paramsArray = [0, // Time of Day 1000, // Revive true, //debug 20 //task count];

// Time of Day // Revive //debug //task count

paramsArray = [0, 1000, true, 20 ];

Share this post


Link to post
Share on other sites

never thought of it like that cheers mate ill try that now ;)

---------- Post added at 00:00 ---------- Previous post was at 23:52 ----------

bugger that still diddnt work

Share this post


Link to post
Share on other sites
paramsArray = [

0, // Time of Day

1000, // Revive

true, //debug

20 //task count

];

you are commenting inside of an array i think dude - therefore it looks like this paramsArray = [0, // Time of Day 1000, // Revive true, //debug 20 //task count];

// Time of Day // Revive //debug //task count

paramsArray = [0, 1000, true, 20 ];

I haven't had problems with that.

Share this post


Link to post
Share on other sites
paramsArray = [

0, // Time of Day

1000, // Revive

true, //debug

20 //task count

];

you are commenting inside of an array i think dude - therefore it looks like this paramsArray = [0, // Time of Day 1000, // Revive true, //debug 20 //task count];

// Time of Day // Revive //debug //task count

paramsArray = [0, 1000, true, 20 ];

You're incorrect. Comments are removed by preprocessor so it would never look like that.

Share this post


Link to post
Share on other sites
You're incorrect. Comments are removed by preprocessor so it would never look like that.

So what is the right way?, please explain, if you can give an example?

thanks

Share this post


Link to post
Share on other sites

well i got it working by moving this

class Params
{
       class DayTime {
               title = "Time Of Day";
               values[] = {-6,0,8,13};
               texts[] = {"Morning", "Clear day", "Sundown", "Night"}; 
			default = 0;				
	};

       class Revive {
               title = "Number of Revives";
               values[] = {2000,1000,20,10,7,5};
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};    
			default = 1000;				
       };

	class debug {
               title = "Debug Y/N";
               values[] = {true,false};
               texts[] = {"yes","no"};
			default = false;
       };

};


up to the top of the description file below the class header i.e

class Header
{
 gameType = Coop;
 minPlayers = 1;
 maxPlayers = 25;
};
showCompass   = 1; 
showGPS       = 1; 
showMap       = 1; 
showWatch     = 1;
respawn = "BASE";
respawndelay = 4;
disabledAI = 1;
debriefing=1;
loadScreen    = "HardcoreMisc\pics\ophog.paa";
onLoadMission = "Operation H.O.G SOCOMD Command by =Mason= Presented by Hardcore Online Gaming";
onLoadIntro = "Operation H.O.G SOCOMD Command by =Mason= Presented by Hardcore Online Gaming";

/////////////////////////////////////////
//            Paramaters               //
/////////////////////////////////////////
class Params
{
       class DayTime {
               title = "Time Of Day";
               values[] = {-6,0,8,13};
               texts[] = {"Morning", "Clear day", "Sundown", "Night"}; 
			default = 0;				
	};

       class Revive {
               title = "Number of Revives";
               values[] = {2000,1000,20,10,7,5};
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};    
			default = 1000;				
       };

	class debug {
               title = "Debug Y/N";
               values[] = {true,false};
               texts[] = {"yes","no"};
			default = false;
       };

};


so it loads before all the

#include's and sounds and all that jazz

also in my init i tested and found both ways worked

BUT....................

i am still having an issue with my debug option and time of day option in my params so... the revive selection is working all my defualts are showing correctly " before they were not on my defualts"

But still now when i change to debug yes or time of day to night etc... nothing happens

i know my debug wors for if i change it to

debug = true

from debug = (parramsArray select 2);

the server shows my debug markers.

so again my debug code is

description.ext


class Params
{
       class DayTime {
               title = "Time Of Day";
               values[] = {-6,0,8,13};
               texts[] = {"Morning", "Clear day", "Sundown", "Night"}; 
			default = 0;				
	};

       class Revive {
               title = "Number of Revives";
               values[] = {2000,1000,20,10,7,5};
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};    
			default = 1000;				
       };

[color="#FF0000"]		class debug {
               title = "Debug Y/N";
               values[] = {true,false};
               texts[] = {"yes","no"};
			default = false;
       };[/color]

};

in my init

HOG_debug = (paramsArray select 2);

==== also above this is have ====

if(isNil "paramsArray") then{
   paramsArray = [0, 1000, true]; 
};

and my debug code is triggerd by

inside all my scripts


if (HOG_debug) then {

 ==what i want in here==

};

can any 1 see what i have done wrong this has me stuffed

Share this post


Link to post
Share on other sites

Huh. You select a dayTime parameter all right.

Now, if you don't do anything with it... :p Ain't nothing gonna happen.

Anything looking like this anywhere?

skiptime (((paramsarray select 0) - daytime + 24) % 24);

Should be in the init.sqf.

And i'm not sure, but for security reasons, i'd execute that on all clients and server.

By the way, what's minus six o'clock?

Edited by BlackMamb

Share this post


Link to post
Share on other sites

lmaorofl funny that -6 never noticed that i actually got it of google lol cheers mate.

Do you see a issue with the debug Param

---------- Post added at 11:02 ---------- Previous post was at 10:56 ----------

so in other words

if (isServer) then { skiptime (((paramsarray select 0) - daytime + 24) % 24); };

Share this post


Link to post
Share on other sites

In the same words: i'm not sure, but for security reasons, i'd execute that on all clients and server.

As dor the debug thing, beats the hell outta me.

Share this post


Link to post
Share on other sites

hogmason, not sure you can use "true,false" for values...

maybe this:

values[]={0,1};

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

default=0;

Check out this post from Hoz, and pay attention to the part he talks about the params array selection.

It looks like instead of you trying paramsArray select 2, it would be paramsArray select 4...

Multiple Parameters in MP Lobby

Edited by panther42

Share this post


Link to post
Share on other sites

yeah i tried that panther

so my order was

params 0 was time

params 1 was revive

params 2 was debug

then i tried what hoz said

params 2 to time

params 3 to revive

params 4 to debug

and changed the part in revive init from 1 -3 but then the revive did not work so i think that is no longer the case.

as for the true and false to 0 and 1

that just may be it ill test it now thanks mate.

and thanks to all great help sorry for my noobness lol ;)

---------- Post added at 12:07 ---------- Previous post was at 12:06 ----------

also if i change the values to 0, 1

would i then have to change the

if (HOG_debug) then {

to something like

if (HOG_debug >1) then {

Share this post


Link to post
Share on other sites

What about something like this then, in your init.sqf:

if(isNil "debug") then {debug = 0;};

if(debug == 0) then {HOG_debug = false;};

if(debug == 1) then {HOG_debug = true;};

It may be easier if you rename your class to HOG_debug_setting

Then change all the above debug to HOG_debug_setting

Oh, and maybe change the text values to "Off", "On"

Just a thought...

This would allow you to check Hog_debug in a script like:

if (HOG_debug) then {

// do all your crazy $hit here...

};

Edited by panther42

Share this post


Link to post
Share on other sites

cheers mate ill try that tomoz appreciate the help

so ill; just get my head around all that so this is what you are saying only change the debug word so i.e


if(isNil "HOG_debug_setting") then {HOG_debug_setting = 0;};
if(HOG_debug_setting == 0) then {HOG_debug = false;};
if(HOG_debug_setting == 1) then {HOG_debug = true;};

and not

if(isNil "HOG_debug_setting") then {HOG_debug_setting = 0;};
if(HOG_debug_setting == 0) then {HOG_debug_setting = false;};
if(HOG_debug_setting == 1) then {HOG_debug_setting = true;};


Share this post


Link to post
Share on other sites

The first one you listed is what I'm suggesting.

Make sure you change in your class params, class debug to class Hog_debug_setting. Easier tracking is the way I see it.

If you leave it as class debug, it will work also. Just use the example I gave using debug only.

Share this post


Link to post
Share on other sites

Don't use true and false in the description.ext... won't work!

class debug {
       title = "Debug Y/N";
       values[] = {0,1};
       texts[] = {"yes","no"};
       default = 0;
};

... and maybe use something like this in your script....and it is paramsArray select 2 for the third item.

Hog_Debug = false;
if((paramsArray select 2) == 1) then {Hog_Debug = true};

Edited by twirly
Clarity

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×