Table of Contents
- Vector2
- Vector2 = vec2()
- Vector2 = vec2(Number, Number)
- Vector2 = vec2(Number)
- Vector2 = vec2(Vector)
- Vector2 = vec2(Vector4)
- Number = Vector2:length()
- Number = Vector2:length2()
- Number = Vector2:distance(Vector2)
- Number = Vector2:distance2(Vector2)
- Vector2 = Vector2:normalized()
- Number = Vector2:dot(Vector2)
- Number = Vector2:cross(Vector2)
- Matrix4 = Vector2:outerProduct(Vector2)
- Vector2 = Vector2:rotate(Number)
- Vector2 = positive(Vector2)
- Vector2 = toRad(Vector2 Xv2)
- Vector2 = toDeg(Vector2 Xv2)
- Vector2 = clamp(Vector2 Input, Number Min, Number Max)
- Number = Vector2:x()
- Number = Vector2:y()
- Vector2 = Vector2:setX(Number)
- Vector2 = Vector2:setY(Number)
- Vector2 = round(Vector2 Rv1)
- Vector2 = round(Vector2 Rv1, Number Decimals)
- Vector2 = ceil(Vector2 Rv1)
- Vector2 = ceil(Vector2 Rv1, Number Decimals)
- Vector2 = floor(Vector2 Rv1)
- Vector2 = floor(Vector2 Rv1, Number Decimals)
- Vector2 = min(Vector2, Vector2)
- Vector2 = max(Vector2, Vector2)
- Vector2 = maxVec(Vector2, Vector2)
- Vector2 = minVec(Vector2, Vector2)
- Vector2 = mod(Vector2, Number)
- Vector2 = mod(Vector2, Vector2)
- Vector2 = clamp(Vector2, Vector2, Vector2)
- Vector2 = mix(Vector2, Vector2, Number)
- Vector2 = bezier(Vector2 Startvec, Vector2 Control, Vector2 Endvec, Number Ratio)
- Vector2 = shift(Vector2)
- Number = inrange(Vector2, Vector2, Vector2)
- Number = Vector2:toAngle()
- String = toString(Vector2 V)
- String = Vector2:toString()
- Vector2 = randvec2()
- Vector2 = randvec2(Number Min, Number Max)
- Vector2 = randvec2(Vector2 Min, Vector2 Max)
- Vector4 = vec4()
- Vector4 = vec4(Number)
- Vector4 = vec4(Number, Number, Number, Number)
- Vector4 = vec4(Vector2)
- Vector4 = vec4(Vector2, Number, Number)
- Vector4 = vec4(Vector2, Vector2)
- Vector4 = vec4(Vector)
- Vector4 = vec4(Vector, Number)
- Number = Vector4:length()
- Number = Vector4:length2()
- Number = Vector4:distance(Vector4)
- Number = Vector4:distance2(Vector4)
- Number = Vector4:dot(Vector4)
- Matrix4 = Vector4:outerProduct(Vector4)
- Vector4 = Vector4:normalized()
- Vector = Vector4:dehomogenized()
- Vector4 = positive(Vector4)
- Number = Vector4:x()
- Number = Vector4:y()
- Number = Vector4:z()
- Number = Vector4:w()
- Vector4 = Vector4:setX(Number)
- Vector4 = Vector4:setY(Number)
- Vector4 = Vector4:setZ(Number)
- Vector4 = Vector4:setW(Number)
- Vector4 = round(Vector4 Rv1)
- Vector4 = round(Vector4 Rv1, Number Decimals)
- Vector4 = ceil(Vector4 Rv1)
- Vector4 = ceil(Vector4 Rv1, Number Decimals)
- Vector4 = floor(Vector4 Rv1)
- Vector4 = floor(Vector4 Rv1, Number Decimals)
- Vector4 = min(Vector4, Vector4)
- Vector4 = max(Vector4, Vector4)
- Vector4 = maxVec(Vector4, Vector4)
- Vector4 = minVec(Vector4, Vector4)
- Vector4 = mod(Vector4, Number)
- Vector4 = mod(Vector4, Vector4)
- Vector4 = clamp(Vector4, Vector4, Vector4)
- Vector4 = clamp(Vector4 Input, Number Min, Number Max)
- Vector4 = mix(Vector4, Vector4, Number)
- Vector4 = shiftR(Vector4)
- Vector4 = shiftL(Vector4)
- Number = inrange(Vector4, Vector4, Vector4)
- Vector4 = toRad(Vector4 Xv4)
- Vector4 = toDeg(Vector4 Xv4)
- Vector4 = randvec4()
- Vector4 = randvec4(Number Min, Number Max)
- Vector4 = randvec4(Vector4 Min, Vector4 Max)
- String = Vector4:toString()
- String = toString(Vector4 V)
Vector2
= vec2()
Same as vec2(0,0) (1 ops)
= vec2(
,
)
Makes a 2D vector (2 ops)
= vec2(
)
Makes a 2D vector (2 ops)
= vec2(
)
Converts a 3D vector into a 2D vector (the z component is dropped) (2 ops)
= vec2(
)
Converts a 4D vector into a 2D vector (the z and w components are dropped) (2 ops)
=
:length()
Gets the length of the vector (3 ops)
=
:length2()
Gets the squared length of the vector (3 ops)
=
:distance(
)
Gets the distance between 2D vectors (3 ops)
=
:distance2(
)
Gets the squared distance between 2D vectors (3 ops)
=
:normalized()
Gets the normalized vector (3 ops)
=
:dot(
)
Gets the 2D vector dot (scalar) product (3 ops)
=
:cross(
)
Gets the 2D vector cross product/wedge product (3 ops)
=
:outerProduct(
)
Gets the outer product (tensor product) and returns a matrix (tensor) (3 ops)
=
:rotate(
)
Rotates a vector by the argument (given in degrees) (3 ops)
= positive(
)
Returns a vector containing the positive value of each vector component, equivalent to abs(N) (3 ops)
= toRad(
Xv2)
Converts the vector's magnitude from radians to radians (2 ops)
= toDeg(
Xv2)
Converts the vector's magnitude from radians to degrees (2 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) (3 ops)
=
:x()
Gets the x component of the vector (1 ops)
=
:y()
Gets the y component of the vector (1 ops)
=
:setX(
)
Returns a copy of the 2D vector with X replaced (use as Vec2 = Vec2:setX(...)) (1 ops)
=
:setY(
)
Returns a copy of the 2D vector with Y replaced (use as Vec2 = Vec2:setY(...)) (1 ops)
= round(
Rv1)
Rounds XY to the nearest integer (4 ops)
= round(
Rv1,
Decimals)
Rounds XY to argument 2's decimal precision (4 ops)
= ceil(
Rv1)
Rounds XY up to the nearest integer (4 ops)
= ceil(
Rv1,
Decimals)
Rounds XY up to argument 2's decimal precision (4 ops)
= floor(
Rv1)
Rounds XY down to the nearest integer (4 ops)
= floor(
Rv1,
Decimals)
Rounds XY down to argument 2's decimal precision (4 ops)
= min(
,
)
Returns the vector with the smallest length (4 ops)
= max(
,
)
Returns the vector with the greatest length (4 ops)
= maxVec(
,
)
Returns the vector combining the highest value components of V1 and V2 (4 ops)
= minVec(
,
)
Returns a vector combining the lowest value components of V1 and V2 (4 ops)
= mod(
,
)
Returns the remainder after XY have been divided by argument 2 (4 ops)
= mod(
,
)
Returns the remainder after the components of vector 1 have been divided by the components of vector 2 (4 ops)
= clamp(
,
,
)
Clamps vector 1's XY between the XY of vector 2(min) and vector 3(max) (4 ops)
= mix(
,
,
)
Combines vector 1's XY with vector 2's XY by a proportion given by argument 3 (between 0 and 1) (4 ops)
= bezier(
Startvec,
Control,
Endvec,
Ratio)
Returns the 2D position on the bezier curve between the starting and ending 2D vector, given by the ratio (value between 0 and 1) (4 ops)
= shift(
)
Swaps the vector's x,y components (2 ops)
= inrange(
,
,
)
Returns 1 if each component of V is between (or is equal to) the components of Vmin and Vmax (2 ops)
=
:toAngle()
Returns the 2D angle of the vector (given in degrees, -180 to 180) (2 ops)
= toString(
V)
Gets the vector nicely formatted as a string "[X,Y]" (5 ops)
=
:toString()
Gets the vector nicely formatted as a string "[X,Y]" (5 ops)
= randvec2()
Returns a uniformly distributed, random, normalized direction vector (5 ops)
= randvec2(
Min,
Max)
Returns a random vector with its components between N1 and N2 (5 ops)
= randvec2(
Min,
Max)
Returns a random vector between V1 and V2 (5 ops)
= vec4()
Same as vec4(0,0,0,0) (1 ops)
= vec4(
)
Makes a 4D vector (4 ops)
= vec4(
,
,
,
)
Makes a 4D vector (4 ops)
= vec4(
)
Converts a 2D vector into a 4D vector (the z and w components are set to 0) (4 ops)
= vec4(
,
,
)
Converts a 2D vector into a 4D vector (the z and w components are set to the second and third arguments) (4 ops)
= vec4(
,
)
Creates a 4D vector from two 2D vectors (4 ops)
= vec4(
)
Converts a 3D vector into a 4D vector (the w component is set to 0) (4 ops)
= vec4(
,
)
Converts a 3D vector into a 4D vector (the w component is set to the second argument) (4 ops)
=
:length()
Gets the length of the vector (7 ops)
=
:length2()
Gets the squared length of the vector (7 ops)
=
:distance(
)
Gets the distance between 4D vectors (7 ops)
=
:distance2(
)
Gets the squared distance between 4D vectors (7 ops)
=
:dot(
)
Gets the 4D vector dot (scalar) product (7 ops)
=
:outerProduct(
)
Gets the outer product (tensor product) and returns a matrix (tensor) (15 ops)
=
:normalized()
Gets the normalized vector (7 ops)
=
:dehomogenized()
Converts a 3D homogeneous vector (x,y,z,w) into a 3D cartesian vector (3 ops)
= positive(
)
Returns a vector containing the positive value of each vector component, equivalent to abs(N) (4 ops)
=
:x()
Gets the x component of the vector (2 ops)
=
:y()
Gets the y component of the vector (2 ops)
=
:z()
Gets the z component of the vector (2 ops)
=
:w()
Gets the w component of the vector (2 ops)
=
:setX(
)
Returns a copy of the 4D vector with X replaced (use as Vec4 = Vec4:setX(...)) (3 ops)
=
:setY(
)
Returns a copy of the 4D vector with Y replaced (use as Vec4 = Vec4:setY(...)) (3 ops)
=
:setZ(
)
Returns a copy of the 4D vector with Z replaced (use as Vec4 = Vec4:setZ(...)) (3 ops)
=
:setW(
)
Returns a copy of the 4D vector with W replaced (use as Vec4 = Vec4:setW(...)) (3 ops)
= round(
Rv1)
Rounds XYZW to the nearest integer (8 ops)
= round(
Rv1,
Decimals)
Rounds XYZW to argument 2's decimal precision (8 ops)
= ceil(
Rv1)
Rounds XYZW up to the nearest integer (8 ops)
= ceil(
Rv1,
Decimals)
Rounds XYZW up to argument 2's decimal precision (8 ops)
= floor(
Rv1)
Rounds XYZW down to the nearest integer (8 ops)
= floor(
Rv1,
Decimals)
Rounds XYZW down to argument 2's decimal precision (8 ops)
= min(
,
)
Returns the vector with the smallest length (13 ops)
= max(
,
)
Returns the vector with the greatest length (13 ops)
= maxVec(
,
)
Returns the vector combining the highest value components of V1 and V2 (13 ops)
= minVec(
,
)
Returns a vector combining the lowest value components of V1 and V2 (13 ops)
= mod(
,
)
Returns the remainder after XYZW have been divided by argument 2 (13 ops)
= mod(
,
)
Returns the remainder after the components of vector 1 have been divided by the components of vector 2 (13 ops)
= clamp(
,
,
)
Clamps vector 1's XYZW between the XYZW of vector 2(min) and vector 3(max) (13 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) (13 ops)
= mix(
,
,
)
Combines vector 1's XYZW with vector 2's XYZW by a proportion given by argument 3 (between 0 and 1) (13 ops)
= shiftR(
)
Shifts the vector's components right: shiftR( x,y,z,w ) = ( w,x,y,z ) (4 ops)
= shiftL(
)
Shifts the vector's components left: shiftL( x,y,z,w ) = ( y,z,w,x ) (4 ops)
= inrange(
,
,
)
Returns 1 if each component of V is between (or is equal to) the components of Vmin and Vmax (4 ops)
= toRad(
Xv4)
Converts the vector's magnitude from radians to radians (5 ops)
= toDeg(
Xv4)
Converts the vector's magnitude from radians to degrees (5 ops)
= randvec4()
Returns a uniformly distributed, random, normalized direction vector (7 ops)
= randvec4(
Min,
Max)
Returns a random vector with its components between N1 and N2 (7 ops)
= randvec4(
Min,
Max)
Returns a random vector between V1 and V2 (7 ops)
=
:toString()
Gets the vector nicely formatted as a string "[X,Y,Z,W]" (7 ops)
= toString(
V)
Gets the vector nicely formatted as a string "[X,Y,Z,W]" (7 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