-
Notifications
You must be signed in to change notification settings - Fork 334
Expression 2 Self Aware
With entity() you can use Entity-Support to get all the data from the expression-entity. With concmd() you can execute console commands.
Also, the chip has the ability to force itself. Forces aren't dispersed over a certain amount of time, all forces applied to an object within a tick are added up and then applied to the object. Force commands are best used with runOnTick() because you won't end up applying more than 1 force per tick and it is easier to do things like defy gravity.
This page lists all of the available functions used by the selfaware extension. To see examples, check Expression 2 Examples: Self Aware.
...............Function............... | Returns | Description |
---|---|---|
entity() | Gets the entity of the expression | |
concmd() | Takes a string and executes it in the console. Returns 1 if it succeeded and 0 if it failed. The client must enable this in the console with wire_expression2_concmd 1 . The convar wire_expression2_concmd_whitelist allows you to choose which commands can be used. |
|
applyForce() | Applies force according to the vector given (Forces independently on each axis unlike a vector thruster) | |
applyOffsetForce(,) | Applies force to the expression according to the first vector from the location of the second | |
applyAngForce() | Applies torque to the expression according to the given local angle | |
applyTorque() | Applies torque to the expression according to the given local vector, representing the torque axis, magnitude and direction | |
selfDestruct() | Removes the expression | |
selfDestructAll() | Removes the expression and all constrained props | |
ioOutputEntities() | Returns an array of all entities wired to the output . | |
ioInputEntity() | Returns the entity the input is wired to. | |
ioSetOutput(, *) | Trigger the output of the E2 with the value *. |
|
ioGetInput*() | * | Get the value of the input of the E2 . |
:getName() | Returns the name of the E2 . |
|
setName() | Returns 1 if the expression was duplicated |
|
changed(*) | Checks if the current input is different from the last input. The last value is saved based on the position in the code, so you need to be careful when using it in loops. Note internal value gets initialized as 0/empty string/..., so calling changed for the first time will return 1 unless the input is 0/empty string/... . Also note that due to E2 skipping later parts of conditionals when the result is already determined (ie 0 & <whatever> is always 0, no need to execute <whatever> ), you usually want changed to be first, ie if(changed(A)&A) (not if(A&changed(A)) ), to ensure it never gets skipped in this way and just gets to "see" certain values, ie just 1, never 0 |
|
select(,*,...) | * | Returns the -th value given after the index, *'s zero element otherwise. If you mix types, the behaviour is undefined. |
hash() | Returns a numerical hash using the code of the E2 itself (Including comments). |
|
hash() | Returns a numerical hash using the string specified. | |
hashNoComments() | Returns a numerical hash using the code of the E2 itself (Excluding comments). |
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
- Home 🏠
- Syntax 🔣
- Directives 🎛️
- Editor 🖥️
- Events 🌟 (new!)
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