e2 docs custom prop - wiremod/wire GitHub Wiki

Jump to table of contents

Custom/prop

Entity = propSpawn(String Model, Number Frozen)

Use the model string or a template entity to spawn a prop. You can set the position and/or the rotation as well. The last number indicates frozen/unfrozen. (40 ops)

Entity = propSpawn(Entity Template, Number Frozen)

Entity template, Frozen Spawns a prop with the model of the template entity. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(String Model, Vector Pos, Number Frozen)

Model path, Position, Frozen Spawns a prop with the model denoted by the string filepath at the position denoted by the vector. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(Entity Template, Vector Pos, Number Frozen)

Entity template, Position, Frozen Spawns a prop with the model of the template entity at the position denoted by the vector. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(String Model, Angle Rot, Number Frozen)

Model path, Rotation, Frozen Spawns a prop with the model denoted by the string filepath and rotated to the angle given. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(Entity Template, Angle Rot, Number Frozen)

Rotation, Frozen Spawns a prop with the model of the template entity and rotated to the angle given. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(String Model, Vector Pos, Angle Rot, Number Frozen)

Model path, Position, Rotation, Frozen Spawns a prop with the model denoted by the string file path, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = propSpawn(Entity Template, Vector Pos, Angle Rot, Number Frozen)

Position, Rotation, Frozen Spawns a prop with the model of the template entity, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen. (40 ops)

Entity = seatSpawn(String Model, Number Frozen)

Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen. (60 ops)

Entity = seatSpawn(String Model, Vector Pos, Angle Rot, Number Frozen)

Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen. (60 ops)

Entity:propDelete()

Deletes the specified prop. (10 ops)

Entity:propBreak()

Breaks/Explodes breakable/explodable props (Useful for Mines). (10 ops)

Entity:use()

Simulates a player pressing their use key on the entity. (10 ops)

Number = Table:propDelete()

Deletes all the props in the given table, returns the amount of props deleted. (30 ops)

Number = Array:propDelete()

Deletes all the props in the given array, returns the amount of props deleted. (30 ops)

propDeleteAll()

Removes all entities spawned by this E2 (30 ops)

Entity:propManipulate(Vector Pos, Angle Rot, Number Freeze, Number Gravity, Number Notsolid)

Allows to do any single prop core function in one term (position, rotation, freeze, gravity, notsolid) (10 ops)

Entity:propFreeze(Number Freeze)

Passing 0 unfreezes the entity, everything else freezes it. (10 ops)

Entity:propNotSolid(Number Notsolid)

Passing 0 makes the entity solid, everything else makes it non-solid. (10 ops)

Entity:propDraw(Number Drawenable)

Passing 0 disables rendering for the entity (makes it really invisible) (10 ops)

Entity:propShadow(Number Shadowenable)

Passing 0 disables rendering for the entity's shadow (10 ops)

Entity:propGravity(Number Gravity)

Passing 0 makes the entity weightless, everything else makes it weighty. (10 ops)

Entity:propDrag(Number Drag)

Passing 0 makes the entity not be affected by drag (10 ops)

Entity:propInertia(Vector Inertia)

Sets the directional inertia (10 ops)

Entity:propSetBuoyancy(Number Buoyancy)

Sets the prop's buoyancy ratio from 0 to 1 (10 ops)

Entity:propSetFriction(Number Friction)

Sets prop's friction coefficient (default is 1) (10 ops)

Number = Entity:propGetFriction()

Gets prop's friction coefficient (10 ops)

Entity:propSetElasticity(Number Elasticity)

Sets prop's elasticity coefficient (default is 1) (10 ops)

Number = Entity:propGetElasticity()

Gets prop's elasticity coefficient (10 ops)

Entity:propMakePersistent(Number Persistent)

Setting to 1 will make the prop persistent. (10 ops)

Entity:propPhysicalMaterial(String Physprop)

Changes the surface material of a prop (eg. wood, metal, ... See Material_surface_properties ). (10 ops)

String = Entity:propPhysicalMaterial()

Returns the surface material of a prop. (10 ops)

Entity:propSetVelocity(Vector Velocity)

Sets the velocity of the prop for the next iteration (10 ops)

Entity:propSetVelocityInstant(Vector Velocity)

Sets the initial velocity of the prop (10 ops)

Entity:propStatic(Number Static)

Sets to 1 to make the entity static (disables movement, physgun, unfreeze, drive...) or 0 to cancel. (10 ops)

Entity:reposition(Vector Pos)

Deprecated. Kept for backwards-compatibility. (20 ops)

Entity:setPos(Vector Pos)

Sets the position of an entity. (20 ops)

Entity:setAng(Angle Rot)

Set the rotation of an entity. (20 ops)

Entity:rerotate(Angle Rot)

Deprecated. Kept for backwards-compatibility. (20 ops)

Entity:parentTo(Entity Target)

Parents one entity to another. (20 ops)

Entity:deparent()

Unparents an entity, so it moves freely again. (5 ops)

Entity:parentTo()

Parents one entity to another. (5 ops)

propSpawnEffect(Number On)

Set to 1 to enable prop spawn effect, 0 to disable. (1 ops)

propSpawnUndo(Number On)

Set to 0 to force prop removal on E2 shutdown, and suppress Undo entries for props. (1 ops)

Number = propCanCreate()

Returns 1 when propSpawn() will successfully spawn a prop until the limit is reached. (1 ops)