Jump to content

Recommended Posts

Hi Guys,

Im currently stuck because of "knowledge.hpp" not found and i hope u can help me out 🙂

I wrote a little script to allow players to adjust the animationSpeedCoef while beeing in stand/crouch combat stance via mouse wheel to make movement in cqc bit more variable (inspired by Escape from Tarkov "incremential" movement)

 

To give the player visual feedback about the current movement speed i wanted to add a GUI element/progressBar beneath the stance indicator. The idea was to add another ctrl to RscStanceInfo hoping that the ctrl will be initialized/loaded/unloaded/shown "automatically" along the stance indicator ui.

This is what i wrote in my mods config.cpp (for testing just a textbox instead progressBar) :


class RscText;
class RscIngameUI {
	class RscStanceInfo {
		idd = 303;
		scriptName = "RscStanceInfo";
		scriptPath = IGUI;
		onLoad = "[""onLoad"",_this,""RscStanceInfo"",'IGUI'] call 	(uinamespace getvariable 'BIS_fnc_initDisplay')";
		onUnload = "[""onUnload"",_this,""RscStanceInfo"",'IGUI'] call 	(uinamespace getvariable 'BIS_fnc_initDisplay')";
		controls[] = {"StanceIndicatorBackground", "StanceIndicator","StanceProgressbar"};
		class StanceProgressbar : RscText {
		
			idc = 6128;
			access = 1;
			type = 0;
			style = 2;
			x = (profilenamespace getvariable ["IGUI_GRID_STANCE_X", ( (safezoneX + safezoneW) - (3.7 * ( ( (safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * ( ( (safezoneW / safezoneH) min 1.2) / 40))]);
			y = (profilenamespace getvariable ["IGUI_GRID_STAMINA_Y", (safezoneY + 4.05 * ( ( ( (safezoneW / safezoneH) min 1.2) / 1.2) / 25))]);
			w = (3.7 * ( ( (safezoneW / safezoneH) min 1.2) / 40));
			h = (0.27 * ( ( ( (safezoneW / safezoneH) min 1.2) / 1.2) / 25));
			text = "-WORK IN PROGRESS-";
			font = "PuristaBold";
			colorBackground[] = {1,1,1,1};
			colorText[] = {1,1,1,1};
			sizeEx = (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 3);
		};
	};
};

When testing in editor i can see my added class "StanceProgressbar" as subclass of "RscStanceInfo" in config viewer, but when trying to find the ctrl ingame to adjust the progressBar via script with

_ctrl = ((uiNamespace getVariable "RscStanceInfo") displayCtrl 6128);

returns "no Control". The other subclasses of "RscStanceInfo" are accessible with idc 1201 & 188. 

I guess i have to initialize/load my custom ctrl "manually" somehow, but i have absolutely no idea how 😂😭

 

Any help appreciated 🤗

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  

×