Jump to content
Sign in to follow this  
Solarcode red

Is it possible to make a time and weather changer ingame that the player can have access to?

Recommended Posts

I'm making a training based scenario and I'd like the player to be able to set up different time and weather options. I already have a skip time trigger as It's part of the mission but I want something for the player. My ideal scenario is where I can link it to and object like a laptop and the menu is controlled similar to the way it is in the editor. I'm not sure if this is possible or not but I'd appreciate any and all help thank you.

Share this post


Link to post
Share on other sites

Hi @Solarcode red; welcome to the forums!

What you describe has been exactly implemented by the following, excellently made mission, by none other than our beloved @Lou Montana:

However, if you wish to create your own, a simplistic way would be-

Place a laptop object. Paste the following code into its init box:

this addAction
[
	"Set weather clear skies",	// title
	{
	0 setOvercast 0;
	forceWeatherChange; // script
	},
	true,		// showWindow
	false,		// hideOnUse
	"true", 	// condition
	3,			// radius
	false,		// unconscious
	"",			// selection
	""			// memoryPoint
]; 


this addAction
[
	"Set weather overcast",	// title
	{
	0 setOvercast 0.5;
	forceWeatherChange; // script
	},
	true,		// showWindow
	false,		// hideOnUse
	"true", 	// condition
	3,			// radius
	false,		// unconscious
	"",			// selection
	""			// memoryPoint
]; 

this addAction
[
	"Set weather storm",	// title
	{
	0 setOvercast 1;
	forceWeatherChange; // script
	},
	true,		// showWindow
	false,		// hideOnUse
	"true", 	// condition
	3,			// radius
	false,		// unconscious
	"",			// selection
	""			// memoryPoint
]; 


Hopefully this will give you an idea how it works. Assuming I have not mistyped anything on my phone :float:. Note: this method has multiple bugs. Changing weather may cause stuttering in multiplayer. Players joining mid-mission (JIP) may find duplicate actions in their menu. And others. But it works fine for a quick mission with friends.


 

  • Like 2

Share this post


Link to post
Share on other sites

@Solarcode red I removed the comments (init fields don't like those) and removed the optional arguments. Here ya go:

this addAction 
[ 
 "Set weather clear skies", 
 { 
 0 setOvercast 0;  
 forceWeatherChange;  
 } 
];

this addAction 
[ 
 "Set weather overcast", 
 { 
 0 setOvercast 0.6;  
 forceWeatherChange;  
 } 
];

this addAction 
[ 
 "Set weather stormy", 
 { 
 0 setOvercast 1;  
 forceWeatherChange;
 0 setRain 1;
 } 
];

 

  • Like 2

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  

×