Jump to content
sekh765

Having Weather / Time Parameters in Multiplayer - Debug

Recommended Posts

So I've been trying to follow the various threads on this topic, but I'm not the greatest at figuring out just where I messed up in my script. I am trying to have my players be able to set the mission time / weather parameters before beginning. Could someone take a look and tell me how to repair it? I get weather parameter working, but the time one won't kick in. Then I can get time working, but weather won't kick in.

 

This is the description.ext

class Params
{
  class initialWeatherParam {
          title = "Starting Weather";
          values[] = {0,1,2,3,4};
          texts[] = {"Clear","Overcast","Rain","Fog","Random"};
          default = 4;
       };
  class TimeOfDay {
    title = "Time of Day";
    values[] = {-6, 0, 8, 13};
    texts[] = {"Morning", "Clear day", "Sundown", "Night"};
    default = 0;
  };
};

Here is my init. I think this is where I am lost?

weather = paramsarray select 0;
timeofday = paramsarray select 1;


execVM "briefing.sqf";
execVM "randomWeather2.sqf";

I'm using the RandomWeather2.sqf script from here - http://www.armaholic.com/page.php?id=24614

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

You can use the BIS_fnc_getParamValue function to understand which value is which easier.

weather = "initialWeatherParam" call BIS_fnc_getParamValue;
TimeOfDay = "TimeOfDay" call BIS_fnc_getParamValue;

Which is probably what that script should have done since you need to edit it if your weather isn't the first value...

 

Where do you use the timeofday value?

Share this post


Link to post
Share on other sites

Timeofday is used in the second param, trying to let people set the time for my mission.

 

I set the weather one first, is that not what you are supposed to do for that script? Thought I read it properly.

Share this post


Link to post
Share on other sites
// ============================================================================================
//	Defines
// ============================================================================================

		#define DEBUGCONSOLE_DEFAULT			0
		#define DAYTIMEPERIOD_DEFAULT			12
		#define WEATHER_DEFAULT					25
		#define TIMEACCELERATION_DEFAULT 		1
		#define GUERFRIENDLY_DEFAULT			-1

		#define COUNTDOWN_MIN					600
		#define COUNTDOWN_MAX					3600
		#define COUNTDOWN_DEFAULT				-1

		#define VIEW_DISTANCE_MIN				1500
		#define VIEW_DISTANCE_MAX				4000
		#define VIEW_DISTANCE_DEFAULT			2500

		#define TICKETS_MIN						100
		#define TICKETS_MAX						1100
		#define TICKETS_DEFAULT					-1
		
// ============================================================================================
//	Params
// ============================================================================================


	class Params
	{	
		#include "Params\paramDebugConsole.hpp"
		#include "Params\paramDaytimePeriod.hpp"
		#include "Params\paramWeather.hpp"		
		#include "Params\paramCountdown.hpp"
		#include "Params\paramViewDistance.hpp"
		#include "Params\paramTimeAcceleration.hpp"
		#include "Params\paramRespawnTickets.hpp"
		#include "Params\paramGuerFriendly.hpp"
		
		
		
	};	

Put above code in your description.ext

Create a folder called Params in the mission folder and download the files Ive linked.

Put the downloaded files into the Params folder.

 

https://drive.google.com/open?id=0B7f7inkZ9lkaTTUxNnlFT1ZhMmc

 

 

 

 

and you will end up with something like this:

 

25qfwqr.jpg

Share this post


Link to post
Share on other sites

Timeofday is used in the second param, trying to let people set the time for my mission.

 

I set the weather one first, is that not what you are supposed to do for that script? Thought I read it properly.

 

This does nothing, all it does is set a variable to a value, it doesn't change the date at all:

timeofday = paramsarray select 1;

You would have to then use timeofday to adjust the time using skipTime it seems.

 

The weather one will assign that value itself, so you didn't need to declare it.

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

×