Jump to content
Sign in to follow this  
djfluffwug

Param from Description.ext in Min, Mid and Max of trigger.

Recommended Posts

So, I am trying to create a trigger that gets triggered at a time defined in the mission parameters (The ones the host can select in the mission screen).

I have my mission parameters in description.ext as follows:

class Params
{

class Duration
{
	title = "$STR_mp_param_duration";
	values[] = {600,1200};
	texts[] = {"10 Minutes","20 minutes"};
	default = 1;
};

}

Then in the trigger on the mission, for the Min, Mid and Max I have

paramsArray select 0;

As I am new to scripting for A2, I have no clue what is going on. Any help would be appreciated :)

Share this post


Link to post
Share on other sites

Hi

Only thing I see right now is your default value. It should be 600 or 1200 (one of the values in the values[] array). If you do not set it explicitly, and default value is 1 as in your example, I guess the current paramsArray value will be undefined. And also, the paramsArray is not accessible in SP mode (when you preview from editor). It is only accessible in MP, unless you code for it.

There is a code snippet that enables paramsArray in SP mode. Look at this thread:

http://forums.bistudio.com/showthread.php?90605-F2-paramsArray-Not-guaranteed-to-exist&highlight=set+default+params

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  

×