Jump to content

piggd

Recommended Posts

Description:

    Ever wish you could show a player some data but it is too big to dump to system chat?  Wish you had a handy dialog box to display that data too but your not good at dialog boxes?  Now you can.  I designed texxBoxx because I wanted to display all the objects around my players plot poles and did not have a good medium to display them in.   i also wanted a way to display my server list, rules, mods and admin lists.  I am not just starting to write my in game help system code and using textBoxx to display the information.

 

Mod Features:

 

Display 50 character wide, 100 character wide and 150 character wide text boxes from an array of text,

Re useable and not application specific.

Easy to configure new windows using the templates each addon you want to use it with,

 

 

texxBoxx50

texxBox50_zps944ffc9f.jpg

 

textBoxx100

textBoxx100_zps71db3812.jpg

 

textBoxx150

textBoxx100_zps71db3812.jpg

 

textBoxx Demo Script

textBoxDemoScript_zps16948075.jpg

 

 

Known Issues:

textBoxx was designed for resolutions 1300x#### and above.  Some of the boxes will consume the whole screen on the lower resolutions.

 

Installation:

 

1.  Download from my textBoxx GitHub  (Contains a vanilla epoch chernarus mission.pbo example file).

2.  Create a directory called mission_pbo

3   Take your mission.pbo file and extract it into the mission_pbo directory

4.  Unzip the zip file you download from my github and move the custom directory into your mission_pbo directory.

5.  Edit your init.sqf file and make the following modifications:

 

from:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)

to:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
//------------------------------------------------------------------------ TextBoxx Start ---------------------------------------------------------------------------------
    call compile preprocessFileLineNumbers "custom\textBoxx\textBoxx_init.sqf";    
//------------------------------------------------------------------------ TextBoxx End -----------------------------------------------------------------------------------

6. Edit description.ext add the following lines to the end of the file.

//------------------------------------------------------------------------ TxtBoxx Start ---------------------------------------------------------------------------------
// Uses the same common as Chameleon leave comment out the line below if using Chameleon common.hpp
#include "custom\textBoxx\dialog\common.hpp"
#include "custom\textBoxx\dialog\textBoxxGui.hpp"
//------------------------------------------------------------------------ TxtBoxx End -----------------------------------------------------------------------------------

** NOTE if using only one common.hpp needs to be used.  Comment out the 2nd one by placing a // in front of the include.  They share the same common file.

 

Configuration:
 

Displaying Static Data:

 

1)  Create a directory in custom\textBoxx that is meaningful

 

for example if I was creating a file to display information about my server such as an admin list ,  I would create a directory called custom\textBoxx\serverInfo

 

2)  copy custom\textBoxx\template\template_textBoxx50_dialog.sqf to custom\textBoxx\serverInfo\admin_list_dialog.sqf

 

3) edit the file to look something like this:  Remember to change the title and replace the example lines with your own array of text leaving the comma off the last element.

/*
textBoxx by piggd
Email: [email protected]
Website: http://dayzpiggd.enjin.com
Donations Accepted via paypal to [email protected]
*/
//TextBoxxTitle = "1234567890ABCDEFGHIJ1234567890ABCDEFGHIJ1234567";
private ["_textBoxxSaveLine"];
_textBoxxSaveLine = " ";
TextBoxxTitle = "Piggd Admin List";
textBoxx_TEXT_LIST = [
"Big Green - Cmdr. Hall",
"Commander Dark - DUKE",
"Dutch5o- Euro",
"Father McGruder - Fixxer",
"iSaeko - Jane Doe",
"jumpshot - Kevin",
"Knightsofra1 - Laura",
"Lithh - Lorgar",
"Mack Bolan - Master_Yoda",
"Meat Shield - piggd",
"Pvt Beans - Raven",
"Shadowlee - Spike Spiegel",
"Warmonkey"
];
textBoxx_TEXT_LIST set [(count textBoxx_TEXT_LIST),_textBoxxSaveLine];
createDialog "DisplaytextBoxx50";

4)  Then in your self action or a menu program you might have a block of code that looks something like this:

    if( _canDo) then {
        if (s_player_display_admnin_list < 0) then {
            s_player_display_admnin_list = player addaction [("<t color=""#0074E8"">" + ("Display Admin List") +"</t>"),"custom\textBoxx\serverInfo\admin_list_dialog.sqf","",1,false,true,"",""];
        };
    } else {
        player removeAction s_player_display_admnin_list;
        s_player_display_admnin_list = -1;
    };

Displaying Dynamic Data From a script/addon:

 

1)  Create a directory in custom\textBoxx that is meaningful ( I would use the addon name or script function name)

 

for example if I was creating a script to display all the objects around a player in a 100m radius ,  I would create a directory called custom\textBoxx\objects

 

2)  copy custom\textBoxx\template\example_with _script_call_dialog.sqf to custom\textBoxx\objects\display_objects_100m_dialog.sqf

 

3) edit the file to look something like this:  You need to change the custom\textBoxx\template\example_script.sqf with the name of the script you want to execute display_objects_100m.sqf for this example.

You would also need to change DisplaytextBoxx100  to the size you want DisplaytextBoxx50, DisplaytextBoxx100, or DisplaytextBoxx150 .  It set to 100 for the example.

/*
textBoxx by piggd
Email: [email protected]
Website: http://dayzpiggd.enjin.com
Donations Accepted via paypal to [email protected]
*/
private ["_textBoxxSaveLine","_handle"];
_textBoxxSaveLine = " ";
TextBoxxTitle = "Show All Objects 100m from the Character";
textBoxx_TEXT_LIST = [];
//_handle = player execVM "custom\textBoxx\template\example_script.sqf";
_handle = player execVM "custom\textBoxx\objects\display_objects_100m.sqf";
waitUntil {scriptDone _handle};

textBoxx_TEXT_LIST set [(count textBoxx_TEXT_LIST),_textBoxxSaveLine];
createDialog "DisplaytextBoxx100";

4) Create your script or modify your addon:

In your script you want to initialize the variable textBoxx_TEXT_LIST = []; to make sure that it is empty.

Then you need to format your text data and insert it into your array as I have done in the example with these two lines.

 

    _textBoxxSaveLine = format["Object %1 - %2 is with in a 100m radius from %3.",_indx, _x, dayz_playerName];
    textBoxx_TEXT_LIST set [(count textBoxx_TEXT_LIST),_textBoxxSaveLine];

/*
textBoxx by piggd
Email: [email protected]
Website: http://dayzpiggd.enjin.com
Donations Accepted via paypal to [email protected]
*/
private ["_tmpList","_indx","_textBoxxSaveLine"];
// Make sure the player UID has been converted before moving forward.
_tmpList = [];
// Empties the DialogBox list since it is a global variable.
textBoxx_TEXT_LIST = [];
_indx = 0;
//Gets all the objects wih in a 100m of the player
_tmpList = (getPosATL player ) nearObjects ["All",100];
{
// These two line load the global array with the text that will be displayed when the script exits excution when called from the dialog program.
    _indx = _indx + 1;
    _textBoxxSaveLine = format["Object %1 - %2 is with in a 100m radius from %3.",_indx, _x, dayz_playerName];
    textBoxx_TEXT_LIST set [(count textBoxx_TEXT_LIST),_textBoxxSaveLine];
} count _tmpList;

Email: [email protected]
Website: Piggd Dayz Gaming
Donate to piggd

Link to comment
Share on other sites

Nice idea mate, I am sure I will find something to use this for.

I have not done very much work with dialog's in Arma, but I am fairly sure that if you make use of the safezoneW, safezoneX, safezoneH and safezoneY variables, you should be able to make this fit all resolutions.

 

Link to comment
Share on other sites

Hey great idea! I really want to add this but having a problem. I can not get the menu to appear at all.

Is there a certain place in fn_selfactions.sqf that the code needs to go? In the middle? After a certain other line? At the bottom? I have tried it at the bottom above and below the closing bracket, near the top right under another addon's custom selfaction code and just randomly throughout the selfactions.sqf and no matter what, when I scroll the mousewheel, I get no option for anything other than changing weapon.

Let's say I did something else wrong with this script, I should at least get the "Display Admin List" text when I scroll my mouse correct? I mean as long as the following is in the fn_selfactions I should at least get the scroll menu right?:

    if( _canDo) then {
        if (s_player_display_admnin_list < 0) then {
            s_player_display_admnin_list = player addAction [("<t color="#0074E8"">" + ("Display Admin List") +"</t>"),"custom\textBoxx\info\test.sqf","",1,false,true,"","];
        };
    } else {
        player removeAction s_player_display_admnin_list;
        s_player_display_admnin_list = -1;
    };

 

One thing I did notice is that in the instructions for adding to fn_selfactions.sqf you have a lower case a on addaction in this line: s_player_display_admnin_list = player addaction

I noticed that all the rest of the addaction commands in fn_selfactions have a capital A in addAction. Not sure if that makes a difference but I have tried with a capital and without and still can't get the menu to appear.

Any ideas what I'm doing wrong or a specific place the code should go?

Thanks in advance and keep up the great work!

 

EDIT:

Went ahead and gave up on scroll option and just added to right click options & it works great. Would still like to make at least 1 menu as a scroll option so if someone could help with that, would be awesome.

 

I have another question though. Would it be possible to make it so the scroll or right click option only shows up in a certain area such as a trader zone? The idea behind this question is this: I have custom skinned fully upgraded suv's at Hero & Bandit trader and would love to be able to have something that gives a description on the skin since OtterNas3's VASP (Vehicle and skin preview) mod I'm using does not work with custom skins.

 

Something like this:

SUV_Camo_DZE4 = Desert camo skin

SUV_Blue_DZE4 = Weed Leaf camo

SUV_Red_DZE4 = Red & Black checkered

etc...

 

Is this something that would be possible?

 

Thanks again

Link to comment
Share on other sites

So I finally got the menu to show up on scroll wheel however, it will only appear when near an inventory item. In other words, it will only appears when looking at a body, looking at an item on the ground, looking at a vehicle or at a trader.  Have tried adding (!IsNull Cursortarget) && (speed player <=0) and still can only get the menu option to appear when looking at something. Anyone know how to make the menu appear when not looking at something?

Link to comment
Share on other sites

  • 2 months later...

So this don't seem to work for me. Anyone have any idea what this means? I tried with and without using the Common file and still get the same error. I have running DZGM, SC, Custom GUI, Plot Managment I'm just listing addons that require the same kind of method

ErrorMessage: File mpmissions\__cur_mp.chernarus\Scripts\TextB\dialog\textBoxxGui.hpp, line 24: Config: 'C' encountered instead of '{'

textboxxGui line 24 is this part

 

class DisplaytextBoxx50 {
	idd = TEXTBOXX50_DIALOG ;
	movingEnable = true;
	enableSimulation = true;
	onLoad = "[] execVM 'Scripts\TextB\list_textBoxx50.sqf'"; <<<-------- Here is the only part I changed

	__EXEC( _xSpacing = 0.0075;  _ySpacing = 0.01;)
	__EXEC( _xInit = 12 * _xSpacing; _yInit = 18 * _ySpacing;)
	__EXEC( _windowWidth = 202; _windowHeight = 128;)
	__EXEC( _windowBorder = 1;)

	class controlsBackground {
		class Mainbackgrnd : HW_RscPicture {
			moving = true;
			idc = TEXTBOXX50_BCKGRND;
			x = 0.22; y =  -0.285;
			w = 0.94; h = 1.50;
			text = "\ca\ui\data\ui_background_controlers_ca.paa";
		};
		class RecruitUnitsTitle : HW_RscText {
		   	idc = TEXTBOXX50_TITLE;
			x = 0.255; y =  -0.200;
			w = __EVAL(80 * _xSpacing);
			h = __EVAL(3 * _ySpacing);
			colorText[] = Color_White;
			colorBackground[] = { 1, 1, 1, 0 };
			sizeEx = 0.04;
			text = "";
		};
	};

	class controls {
		class Unitlist: HW_RscGUIListBox {
			idc = TEXTBOXX50_UNITLIST;
			default = 1;
			x = 0.230; y =  -0.110;
			w = 0.675; h = 1.10;
			//lineSpacing = 0;
			colorSelect[] = {0, 0, 0, 0.9};
			colorSelect2[] = {0, 0, 0, 0.9};
			colorSelectBackground[] = {1, 1, 1, 0.3};
			colorSelectBackground2[] = {1, 1, 1, 0.9};
			onLBSelChanged = "";
			onLBDblClick = "";
			rowHeight = 0.025;
			soundSelect[] = {"\ca\ui\data\sound\mouse2", 0.09, 1};
			maxHistoryDelay = 10;
			canDrag = 0;
			xcolumn1 = "0.1f";
			xcolumn2 = "0.25f";
			xcolumn3 = "0.85f";		
		};
		class RecruitButton: HW_RscGUIShortcutButton {
			x = 0.448; y = 1.08;
			w = 0.225; h = 0.06;
			text = "Close Recipe";  <<<-------- Here is the only part I changed
			onButtonClick = "closeDialog 0";
		};
	};
};

 

 

EDIT: Ok got this working after a few trial and errors. If anyone needs a hand just give me a shout

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...