Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Silderoy

MP Parameters

Recommended Posts

So, I got a DM type mission, and I want to make a score limit and a time limit.

about the score limit, how do I even start? I mean, it should be automatic or I need to add something spesific to init.sqf/ingame?

and time limit, I can use ForceEnd with a countdown, but is there a defult way? any way to make it finish the round by the time limit you choose?

my parameters in description.ext:

class Params
{
class Score
{
	title = "$STR_mp_param_score";
	values[] = {99999, 10, 30, 50, 100};
	texts[] = {"Unlimited", "10", "30", "50", "100"};
	default = 30;
};
class Duration
{
	title = "$STR_mp_param_duration";
	values[] = {0, 600, 1800, 3600};
	texts[] = {"Unlimited", "10 Minutes", "30 Minutes", "1 Hour"};
	default = 0;
};
class TimeOfDay
{
	title = "Time of Day";
	values[] = {0,15};
	texts[] = {"Day","Night"};
	default = 0;
};
};

I did anything I need with the Time of day, need nothing about this one. only score and time limit.

Thanks,

Silderoy

Edited by Silderoy

Share this post


Link to post
Share on other sites

no one can help me out?

Many people use parameters in their missions, can someon explain me how to use those?

Share this post


Link to post
Share on other sites

Hi Silderoy,

maybe i have a solution for you time limit problem.

My description.ext

titleParam1 = "Time limit:";

valuesParam1[] = {0, 300, 600, 900};

textsParam1[] = {"Unlimited", "5 min", "10 min", "15 min"};

defValueParam1 = 900;

My init.sqf

estimatedtimeleft param1;

And my ingame trigger

end_trigger.JPG

Share this post


Link to post
Share on other sites

The idea here is to define a class name that can be used within the scripts with the following terminology...

ClassName = ParamsArray Select 0;

Select 0 is obviously the order in which you have placed your parameters. SO Score will be select 0, Duration will be select 1, and so on.

Score = ParamsArray Select 0;

Duration = ParamsArray Select 1;

--------------------------

Anyway... to use the below might help

Inside your Description file

don't use the word Score

class MPScore
{
	title = "$STR_mp_param_score";
	values[] = {99999, 10, 30, 50, 100};
	texts[] = {"Unlimited", "10", "30", "50", "100"};
	default = 30;
               code = "";
};

now to use your score limit simply in any sqf file

An example would be to use it as follows...

MPScore= ParamsArray Select 0;
_number = scoreSide west; 
if (_number >= MPScore) then 
{

endMission "END1";

} else

{
_total = MPScore  - _number;
hint format ["Score Left before end: %1", _total];
};


hope that helps

Edited by Mikie boy

Share this post


Link to post
Share on other sites

Mikie, what is the different between my description without class name and your descirption with class name?

i tried my 2 scripts with class names but it doesnt work and i dont saw the parameter button in the lobby.

Share this post


Link to post
Share on other sites

not sure what you mean - without class names - the set up shown in my example should work

Share this post


Link to post
Share on other sites
Sign in to follow this  

×