Jump to content
champ-1

CH View Distance Script

Recommended Posts

Okay, Iceman77 a I think, I missused "call". I don't know in which enviroment they are executed, for instance I think you can use sleep, etc. But ArmA is definitely waiting for each postInit function to be terminated which is the point ;-)

Share this post


Link to post
Share on other sites
Okay, Iceman77 a I think, I missused "call". I don't know in which enviroment they are executed, for instance I think you can use sleep, etc. But ArmA is definitely waiting for each postInit function to be terminated which is the point ;-)

postInit is ran in a non-scheduled environment.

postInit:

//--- Call postInit functions
	_fnc_scriptname = "postInit";
	{
		{
			_time = diag_ticktime;
			[_x,_didJIP] call {
				private ["_didJIP","_time"];
				["postInit",_this select 1] call (missionnamespace getvariable (_this select 0))
			};
			["%1 (%2 ms)",_x,(diag_ticktime - _time) * 1000] call bis_fnc_logFormat;
		} foreach _x;
	} foreach _this;

preInit:

//--- Call preInit functions
_fnc_scriptname = "preInit";
{
	{
		_time = diag_ticktime;
		[_x]call {
			private ["_recompile","_functions_list","_functions_listPreInit","_functions_listPostInit","_functions_listRecompile","_time"];
			["preInit"] call (missionnamespace getvariable (_this select 0))
		};
		["%1 (%2 ms)",_x,(diag_ticktime - _time) * 1000] call bis_fnc_logFormat;
	} foreach _x;
} foreach _functions_listPreInit;

postInit is called from a scheduled environment->non scheduled environment which can halt because its originally called from a scheduled->nonscheduled (which breaks the scheduled environment). This code is referenced from a3\functions_f\initFunctions.sqf

preInit is ran from a scheduled environment but if you halt in it you halt the overall client initialization process.

Edited by Tonic-_-

Share this post


Link to post
Share on other sites

CH View Distance Script v0.91

Download

CHVD.jpg

Changelog:

v0.91

- fixed: postInit error

- fixed: minor code fixes

- changed: updated UI style to match default Arma 3 style

- changed: object view distance now can't be set higher than view distance

- changed: "terrain" buttons replaced with listbox (feedback needed on this one)

Edited by Champ-1

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account ( DudeGuyManBro ) on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
I not understand your answer, this is script version, not addon version.

He agreed with the previous poster that he would also like to see an addon version being made. I would like to have this as an addon as well, my PC is pretty weak now, so when I set low draw distance I suffer horribly when I try out aircraft and helicopters.

Share this post


Link to post
Share on other sites

To the author:

Will you make it possible to type in the exact values we want to set our view distance to?

Share this post


Link to post
Share on other sites
To the author:

Will you make it possible to type in the exact values we want to set our view distance to?

Yeah, yeah, that's what I was thinking.

But I don't know how to do it yet. Need to learn how to do it first. :D

Share this post


Link to post
Share on other sites

With an editbox you should be able to grab the inputted text on button click for example.

action = "[ctrlText ((finddisplay YOUR_DIALOG_IDD) displayctrl IDC_EDITBOX)] call CHAMP_fnc_settingChange;";

CHAMP_fnc_settingChange

_value = call compile format ["%1;", _this select 0];

// -- Your stuff

Useful functions aswell:

BIS_fnc_filterString

BIS_fnc_splitString

Edited by Iceman77

Share this post


Link to post
Share on other sites

Thanks.

What exactly 'action' does? When does it trigger?

Share this post


Link to post
Share on other sites

When you press and release a button or active text control for example.

eg;

class MY_BUTTON: RscButton
{
   text = "Confirm"; 
   x = 0.411029 * safezoneW + safezoneX;
   y = 0.598 * safezoneH + safezoneY;
   w = 0.176484 * safezoneW;
   h = 0.042 * safezoneH;
   action = "[ctrlText ((finddisplay YOUR_DIALOG_IDD) displayctrl IDC_EDITBOX)] call CHAMP_fnc_settingChange;"; 
   toolTip = "Validate the inputted text";
};

Edited by Iceman77

Share this post


Link to post
Share on other sites
With an editbox you should be able to grab the inputted text on button click for example.

action = "[ctrlText ((finddisplay YOUR_DIALOG_IDD) displayctrl IDC_EDITBOX)] call CHAMP_fnc_settingChange;";

CHAMP_fnc_settingChange

_value = call compile format ["%1;", _this select 0];

// -- Your stuff

Useful functions aswell:

BIS_fnc_filterString

BIS_fnc_splitString

systemChat str _value;

No output :c

---------- Post added at 17:19 ---------- Previous post was at 17:13 ----------

	class CHVD_rscFootViewDistance: CHVD_rscEdit
	{
		idc = 1006;

		x = 27.5 * GUI_GRID_W + GUI_GRID_X;
		y = 3.5 * GUI_GRID_H + GUI_GRID_Y;
		w = 3 * GUI_GRID_W;
		h = 1 * GUI_GRID_H;
		onKeyDown = "[ctrlText ((finddisplay 2900) displayctrl 1006)] call CHVD_fnc_onEBinput;";
	};

systemChat str (_this select 0);

This works, though.

Share this post


Link to post
Share on other sites

Hmm. Seems to work fine for me using action. I use sideChat. I set up an extra (confirm) button on an existing project that already had a edit box.

http://cloud-4.steampowered.com/ugc/541884859071487189/C7B0EBFF513BD85B706415C6879E7A3CC72C3C74/

DGM_fnc_buttonPressed

_value = call compile format ["%1;", _this select 0];
player sideChat format ["%1", _value];

class DGM_BUTTON_TESTER: RscButton
{
text = "Confirm"; //--- ToDo: Localize;
x = 0.811029 * safezoneW + safezoneX;
y = 0.598 * safezoneH + safezoneY;
w = 0.176484 * safezoneW;
h = 0.042 * safezoneH;
action = "[ctrlText ((finddisplay IDD_DGM_DIALOG) displayctrl IDC_DGM_EDITBOX_CREATEGROUP)] call DGM_fnc_buttonPressed;";
};

Share this post


Link to post
Share on other sites

It doesn't matter. It's the same thing, right?

---------- Post added at 17:31 ---------- Previous post was at 17:28 ----------

Oh so you use button... I was jsut typing stuff. I don't think button is necessary.

Share this post


Link to post
Share on other sites

Yeah. Well I'm not gonna do something different and not mention it.. and have you potentially chasing your tail.

---------- Post added at 06:33 ---------- Previous post was at 06:31 ----------

Yeah. I said "button for example" long ago. You don't have to retrieve the edit box text via button action... I was only providing an visual example of how to retrieve the text from the edit box. Though is changing the VD and such as they type what you want :confused: I'll show myself the door :)

Edited by Iceman77

Share this post


Link to post
Share on other sites

I guess I wasn't paying attention. Anyway, thanks for showing 'BIS_fnc_filterString', that would be handy.

Share this post


Link to post
Share on other sites
I guess I wasn't paying attention. Anyway, thanks for showing 'BIS_fnc_filterString', that would be handy. Also thanks for showing how to retrieve the editbox text Iceman77.

There I fixed it. That wasn't that hard was it?

Ignore me I'm a fucking dick.

Edited by Iceman77

Share this post


Link to post
Share on other sites

CH View Distance Script v0.92

Download

CHVD.jpg

Changelog:

v0.92

- added: interactive textboxes to input view distance and terrain grid values directly

- changed: reworked 'onSliderChange' function

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account ( DudeGuyManBro ) on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Hey, nice work.

A few errors I found:

-Every time I start a game / join our server I have to change a setting so the script takes effect.

-Since this update I get this script Error:

error53dho.jpg

and there is no way to input view distance and terrain grid values directly into interactive textboxes.

error7le7p.jpg

Edited by Gerippe

Share this post


Link to post
Share on other sites
Hey, nice work.

A few errors I found:

-Every time I start a game / join our server I have to change a setting so the script takes effect.

-Since this update I get this script Error:

http://abload.de/img/error53dho.jpg

and there is no way to input view distance and terrain grid values directly into interactive textboxes.

http://abload.de/img/error7le7p.jpg

Doesn't seems like the error even from my script and you using version 0.91. Try to remove CHVD folder completely and redownload it from first post.

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

×