-
Notifications
You must be signed in to change notification settings - Fork 333
Expression 2 Number
This is a full list of functions provided by E2's number extension. It will also include syntax for comparison operations and bitwise ops.
Example are shown here: Expression 2 Examples: Number
Syntax | Example | Description |
---|---|---|
> | if ( A>8 ) {} | Greater than comparison. Returns 1 when the left value is greater than the right value. |
< | if ( A<4 ) {} | Less than comparison. Returns 1 when the left value is less than the right value. |
>= | if ( A>=6 ) {} | Returns 1 when the right value is either greater than or equal to the left value. |
<= | if ( A<=14 ) {} | Returns 1 when the right value is either less than or equal to the left value. |
haha numbers go wheeeeeeee
Syntax | Example | Description |
---|---|---|
+ | 3 + 8 | If you don't know what this does, I feel sorry for you. |
- | A - B | Subtracts the right value from the left value, and returns the result. |
* | C * D | Multiplies the right and left values together, and returns the result. This can also multiply vectors as a magnitude! |
/ | E / F | Divides the left value over the right value and returns an exact decimal answer. |
% | E % F | Divides the left value over the right value, and returns the remainder of the division. |
^ | 4 ^ N | Raises the left value to the Nth power exponent, and returns the result. |
Number variables can be reassigned a new value based on an arithmetic operator by simply appending an equal sign after it.
The format A += B
, is equivalent to doing A = A + B
. This works for any arithmetic operation.
There is also a shorthand form of this to increment/decrement a variable by just 1.
Syntax | Example | Description |
---|---|---|
+= | A += B - C | Sets the variable A equal to itself, plus B-C. |
-= | A -= B + C | Sets the variable A equal to itself, minus B+C. |
*= | A *= D | Sets A equal to A * D. |
/= | A /= E | Sets A equal to A / E. |
%= | A %= G | Sets A equal to A % G. |
^= | A ^= H | Sets A equal to A to the power of H. |
Developed by: asiekierka, TomyLobo (made xor), and Divran (added operators)
Bitwise operators act on numbers as if they were decimal-represented binary numbers.The individual bits of a number have operations taken against them. Wikipedia has a good explanation of each function: http://en.wikipedia.org/wiki/Bitwise_operation
Tip: You can also use N:toString(2) and S:toNumber(2) to perform bitwise manipulation using the string functions.
Function | Returns | Description |
---|---|---|
bOr(N,N) | Performs bitwise OR against the two numbers (Operator: N || N) | |
bAnd(N,N) | Performs bitwise AND against the two numbers (Operator: N && N) | |
bXor(N,N) | Performs bitwise XOR against the two numbers (Operator: N ^^ N) | |
bShl(N,N) | Performs bitwise shift left on the first number by the amount of the second (Operator: N << N) | |
bShr(N,N) | Performs bitwise shift right on the first number by the amount of the second (Operator: N >> N) | |
bNot(N) | Performs a binary Not | |
bNot(N,N) | Performs a binary Not. The second argument is the length of the number you wish to perform Not on in bits. |
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.
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
Disabled by default: constraintcore, effects, propcore, remoteupload, wiring
Wire-Extras (repo): camera, ftrace, holoanim, light, stcontrol, tracesystem
Expression 2 ⚙️
- Syntax 🔣
- Directives 🎛️
- Editor 🖥️
- Ops 📊
- Learning & Getting Help 📚
- Triggers ⏲️
- Events 🎬
- Find Functions 🔍
- Physics 🚀
- EGP Basics 📈
- Lambdas λ
- Tips & Tricks 📘
Click To Expand
- 🟥 SPU
- 🟥 Address Bus
- 🟥 Extended Bus
- 🟥 Plug/Socket
- 🟥 Port
- 🟥 Transfer Bus
- 🟩 GPU
- 🟥 Dynamic Memory
- 🟥 Flash EEPROM
- 🟥 ROM
- 🟧 Beacon Sensor
- 🟧 Locator
- 🟧 Target Finder
- 🟧 Waypoint
- 🟥 XYZ Beacon
- 🟩 CPU
- 🟩 Expression 2
- 🟩 Gates
- 🟥 PID
- 🟧 CD Disk
- 🟥 CD Ray
- 🟧 DHDD
- 🟥 Keycard
- 🟥 RAM-card
- 🟧 Satellite Dish
- 🟧 Store
- 🟧 Transferer
- 🟥 Wired Wirer
- 🟧 Adv Entity Marker
- 🟧 Damage Detector
- 🟧 Entity Marker
- 🟧 GPS
- 🟧 Gyroscope
- 🟥 HighSpeed Ranger
- 🟧 Laser Pointer Receiver
- 🟥 Microphone
- 🟧 Ranger
- 🟧 Speedometer
- 🟧 Water Sensor
- 🟧 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
- 🟩 Cam Controller
- 🟧 Colorer
- 🟧 FX Emitter
- 🟧 HighSpeed Holoemitter
- 🟧 HoloEmitter
- 🟧 HoloGrid
- 🟥 Interactable Holography Emitter
- 🟥 Materializer
- 🟥 Painter
- 🟧 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
- 🟥 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
- 🟧 Debugger
- 🟥 GUI Wiring
- 🟥 Multi Wire
- 🟧 Namer
- 🟥 Simulate Data
- 🟩 Wiring
- 🟥 Beam Reader
- 🟥 Implanter
- 🟥 Reader
- 🟥 Target Filter
- 🟥 User Reader
Gates 🚥
Click To Expand
TBD