Jump to content
sabot10.5mm

SOLVED call |#|fn_commitWeather undefined expression in varible

Recommended Posts

i call it from an action on a button ok

action = "call fn_commitWeather;";
call |#|fn_commitWeather undefined expression in varible

i dont understand why i cant get this to work?

 

 

 

 

 

Dialogs.hpp


class nevDebugMenu {
	duration = 99999;
	idd = 80000;
	onLoad = "call fn_onLoad";
	class controls {
	////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by Gary, v1.063, #Goqyvo)
////////////////////////////////////////////////////////

class RscFrameF: RscFrame
{
	idc = 1801;
	text = "Weather Dialog"; //--- ToDo: Localize;
	x = 0.422676 * safezoneW + safezoneX;
	y = 0.346018 * safezoneH + safezoneY;
	w = 0.154647 * safezoneW;
	h = 0.329962 * safezoneH;
};
class RscButtonOK: RscButton
{
	idc = 1600;
	text = "OK"; //--- ToDo: Localize;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.620986 * safezoneH + safezoneY;
	w = 0.056704 * safezoneW;
	h = 0.0329962 * safezoneH;
	action = "call fn_commitWeather;";
	tooltip = "Commit to changes"; //--- ToDo: Localize;
};
class RscButtonCnl: RscButton
{
	idc = 1601;
	text = "Cancel"; //--- ToDo: Localize;
	x = 0.509392 * safezoneW + safezoneX;
	y = 0.622018 * safezoneH + safezoneY;
	w = 0.056704 * safezoneW;
	h = 0.0329962 * safezoneH;
	tooltip = "Cancel to changes"; //--- ToDo: Localize;
};
class RscSliderOst: RscSlider
{
	idc = 1900;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.368015 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change overcast"; //--- ToDo: Localize;
};
class RscSliderLght: RscSlider
{
	idc = 1901;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.401012 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Lightning"; //--- ToDo: Localize;
};
class RscSliderFog: RscSlider
{
	idc = 1902;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.434008 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Fog"; //--- ToDo: Localize;
};
class RscsliderFogD: RscSlider
{
	idc = 1903;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.467004 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Fog Decay"; //--- ToDo: Localize;
};
class RscSliderFogB: RscSlider
{
	idc = 1904;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.5 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Fog Base"; //--- ToDo: Localize;
};
class RscSliderRain: RscSlider
{
	idc = 1905;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.532996 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Rain"; //--- ToDo: Localize;
};
class RscSliderWaves: RscSlider
{
	idc = 1906;
	x = 0.427831 * safezoneW + safezoneX;
	y = 0.565992 * safezoneH + safezoneY;
	w = 0.144337 * safezoneW;
	h = 0.0219974 * safezoneH;
	tooltip = "Change Waves"; //--- ToDo: Localize;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////



	};
};

 

fn_commitWeather

fn_commitWeather = {
	// Overcast
	_overcast = sliderPosition 1900;
	0 setOvercast _overcast;

	// Lightnings
	_lightning = sliderPosition 1901;
	0 setLightnings _lightning;

	// Fog
	_fogValue = sliderPosition 1902;
	_fogDecay = sliderPosition 1903;
	_fogBase = sliderPosition 1904;
	0 setFog [_fogValue, _fogDecay, _fogBase];

	// Rain
	_rain = sliderPosition 1905;
	0 setRain _rain;

	// Waves
	_waves = sliderPosition 1906;
	0 setWaves _waves;

	forceWeatherChange;
}

 

fn_onload

fn_onLoad = {
	_dialog = _this select 0;

	// Overcast slider
	_overcastSlider = _dialog displayCtrl 1900;
	_overcastSlider sliderSetRange [0, 1];
	_overcastSlider sliderSetPosition overcast;

	// Lightnings slider
	_lightningSlider = _dialog displayCtrl 1901;
	_lightningSlider sliderSetRange [0, 1];
	_lightningSlider sliderSetPosition lightnings;

	// Fog value slider
	_fogValueSlider = _dialog displayCtrl 1902;
	_fogValueSlider sliderSetRange [0, 1];
	_fogValueSlider sliderSetPosition (fogParams select 0);

	// Fog decay slider
	_fogDecaySlider = _dialog displayCtrl 1903;
	_fogDecaySlider sliderSetRange [0, 1];
	_fogDecaySlider sliderSetPosition (fogParams select 1);

	// Fog base slider
	_fogBaseSlider = _dialog displayCtrl 1904;
	_fogBaseSlider sliderSetRange [0, 1];
	_fogBaseSlider sliderSetPosition (fogParams select 2);

	// Rain slider
	_rainSlider = _dialog displayCtrl 1905;
	_rainSlider sliderSetRange [0, 1];
	_rainSlider sliderSetPosition rain;

	// Waves slider
	_wavesSlider = _dialog displayCtrl 1906;
	_wavesSlider sliderSetRange [0, 1];
	_wavesSlider sliderSetPosition waves;
}

 

functions.hpp

class gary
{
   tag = "gary";
   class functions
{
	file = "functions";
	class commitWeather {};
        class onload {};
	
	
};
};

 

Share this post


Link to post
Share on other sites
8 hours ago, killzone_kid said:

Where do you define fn_commitWeather?

this was the first time using functions so it took me a while to figure out how to define functions.

inside my functions.hpp

class gary
{
   tag = "gary";
   class functions
{
	file = "functions";
       class commitWeather {    
                preInit = 0; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
                postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
                preStart = 0; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
                ext = ".sqf"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
                headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
                recompile = 0; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already) 
                   };
        class onload {        
                preInit = 0; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
                postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
                preStart = 0; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
                ext = ".sqf"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
                headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
                recompile = 0; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already) 
                     };

	
	
};
};

 

Share this post


Link to post
Share on other sites

Seems broken. Also pasting bits and pieces instead of full cfgfunctions config is not helpful at all. If you ask for help then make sure you provide as much information in your request as possible.

Share this post


Link to post
Share on other sites
3 hours ago, killzone_kid said:

Seems broken. Also pasting bits and pieces instead of full cfgfunctions config is not helpful at all. If you ask for help then make sure you provide as much information in your request as possible.

functions.hpp

class gary
{
   tag = "gary";
   class functions
{
	file = "functions";
       class commitWeather {    
                preInit = 0; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
                postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
                preStart = 0; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
                ext = ".sqf"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
                headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
                recompile = 0; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already) 
                   };
        class onload {        
                preInit = 0; //(formerly known as "forced") 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
                postInit = 1; //1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]
                preStart = 0; //1 to call the function upon game start, before title screen, but after all addons are loaded (config.cpp only)
                ext = ".sqf"; //Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
                headerType = -1; //Set function header type: -1 - no header; 0 - default header; 1 - system header.
                recompile = 0; //1 to recompile the function upon mission start (config.cpp only; functions in description.ext are compiled upon mission start already) 
                     };

	
	
};
};

 

Share this post


Link to post
Share on other sites
9 hours ago, Neviothr said:

You also might want to look at the updated version.

https://github.com/Neviothr/ArmA/tree/master/NEV_Addons/nev_debug_menu

 

is their a way to manipulate skiptime using a slider or is setdate the only way? would this work?

edit yes it works!

fn_onLoad = {
	_dialog = _this select 0;
	// time slider
	_timeSlider = _dialog displayCtrl 1907;
	_timeSlider sliderSetRange [0, 23];
	_timeSlider sliderSetPosition daytime;

};

 

 

fn_commitWeather = {
	// time
	_time = sliderPosition 1907;
	 skipTime _time;

};

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

×