CT OBJECT: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<syntaxhighlight lang="cpp">class" to "<syntaxhighlight lang="cpp"> class")
No edit summary
(4 intermediate revisions by 2 users not shown)
Line 6: Line 6:
|value = 80
|value = 80
|description = With this control type it is possible to integrate 3D objects into a dialog. For some more information you may want to look at this blog post by [[User:killzone_kid]]: http://killzonekid.com/arma-scripting-tutorials-gui-part-6/.
|description = With this control type it is possible to integrate 3D objects into a dialog. For some more information you may want to look at this blog post by [[User:killzone_kid]]: http://killzonekid.com/arma-scripting-tutorials-gui-part-6/.
{{Feature|important|The y and z values for the [[vectorDir]] ([[#direction|direction]] array) and [[vectorUp]] ([[#up|up]]) are switched.}}
{{Feature|important|The y and z values for the [[vectorDir]] ([[#direction|direction]] array) and [[vectorUp]] ([[#up|up]]) are switched. <br><br>The control position can be defined with either 'position' property, which is an array or separate 'x', 'y' and 'z' properties, which are floats. If both are used, the former overrides the latter.}}
|gallery=File:Arma3 player profile.jpg{{!}}The head in the shown dialog is an object, though it is unknown how to set the actual face texture or additional objects.
|gallery=File:Arma3 player profile.jpg{{!}}The head in the shown dialog is an object, though it is unknown how to set the actual face texture or additional objects.
|commands =
|commands =
Line 256: Line 256:
|type1=Number
|type1=Number
|value1=0.6
|value1=0.6
|description=x [[Arma_3_GUI_Coordinates|coordinate]] of the object with {{ic|inBack {{=}} 1}}.
|description=x [[Arma_3_GUI_Coordinates|coordinate]] of the object with <syntaxhighlight lang="cpp" inline>inBack = 1</syntaxhighlight>.
}}
}}


Line 264: Line 264:
|type1=Number
|type1=Number
|value1=0.5
|value1=0.5
|description=< [[Arma_3_GUI_Coordinates|coordinate]] of the object with {{ic|inBack {{=}} 1}}.
|description=< [[Arma_3_GUI_Coordinates|coordinate]] of the object with <syntaxhighlight lang="cpp" inline>inBack = 1</syntaxhighlight>.
}}
}}


Line 272: Line 272:
|type1=Number
|type1=Number
|value1=0.2
|value1=0.2
|description=z [[Arma_3_GUI_Coordinates|coordinate]] of the object with {{ic|inBack {{=}} 0}}.
|description=z [[Arma_3_GUI_Coordinates|coordinate]] of the object with <syntaxhighlight lang="cpp" inline>inBack = 0</syntaxhighlight>.
}}
}}


Line 279: Line 279:
|type1=Number
|type1=Number
|value1=0.1
|value1=0.1
|description=z [[Arma_3_GUI_Coordinates|coordinate]] of the object with {{ic|inBack {{=}} 1}}.
|description=z [[Arma_3_GUI_Coordinates|coordinate]] of the object with <syntaxhighlight lang="cpp" inline>inBack = 1</syntaxhighlight>.
}}
}}


Line 312: Line 312:
class objects
class objects
{
{
class Watch/*: RscObject*/
class Watch /* : RscObject */
{
{
access = 0;
access = 0;
Line 373: Line 373:
};
};
};
};
};</syntaxhighlight>
};
</syntaxhighlight>

Revision as of 12:23, 23 January 2023


Introduction

With this control type it is possible to integrate 3D objects into a dialog. For some more information you may want to look at this blog post by User:killzone_kid: http://killzonekid.com/arma-scripting-tutorials-gui-part-6/.

The y and z values for the vectorDir (direction array) and vectorUp (up) are switched.

The control position can be defined with either 'position' property, which is an array or separate 'x', 'y' and 'z' properties, which are floats. If both are used, the former overrides the latter.

Related commands & functions

Related User Interface Eventhandlers

Alphabetical Order

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.
Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with this config crawler.
#define CT_OBJECT 80


B

boneHead

Type
String
Description
n/a
boneHead = "head";


boneLEye

Type
String
Description
n/a
boneLEye = "l_eye";


boneLEyelidDown

Type
String
Description
n/a
boneLEyelidDown = "eye_lwl";


boneLEyelidUp

Type
String
Description
n/a
boneLEyelidUp = "eye_upl";


boneLPupil

Type
String
Description
n/a
boneLPupil = "l_pupila";


boneREye

Type
String
Description
n/a
boneREye = "r_eye";


boneREyelidDown

Type
String
Description
n/a
boneREyelidDown = "eye_lwr";


boneREyelidUp

Type
String
Description
n/a
boneREyelidUp = "eye_upr";


boneRPupil

Type
String
Description
n/a
boneRPupil = "r_pupila";


D

direction

Type
Array
Description
Equivalent of vectorDir with switched y and z values.
direction[] = {1,0,0};


E

enableZoom

Type
Number
Description
Toggle the ability to double click on the object to zoom in or out.
enableZoom = 1;


F

faceType

Type
String
Description
n/a
faceType = "Man_A3";


I

inBack

Type
Number, String
Description
Determines which set of coordinates to use.

Number example:

inBack = 0;

String example:

inBack = "False";


M

model

Type
String
Description
Path to the to be used p3d file.
model = "\A3\ui_f\objects\face_preview";


modelWoman

Type
String
Description
n/a
modelWoman = "\A3\ui_f\objects\face_preview";


P

position

Type
Array
Description
Position of the object relative to [0,0] on the screen.
position[] = {0,0,0.053};


S

scale

Type
Number
Description
Changes the size of the object.
scale = 0.35;


selectionArrow

Type
String
Description
Compass object only.
selectionArrow = "";


selectionDate1

Type
String
Description
Watch object only.
selectionDate1 = "";


selectionDate2

Type
String
Description
Watch object only.
selectionDate2 = "";


selectionEyelid

Type
String
Description
n/a
selectionEyelid = "eyelids";


selectionGlasses

Type
String
Description
n/a
selectionGlasses = "eyelids";


selectionLBrow

Type
String
Description
n/a
selectionLBrow = "lBrow";


selectionLip

Type
String
Description
n/a
selectionLip = "LLip";


selectionLMouth

Type
String
Description
n/a
selectionLMouth = "lMouth";


selectionMBrow

Type
String
Description
n/a
selectionMBrow = "mBrow";


selectionMMouth

Type
String
Description
n/a
selectionMMouth = "mMouth";


selectionPersonality

Type
String
Description
n/a
selectionPersonality = "personality";


selectionRBrow

Type
String
Description
n/a
selectionRBrow = "rBrow";


selectionRMouth

Type
String
Description
n/a
selectionRMouth = "rMouth";


U

up

Type
Array
Description
Equivalent to vectorUp command where y and z values are swapped.
up[] = {0,1,0};


W

waitForLoad

Type
Number
Description
n/a
waitForLoad = 0;


X

xBack

Type
Number
Description
x coordinate of the object with inBack = 1.
xBack = 0.6;


Y

yBack

Type
Number
Description
< coordinate of the object with inBack = 1.
yBack = 0.5;


Z

z

Type
Number
Description
z coordinate of the object with inBack = 0.
z = 0.2;


zBack

Type
Number
Description
z coordinate of the object with inBack = 1.
zBack = 0.1;


zoomDuration

Type
Number
Description
How long the zooming animation takes.
zoomDuration = 1;



Default Classes

Arma 3
AddOns: Classes need to be initialised first with class SomeClass;

Missions: Since Arma 3 v2.02 one can use import SomeClass; to initialise a class (see the import keyword).

In older versions, use "Default" call BIS_fnc_exportGUIBaseClasses; and paste the result into the description.ext.

RscObject

class RscObject
{
	access = 0;
	type = CT_OBJECT;
	scale = 1;
	direction[] = {0,0,1};
	up[] = {0,1,0};
	shadow = 0;
};

Other examples

class MyWatch
{
	idd = -1;
	class objects
	{
		class Watch /* : RscObject */
		{
			access = 0;
			shadow = 0;
			idc = 101;
			type = 80;
			model = "\core\watch\watch.p3d";
			selectionDate1 = "date1";
			selectionDate2 = "date2";
			selectionDay = "day";
			x = 0.7;
			xBack = 0.7;
			y = 0.12;
			yBack = 0.12;
			z = 0.22;
			zBack = 0.22;
			inBack = 0;
			enableZoom = 0;
			direction[] = { 0, 0, 1 };
			up[] = { 0, 1, 0 };
			zoomDuration = 1;
			scale = 0.7;
			waitForLoad = 0;
			class Animations
			{
				class WatchHour
				{
					type = "rotation";
					source = "clockHour";
					selection = "hodinova";
					axis = "osa";
					memory = 1;
					animPeriod = 0;
					angle0 = 0;
					angle1 = "rad 360";
				};
				class WatchMinute
				{
					type = "rotation";
					source = "clockMinute";
					selection = "minutova";
					axis = "osa";
					memory = 1;
					animPeriod = 0;
					angle0 = 0;
					angle1 = "rad 360";
				};
				class WatchSecond
				{
					type = "rotation";
					source = "clockSecond";
					selection = "vterinova";
					axis = "osa";
					memory = 1;
					animPeriod = 0;
					angle0 = 0;
					angle1 = "rad 360";
				};
			};
		};
	};
};