Jump to content
Sign in to follow this  
Schatten

Strange error loading control

Recommended Posts

Hi, community!

I receive strange error loading control:

Error loading control C:\Users\Schatten\Arma 3 - Other Profiles\Schatten\mpmissions\TestMission.Altis\description.ext/TestDialog/Controls/FuelCapacity/

Some classes in description.ext

class MyRscSliderValue
{
colorActive[] = {1, 1, 1, 1};
colorBase[] = TEXT_COLOR;
format = "%.f"; // Text format, value is represented by variable %g (float) or %.f (integer)
idc = -1;
type = SPTPlain; // Format, can be SPTPlain or SPTPercents (multiplies the value by 100)
};
class MyRscXSlider
{
arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
blinkingPeriod = 0;
border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
color[] = TEXT_COLOR;
colorActive[] = {1, 1, 1, 1};
colorDisabled[] = TEXT_COLOR;
h = MAIN_FONT_SIZE;
idc = -1;
style = 1024;
thumb = "#(argb,8,8,3)color(1,1,1,1)";
type = 43;

class Value : MyRscSliderValue
{};
};

Controls class in TestDialog.hpp

class SliderValue : MyRscText
{
idc = SLIDER_VALUE_IDC;
style = 2;
w = SLIDER_WIDTH;
x = 0.5 + WIDTH / 2 - WORKSPACE_WIDTH + OFFSET;
y = 0.5 - HEIGHT / 2 + TITLE_HEIGHT + 2 * MAIN_FONT_SIZE + 2 * OFFSET;
};
class FuelCapacity : MyRscXSlider
{
idc = FUEL_CAPACITY_IDC;
w = SLIDER_WIDTH;
x = 0.5 + WIDTH / 2 - WORKSPACE_WIDTH + OFFSET;
y = 0.5 - HEIGHT / 2 + TITLE_HEIGHT + MAIN_FONT_SIZE + OFFSET;

class Value : MyRscSliderValue
{
	format = "%g";
	idc = SLIDER_VALUE_IDC;
};
};

But I do NOT receive error if I delete idc variable in Value class or delete whole Value class in TestDialog.hpp. What the problem?

Edited by Schatten

Share this post


Link to post
Share on other sites

Does it say anything else besides that there is an error with "FuelCapacity"? E.g. is there a line after that error telling a position or line or something?

Where are your #defines which you are using in TestDialog.hpp?

Are all of them actually defined? Check especially if those are defined, which it depends on whether you get an error or not.

Share this post


Link to post
Share on other sites
Does it say anything else besides that there is an error with "FuelCapacity"? E.g. is there a line after that error telling a position or line or something?

Nothing.

Where are your #defines which you are using in TestDialog.hpp?

Are all of them actually defined? Check especially if those are defined' date=' which it depends on whether you get an error or not.[/quote']

definitions.hpp is in same folder with TestDialog.hpp

#define POUR_FUEL_IDD 3002

#define FUEL_CAPACITY_IDC 3003
#define SLIDER_VALUE_IDC 3004

#define SLIDER_WIDTH 0.4

#define WORKSPACE_WIDTH (2 * OFFSET + SLIDER_WIDTH)

#define HEIGHT (TITLE_HEIGHT + 3 * MAIN_FONT_SIZE + 3 * OFFSET)
#define WIDTH (MENU_WIDTH + OFFSET + WORKSPACE_WIDTH)

All constants are defined.

As I said

I do NOT receive error if I delete idc variable in Value class or delete whole Value class in TestDialog.hpp.

Same error appears if I launch "template: ui controls" by Karel Moricky from SteamWorkshop.

Edited by Schatten

Share this post


Link to post
Share on other sites

Can you have an idc for an embedded class?

Wiki says

Embedded child scrollbars are created by the engine as and when required for various control types. (CT_LISTBOX eg). The engine generates it's own idc for them. In most cases you can alter characteristics of that auto-generated scrollbar via class ScrollBar

Share this post


Link to post
Share on other sites

class MyRscSliderValue
{
colorActive[] = {1, 1, 1, 1};
colorBase[] = TEXT_COLOR;
format = "%.f"; // Text format, value is represented by variable %g (float) or %.f (integer)
[color="#FF0000"]idc = -1;[/color]
type = SPTPlain; // Format, can be SPTPlain or SPTPercents (multiplies the value by 100)
};

...

class FuelCapacity : MyRscXSlider
{
idc = FUEL_CAPACITY_IDC;
w = SLIDER_WIDTH;
x = 0.5 + WIDTH / 2 - WORKSPACE_WIDTH + OFFSET;
y = 0.5 - HEIGHT / 2 + TITLE_HEIGHT + MAIN_FONT_SIZE + OFFSET;

class Value : MyRscSliderValue
{
	format = "%g";
	[color="#FF0000"]idc = SLIDER_VALUE_IDC;[/color]
};
};

This is it?

Share this post


Link to post
Share on other sites

class SliderValue : MyRscText
	{
		idc = SLIDER_VALUE_IDC;
		style = 2;
		w = SLIDER_WIDTH;
		x = 0.5 + WIDTH / 2 - WORKSPACE_WIDTH + OFFSET;
		y = 0.5 - HEIGHT / 2 + TITLE_HEIGHT + 2 * MAIN_FONT_SIZE + 2 * OFFSET;
		text = "50.0";
	};
	class FuelCapacity : MyRscXSlider
	{
		idc = FUEL_CAPACITY_IDC;
		w = SLIDER_WIDTH;
		x = 0.5 + WIDTH / 2 - WORKSPACE_WIDTH + OFFSET;
		y = 0.5 - HEIGHT / 2 + TITLE_HEIGHT + MAIN_FONT_SIZE + OFFSET;

		onSliderPosChanged = "ctrlSetText [ 3004, str (floor ((_this select 1)*10) /10) ] ;";

		class Value : MyRscSliderValue
		{
			format = "%g";
			idc = -1;
		};
	};

I broke your whole class down so it was its own container, no inheritence, no defined numbers, added in all missing properties by comparing to vanilla A3 examples from the UI config. Nothing would change the error except replacing the idc with -1. So if you cant live with the error (seems pretty benign only appearing in the RPT) the above is the only other reasonable way to go about it by updating the text via the onSliderChanged EH.

Seems weird how the error points to FuelCapacity yet it seems to be in FuelCapacity/Value. Having any other error in Value, like a missing colorActive, always reports as FuelCapacity/Value being the problem.

Edited by Larrow

Share this post


Link to post
Share on other sites
So if you cant live with the error (seems pretty benign only appearing in the RPT) the above is the only other reasonable way to go about it by updating the text via the onSliderChanged EH.

Probably, I will have to do so. Thanks!

Seems weird how the error points to FuelCapacity yet it seems to be in FuelCapacity/Value. Having any other error in Value, like a missing colorActive, always reports as FuelCapacity/Value being the problem.

Yes, it is very strange error - all works fine but this error appears. And it is unclear why.

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  

×