logo

© Robert Marshall

ROBWARE » Projects » Wire Expression 2 Extensions

THIS PROJECT HAS BEEN CLOSED AND IS NO LONGER MAINTAINED


setPos function
These functions can set the position of ANY entity manipulable by exp2 (including players). Other than the exception of Admins, players can set their own position with this.
setPos(E,V)
E:setPos(V)


Where E is the entity to be positioned to coordinate V
Example:
setPos(entity(),vec(0,0,0))
owner():setPos(entity():pos())



The shoot function
This function is a complex function in that its only input is a table. The function does include a set of default settings, so it can take an empty table. Every time you call this function 1 bullet is fired.
shoot(T)

Where T is the bullet data table.
No example here. You must figure this one out for yourself. My only hint is to look at the Gmod Wiki. DO NOT ASK ME HOW TO USE THIS. I WILL NOT TELL YOU.

Console command functions
I have always wanted the ability to create custom console commands. This is a tricky one, because once you have created the command, it is taken, and cant be removed until the server cycles the map or restarts. This is also restricted to VIPs and above.
addConCommand(S)
cmdExec(S)   N
cmdArgs(S)   R


Where S is the command name and N is a returned number or either 1 or 0 and R is an array of arguments.
Example:
addConCommand("test")

if (cmdExec("test")){
   printTable(cmdArgs("test"))
}



The explosion function
This function is severly restricted and much less powerful that the normal Wire Explosive. The explosion function creates an explosion at a given position with a given magnitude (limited to 800). A player can only create an explosion every quater of a second, to stop explosion spam.
explosion(V,N)

Where V is the coordinate and N is the magnitude.
Example:
explosion(entity():pos(),220)



Light creation functions
These functions can create, adjust, and remove lights. There are limits on brightness (10) and size (1024) to keep video lag to a reasonable low.
lightCreate(N,V,V,N,N,N)
lightOn(N)
lightOff(N)
lightPos(N,V)
lightColour(N,V)
lightBrightness(N,N)
lightDist(N,N)
lightStyle(N,N)
lightParent(N,E)
lightDestroy(N)


Where the first N is always the ID if the light. For the lightCreate function the parameters go in the order ID,Position,Colour,Brightness,Distance,Style. The rest are self explanitory.
Example:
lightCreate(1,owner():pos()+vec(0,0,36),vec(255,0,0),5,255,0)
lightParent(1,owner())



Nocolide Functions
It seemed useful, so I made the ability to nocolide entites. Just like right clicking with the NoColide tool.
E:nocolide(N)
nocolide(E,N)


Where E is the entity to nocolide and N is value to turn nocolide on or off. 0=off >0=On.
Example:
Door:nocolide(1)
nocolide(Door,0)



Particle Functions
These create particle effects like the particle system controller does.
particleCreate(N,S,V,E)
particleCreate(N,S,V,A)
particleCreate(N,S,V)
particleDestroy(N)
particleStart(N)
particleStop(N)
particlePos(N,V)
particleAngle(N,A)
particleParent(N,E)


Where N is the ID, S is the name of the particle system to use,V is the position, A is the angle, E is the entity to parent to.
Example:
particleCreate(1,"aurora_shockwave",entity():pos(),entity())
particleStart(1)



Stargate Information Functions
Gets the name and address of stargates. Very handy to use with entity search to get an address book.
E:getGateAddress()    S
E:getGateName()    S


Where E is the entity to get the information from and S is the result.
Example:
Name=Ent:getGateName()
Address=Ent:getGateAddress()

 

Installing

To install this, you simply put it in your Expression 2 custom folder. This can be found at: garrysmod\garrysmod\addons\wire\lua\entities\gmod_wire_expression2\core\custom



Project Files:

robsextensions.lua (7.86KB)
You may need to right click and choose "Save Link As..."

Suggestions closed thanks to spammers.

Project started by: Rob
Last updated: 2011-05-08 18:05:55