This post is for all the addons that have already been committed to the svn, or simply aren't going to be added. It's mainly to help me keep track of the stuff I've done.
(Additions are ordered by most recent first)
E2 Basic Input Functions:
Status: Added
After receiving requests over the past months and thinking about adding input functions for some time, it's probably about time these were added. The functions will detect whether a player is pressing primary fire, secondary fire or use. These are probably the only input functions that will be added to the svn. For full input support see ZeikJT's input extension in the E2 unofficial addons.
- keyAttack1(e:)
- keyAttack2(e:)
- keyUse(e:)
Wire Damage Detector:
Status: Added
Made in response to requests for a way to detect damage in wire. Accepts an entity and array inputs so it can be used with entity markers and E2, and can be configured to detect damage on entities constrained to the input entity/entities.
E2 4D vector/matrix functions:
Status: Added
Added two new variable types, vector4 and matrix4. These come with most of the features from 3D vectors/matrices, and changes have been made to the relevant 2D/3D functions as well to accommodate them. The additions also include a couple of changes to the 3D functions, including setDiagonal(m:v), mRotation(v,n) and an overhauled matrix(e) function, as well as a dehomogenized(v:) function that will convert 3D homogeneous vectors into 3D cartesian (standard) vectors.
The matrix:up/forward/right functions have been replaced with matrix:x/y/z because to be honest, the old system didn't make much sense and didn't fit in with the coordinate system used by everything else.
The array functions have also been updated to include the new vector and matrix variable types, and the debugger will now accept the vector4 type.
Bounding Box functions for E2:
Status: Added
Exposing more lua functions, this time for finding the extents of an object's bounding box. This is probably the best method for finding an object's dimensions, and ideal if you're dealing with PHX plates. The original uses I had in mind were to allow you to build a hover car with rangers tracing from each corner of the car's chassis, and for manually detecting collisions with nocollided objects, but I'm sure there are all sorts of other applications.
- boxCenter(e:)
- boxMin(e:) / boxMax(e:)
- boxSize(e:)
Ranger array filter for E2:
Status: Added
Just a logical extension of ZeikJT's ranger filter function - can be combined with the findToArray() function pretty handily.
Matrix Functions + 2D Vectors for E2:
Status: Added
This is a full suite of matrix functions for 2x2 and 3x3 matrices. No eigenvalue/vector stuff since it's not really justifiable right now, but there's room for more complex functions like that further down the line if it ends up being really necessary.
2x2 & 3x3 Matrices
- assign matrix values by numbers/vectors
- zero matrix
- identity matrix
- convert between 2x2/3x3 matrices
- delta
- addition/subtraction
- multiplication by a scalar
- multiplication by a vector
- multiplication by a matrix
- division by a scalar
- exponentiation (exponents have been limited to integers between -1 and 2)
- set rows/columns by numbers or vectors
- retrieve rows/columns as a vector
- swap rows/columns
- set individual elements by i,j
- retrieve elements by i,j
- swap elements
- retrieve the leading diagonal as a vector
- trace
- determinant
- transpose
- adjugate
3x3 Matrices only
- Reference frame matrices for entities
- Retrieve right/up/forward vectors from a reference frame matrix
2D Vectors
Also included is a full set of functions for 2D vectors to complement 2x2 matrices. These include all the standard functions present in the 3D vector library, along with the relevant alterations (e.g. for rotation, you need only give a single number value to represent the angle to rotate a 2D vector by). This comes with functions for converting between 2D and 3D matrices, and an update for displaying 2D vectors with the debugger.
Interactable HoloEmitter "Vector" Patch & HoloEmitter "GroundBeams" Patch
Status: Added
This is a patch for the holoemitter to provide an option to turn off beams from the emitter itself. It seems a bit strange that such a basic feature is in wire extras but not in official wire, so I've shamelessly ripped the code from there.
Also, I don't know whether anyone still maintains wire extras, but I've made a patch for the interactable holoemitter seeing as how the existing "Vector" input doesn't work and spams errors due to a typo.
EDIT: Additionally, updating "groundbeams" didn't work on existing holoemitters, you had to create a new one to change the option. This has now been fixed.
Adv. Pod Controller Entity output:
Status: Added
This simple patch adds an entity output to the Adv. Pod Controller, giving the pod entity, for use with E2. This is extremely useful, since gives you access to all the entity functions very easily, such as driver position with Entity:driver():pos(), and pod orientation with Entity:angles(). This also saves on having to use entity markers on every pod if they already have pod controllers attached.
Additional Vector/Angle functions:
Status: Added
This is a suite of basic vector/angle maths functions for manipulating them more easily. The main goal is to save having to perform operations on each individual component, which is repetitive and unnecessary, and fills out E2 code like nobody's business. They basically fill out the vector/angle functions so they have the basic maths commands like for numbers.
VectorsAngles
- ceil/floor
- max/min
- mod
- clamp
- mix
- circular shift
- vec(a) returning a vector
- ceil/floor
- mod
- clamp
- mix
- circular shift
- ang(v) returning an angle
inertia() function for E2:
Status: Added
Much like the e:mass() function for linear momentum, this is the equivalent for angular momentum. This is a much needed function for rotational control with objects of arbitrary dimensions and weights, eliminating all the guesswork you'd have to do otherwise! It seems that GMod doesn't bother giving you the products of inertia, it assumes all props are aligned with x,y,z along their principal axes. Basically this function will give you the principal moments of inertia, in the form (Ixx, Iyy, Izz). The upshot is that if you rotate a single prop about its centre of mass about its x, y, or z axes, it'll never wobble, which is pretty useful to know.
isInWorld() function for E2:
Status: Added
Pretty simple function just to find out whether a position vector is in the world. Ought to be useful for hoverdrives, but I can think of a few other situations where it could come in handy.
applyAngForce functions for E2:
Status: Added
Made as a "physics-enabled" fix for applyAngVel. Applies torque for the given angle, units in Force-inches.
(Original credit to silentassassin12092, thanks to chinoto for testing)
- applyAngForce(a)
- applyAngForce(e:a)
Mass functions for E2:
Status: Added
These are intended to work like the weight stool. They only work on player owned props, and are especially useful for the "applyForce()" command.
- setMass(n)
- setMass(e:n)
Player aim functions for E2:
Status: Added
These work just like a combination of shootPos(), eye() and the ranger, but they're far more efficient and easier to use. Really useful, too.
- aimEnt(e:)
- aimPos(e:)
The aimPos() function can be achieved in a similar fashion with the adv.pod controller, so it's not like it's adding anything revolutionary, it's just very helpful. Here's an example in E2 that turns whatever you're looking at green.
Entity Marker fix & upgrade:Code:@name Greenify @persist LastEnt:entity StoreColor:vector interval(20) Entity = entity():owner():aimEntity() if (LastEnt != Entity) { LastEnt:setColor(StoreColor) StoreColor = Entity:getColor() } Entity:setColor(100,255,100) LastEnt = Entity
Status: Added
The code has been streamlined, with the "Think" function replaced by an event hook, used for checking when the marked entity is removed. The reload function giving client errors has now been fixed. I've also merged the lib code into wire_emarker.lua
(Thanks ZeikJT)
With the new functions for E2 coming out, I found the entity marker gets a lot more use than it did before. The old entity marker was broken and way out of date, so I fixed it up with proper duplicator support and a few upgrades so it's actually useable. This code has been tested on servers and I've been using it to build various things, and it seems to work pretty well so far.
It now works a lot more intuitively - you left click to place them, and right click to link them, like all the other linkable tools. I added a new reload function so you can clear the links. Plus it'll give you feedback a lot like the adv. pod controller tool. Also, if you left click on a marker, it'll tell you the model of the entity it's linked to and show a line going to the linked entity, so no more searching around not having a clue what all your emarkers are actually doing.
The emarker entity will now also detect if the prop it's linked to is removed, and update its overlay properly. This could get pretty confusing before!
Colour functions for E2:
Status: Added
Added the colour functions library, with the following commands:
- getColor(e:)
- getAlpha(e:)
- setColor(e:nnn) / (e:nnnn) / (e:v) / (e:vn)
- setAlpha(e:n)
EDIT: (02/06/09) Added setColor(e:v4)


LinkBack URL
About LinkBacks







Reply With Quote




Bookmarks