Jump to content
Sign in to follow this  
colosseum

Need help with MP mission parameters

Recommended Posts

All,

Would like to be able to set mission parameters in MP (such as the time of day), but cannot get it to work.

I have the following lines in Description.ext:

class Params
{
class DayTime
{
	title="Start time:";
	values[]={1,3,6,9,12,15,18,21,24,25};
	texts[]={"1:00am","3:00am","6:00am","9:00am","12:00pm","3:00pm","6:00pm","9:00pm","12:00am"};
	default=12;
};
};

And using this line in init.sqf:

// Skip to parameter-defined time
definedTime = (paramsArray select 0);
skipTime definedTime;

I'm sure it's something very simple but I CANNOT figure it out.

Thanks,

Ian

Share this post


Link to post
Share on other sites



Description.ext:
class Params
{
 class TimeOfDay {
   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,99};
   texts[] = {"0000","0100","0200","0300","0400","0500","0600","0700","0800","0900","1000","1100","1200","1300","1400","1500","1600","1700","1800","1900","2000","2100","2200","2300","Random"};
   default = 16;
 };
};



init.sqf:

if isserver then {
 private "_t";
 _t = paramsarray select 0;
 if (_t == 99) then { _t = random 24 };
 skiptime ((_t - daytime + 24) % 24);
};

Edited by kylania

Share this post


Link to post
Share on other sites

This makes it come up with error when trying to test mission in editor (undefined expression in paramsarray) :(

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  

×