Table of Contents
- Vector
- Vector = vec()
- Vector = vec(Number X)
- Vector = vec(Number X, Number Y, Number Z)
- Vector = vec(Vector2 V2)
- Vector = vec(Vector2 V2, Number Z)
- Vector = vec(Vector4 V4)
- Vector = vec(Angle Ang)
- Vector = randvec()
- Vector = randvec(Number Min, Number Max)
- Vector = randvec(Vector Min, Vector Max)
- Number = Vector:length()
- Number = Vector:length2()
- Number = Vector:distance(Vector Other)
- Number = Vector:distance2(Vector Other)
- Vector = Vector:normalized()
- Number = Vector:dot(Vector Other)
- Vector = Vector:cross(Vector Other)
- Matrix = Vector:outerProduct(Vector Other)
- Vector = Vector:rotateAroundAxis(Vector Axis, Number Degrees)
- Vector = Vector:rotate(Angle Ang)
- Vector = Vector:rotate(Number Pitch, Number Yaw, Number Roll)
- Vector2 = Vector:dehomogenized()
- Vector = positive(Vector Rv1)
- Vector = toRad(Vector Rv1)
- Vector = toDeg(Vector Rv1)
- Vector = clamp(Vector Input, Number Min, Number Max)
- Number = Vector:x()
- Number = Vector:y()
- Number = Vector:z()
- Vector = Vector:setX(Number X)
- Vector = Vector:setY(Number Y)
- Vector = Vector:setZ(Number Z)
- Vector = round(Vector Rv1)
- Vector = round(Vector Rv1, Number Decimals)
- Vector = ceil(Vector Rv1)
- Vector = ceil(Vector Rv1, Number Decimals)
- Vector = floor(Vector Rv1)
- Vector = floor(Vector Rv1, Number Decimals)
- Vector = min(Vector Rv1, Vector Rv2)
- Vector = max(Vector Rv1, Vector Rv2)
- Vector = maxVec(Vector Rv1, Vector Rv2)
- Vector = minVec(Vector Rv1, Vector Rv2)
- Vector = mod(Vector Rv1, Number Rv2)
- Vector = mod(Vector Rv1, Vector Rv2)
- Vector = clamp(Vector Value, Vector Min, Vector Max)
- Vector = mix(Vector Vec1, Vector Vec2, Number Ratio)
- Vector = bezier(Vector Startvec, Vector Control, Vector Endvec, Number Ratio)
- Vector = shiftR(Vector Vec)
- Vector = shiftL(Vector Vec)
- Number = inrange(Vector Vec, Vector Min, Vector Max)
- Angle = Vector:toAngle()
- Angle = Vector:toAngle(Vector Up)
- Number = pointHasContent(Vector Point, String Has)
- String = pointContents(Vector Point)
- Array = pointContentsArray(Vector Point)
- Vector = toWorld(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Angle = toWorldAng(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Array = toWorldPosAng(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Vector = toLocal(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Angle = toLocalAng(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Array = toLocalPosAng(Vector Localpos, Angle Localang, Vector Worldpos, Angle Worldang)
- Number = bearing(Vector Originpos, Angle Originangle, Vector Pos)
- Number = elevation(Vector Originpos, Angle Originangle, Vector Pos)
- Angle = heading(Vector Originpos, Angle Originangle, Vector Pos)
- Number = Vector:isInWorld()
- String = Vector:toString()
- String = toString(Vector V)
Vector
= vec()
Same as vec(0,0,0) (1 ops)
= vec(
X)
Makes a 3D vector (2 ops)
= vec(
X,
Y,
Z)
Makes a 3D vector (2 ops)
= vec(
V2)
Converts a 2D vector into a 3D vector (the z component is set to 0) (2 ops)
= vec(
V2,
Z)
Converts a 2D vector into a 3D vector (the z component is set to the second argument) (2 ops)
= vec(
V4)
Converts a 4D vector into a 3D vector (the w component is dropped) (2 ops)
= vec(
Ang)
Changes an angle variable into a vector variable. PYR become XYZ respectively (2 ops)
= randvec()
Returns a uniformly distributed, random, normalized direction vector (10 ops)
= randvec(
Min,
Max)
Returns a random vector with its components between N1 and N2 (5 ops)
= randvec(
Min,
Max)
Returns a random vector between V1 and V2 (5 ops)
=
:length()
Gets the length of the vector (5 ops)
=
:length2()
Gets the squared length of the vector (5 ops)
=
:distance(
Other)
Gets the distance between vectors (5 ops)
=
:distance2(
Other)
Gets the squared distance between vectors (5 ops)
=
:normalized()
Gets the normalized vector (5 ops)
=
:dot(
Other)
Gets the vector dot (scalar) product (5 ops)
=
:cross(
Other)
Gets the vector cross product (5 ops)
=
:outerProduct(
Other)
Gets the outer product (tensor product) and returns a matrix (tensor) (10 ops)
=
:rotateAroundAxis(
Axis,
Degrees)
Returns the vector V1 rotated around vector V2 by N degrees (15 ops)
=
:rotate(
Ang)
Gets the rotated vector (5 ops)
=
:rotate(
Pitch,
Yaw,
Roll)
Gets the rotated vector (5 ops)
=
:dehomogenized()
Converts a 2D homogeneous vector (x,y,w) into a 2D cartesian vector (5 ops)
= positive(
Rv1)
Returns a vector containing the positive value of each vector component, equivalent to abs(N) (5 ops)
= toRad(
Rv1)
Converts the vector's magnitude from radians to radians (3 ops)
= toDeg(
Rv1)
Converts the vector's magnitude from radians to degrees (3 ops)
= clamp(
Input,
Min,
Max)
Returns a vector in the same direction as vector 1, with length clamped between argument 2(min) and argument 3(max) (5 ops)
=
:x()
Gets the x component of the vector (1 ops)
=
:y()
Gets the y component of the vector (1 ops)
=
:z()
Gets the z component of the vector (1 ops)
=
:setX(
X)
Returns a copy of the vector with X replaced (use as Vec = Vec:setX(...)) (2 ops)
=
:setY(
Y)
Returns a copy of the vector with Y replaced (use as Vec = Vec:setY(...)) (2 ops)
=
:setZ(
Z)
Returns a copy of the vector with Z replaced (use as Vec = Vec:setZ(...)) (2 ops)
= round(
Rv1)
Rounds XYZ to the nearest integer (6 ops)
= round(
Rv1,
Decimals)
Rounds XYZ to argument 2's decimal precision (6 ops)
= ceil(
Rv1)
Rounds XYZ up to the nearest integer (6 ops)
= ceil(
Rv1,
Decimals)
Rounds XYZ up to argument 2's decimal precision (6 ops)
= floor(
Rv1)
Rounds XYZ down to the nearest integer (6 ops)
= floor(
Rv1,
Decimals)
Rounds XYZ down to argument 2's decimal precision (6 ops)
= min(
Rv1,
Rv2)
Returns the vector with the smallest length (10 ops)
= max(
Rv1,
Rv2)
Returns the vector with the greatest length (10 ops)
= maxVec(
Rv1,
Rv2)
Returns the vector combining the highest value components of V1 and V2 (10 ops)
= minVec(
Rv1,
Rv2)
Returns a vector combining the lowest value components of V1 and V2 (10 ops)
= mod(
Rv1,
Rv2)
Returns the remainder after XYZ have been divided by argument 2 (10 ops)
= mod(
Rv1,
Rv2)
Returns the remainder after the components of vector 1 have been divided by the components of vector 2 (10 ops)
= clamp(
Value,
Min,
Max)
Clamps vector 1's XYZ between the XYZ of vector 2(min) and vector 3(max) (10 ops)
= mix(
Vec1,
Vec2,
Ratio)
Combines vector 1's XYZ with vector 2's XYZ by a proportion given by argument 3 (between 0 and 1) (10 ops)
= bezier(
Startvec,
Control,
Endvec,
Ratio)
Returns the 3D vector position on the bezier curve between the starting and ending 3D vector, given by the ratio (value between 0 and 1) (10 ops)
= shiftR(
Vec)
Shifts the vector's components right: shiftR( x,y,z ) = ( z,x,y ) (2 ops)
= shiftL(
Vec)
Shifts the vector's components left: shiftL( x,y,z ) = ( y,z,x ) (2 ops)
= inrange(
Vec,
Min,
Max)
Returns 1 if each component of V is between (or is equal to) the components of Vmin and Vmax (5 ops)
=
:toAngle()
Converts a direction vector into an angle (3 ops)
=
:toAngle(
Up)
Converts a direction vector into an angle with roll being determined by the up vector (3 ops)
= pointHasContent(
Point,
Has)
'S' can be a string containing the last half of the CONTENTS_ enums (ie without the "CONTENTS_"). Multiple CONTENTS types can be seperated by a comma. Check: Enumeration_List:Contents for a full list. Examples: "water,solid" or "empty,transparent". The function returns 1 if any one of the types are found in the vector point (20 ops)
= pointContents(
Point)
Returns a string with all the "content" types in the vector point, seperated by commas (15 ops)
= pointContentsArray(
Point)
Returns an array with all the "content" types in the vector point (15 ops)
= toWorld(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a local position/angle to a world position/angle and returns the position (15 ops)
= toWorldAng(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a local position/angle to a world position/angle and returns the angle (15 ops)
= toWorldPosAng(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a local position/angle to a world position/angle and returns both in an array (15 ops)
= toLocal(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a world position/angle to a local position/angle and returns the position (15 ops)
= toLocalAng(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a world position/angle to a local position/angle and returns the angle (15 ops)
= toLocalPosAng(
Localpos,
Localang,
Worldpos,
Worldang)
Converts a world position/angle to a local position/angle and returns both in an array (15 ops)
= bearing(
Originpos,
Originangle,
Pos)
Gets the bearing from the first position, at the specified angle, to the second position (15 ops)
= elevation(
Originpos,
Originangle,
Pos)
Gets the elevation from the first position, at the specified angle, to the second position (15 ops)
= heading(
Originpos,
Originangle,
Pos)
Gets the elevation and bearing from the first position, at the specified angle, to the second position (15 ops)
=
:isInWorld()
Returns 1 if the position vector is within the world, 0 if not (10 ops)
=
:toString()
Gets the vector nicely formatted as a string "[X,Y,Z]" (5 ops)
= toString(
V)
Gets the vector nicely formatted as a string "[X,Y,Z]" (5 ops)
Expression 2 ⚙️
Getting Started 🕊
- Syntax 🔣
- Directives 🎛️
- Editor 🖥️
- Ops 📊
Guides (In learning order) 🎓
- Learning & Getting Help 📚
- Triggers ⏲️
- Events 🎬
- Find Functions 🔍
- Physics 🚀
- EGP Basics 📈
- Lambdas λ
- Lambda Timers λ⏲️
- Tips & Tricks 📘
Tools 🛠️
Click To Expand
Advanced
- 🟥 SPU
- 🟥 Address Bus
- 🟥 Extended Bus
- 🟥 Plug/Socket
- 🟥 Port
- 🟥 Transfer Bus
- 🟩 GPU
- 🟥 Dynamic Memory
- 🟥 Flash EEPROM
- 🟥 ROM
Beacon 💡
- 🟧 Beacon Sensor
- 🟧 Locator
- 🟧 Target Finder
- 🟧 Waypoint
- 🟥 XYZ Beacon
Control 🎛️
- 🟩 CPU
- 🟩 Expression 2
- 🟩 Gates
- 🟥 PID
Data 💿
- 🟧 CD Disk
- 🟥 CD Ray
- 🟧 DHDD
- 🟥 Keycard
- 🟥 RAM-card
- 🟧 Satellite Dish
- 🟧 Store
- 🟧 Transferer
- 🟥 Wired Wirer
Detection 👀
- 🟧 Adv Entity Marker
- 🟧 Damage Detector
- 🟧 Entity Marker
- 🟧 GPS
- 🟧 Gyroscope
- 🟥 HighSpeed Ranger
- 🟧 Laser Pointer Receiver
- 🟥 Microphone
- 🟧 Ranger
- 🟧 Speedometer
- 🟧 Water Sensor
Display 💻
- 🟧 7 Segment Display
- 🟥 Adv. Hud Indicator
- 🟧 Console Screen
- 🟧 Control Panel
- 🟧 Digital Screen
- 🟧 EGP v3
- 🟧 Fix RenderTargets
- 🟥 GPULib Switcher
- 🟧 Hud Indicator
- 🟧 Indicator
- 🟧 Lamp
- 🟧 Light
- 🟧 Oscilloscope
- 🟧 Pixel
- 🟧 Screen
- 🟧 Sound Emitter
- 🟧 Text Screen
Render 🖌
- 🟩 Cam Controller
- 🟧 Colorer
- 🟧 FX Emitter
- 🟧 HighSpeed Holoemitter
- 🟧 HoloEmitter
- 🟧 HoloGrid
- 🟥 Interactable Holography Emitter
- 🟥 Materializer
- 🟥 Painter
I/O 🔌
- 🟧 Adv. Input
- 🟧 Button
- 🟧 Constant Value
- 🟥 Door Controller
- 🟧 Dual Input
- 🟧 Dynamic Button
- 🟧 Eye Pod
- 🟧 Graphics Tablet
- 🟧 Keyboard
- 🟥 Lever
- 🟧 Numpad
- 🟧 Numpad Input
- 🟧 Numpad Output
- 🟧 Plug
- 🟧 Pod Controller
- 🟧 Radio
- 🟧 Relay
- 🟧 Text Receiver
- 🟧 Two-way Radio
- 🟧 Vehicle Controller
Physics 🚀
- 🟥 Door
- 🟥 Adv. Dupe. Teleporter
- 🟥 Buoyancy
- 🟧 Clutch
- 🟧 Detonator
- 🟧 Explosives
- 🟧 Explosives (Simple)
- 🟥 Forcer
- 🟩 Freezer
- 🟧 Gimbal (Facer)
- 🟧 Grabber
- 🟧 Hoverball
- 🟧 Hoverdrive Controller
- 🟥 Hydraulic
- 🟧 Igniter
- 🟧 Nailer
- 🟩 Prop Spawner
- 🟥 Servo
- 🟥 Simple Servo
- 🟧 Thruster
- 🟥 Touchplate
- 🟥 Trail
- 🟩 Turret
- 🟩 User
- 🟥 Vector Thruster
- 🟥 Vehicle Exit Point
- 🟧 Weight (Adjustable)
- 🟧 Weld/Constraint Latch
- 🟥 Wheel
- 🟥 Wire Magnet
- 🟥 Wired Npc Controller
Utilities 🛠️
- 🟧 Debugger
- 🟥 GUI Wiring
- 🟥 Multi Wire
- 🟧 Namer
- 🟥 Simulate Data
- 🟩 Wiring
RFID 💳
- 🟥 Beam Reader
- 🟥 Implanter
- 🟥 Reader
- 🟥 Target Filter
- 🟥 User Reader
Wireless 🛜
Gates 🚥
Click To Expand
TBD
Extras 🔭
Please do not alter the e2 docs ...
pages manually.
They are autogenerated from the E2Helper. In the future, this will hopefully be its own dedicated website or tool.
Default Extensions
Basic Features: core, debug, number, selfaware,
string, timer
🌎 World: angle, color, find, ranger, sound,
🔣 Math: bitwise, complex, matrix, quaternion, vector, vector2/4
📦 Entities: bone, constraint, egp, entity, hologram, npc
👨 Players: chat, console, player, weapon
📊 Data storage: array, files, globalvars, serialization, table
💬 Communication: datasignal, http, signal, wirelink,
❓ Informational: gametick, serverinfo, steamidconv, unitconv
Additional Extensions
Disabled by default: constraintcore, effects, propcore, remoteupload, wiring
Wire-Extras (repo): camera, ftrace, holoanim, light, stcontrol, tracesystem