e2 docs custom prop - wiremod/wire GitHub Wiki
Custom/prop
= propSpawn(
Model,
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)
= propSpawn(
Template,
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)
= propSpawn(
Model,
Pos,
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)
= propSpawn(
Template,
Pos,
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)
= propSpawn(
Model,
Rot,
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)
= propSpawn(
Template,
Rot,
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)
= propSpawn(
Model,
Pos,
Rot,
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)
= propSpawn(
Template,
Pos,
Rot,
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)
= sentSpawn(
Class)
Sent class - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Pos)
Sent class, Position - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Data)
Sent class, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Pos,
Data)
(150 ops)
= sentSpawn(
Class,
Pos,
Rot)
Sent class, Position, Rotation - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Pos,
Rot,
Data)
Sent class, Position, Rotation, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Pos,
Rot,
Frozen)
Sent class, Position, Rotation, Frozen - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentSpawn(
Class,
Pos,
Rot,
Frozen,
Data)
Sent class, Position, Rotation, Frozen, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!) (150 ops)
= sentGetWhitelisted()
Returns an array of classes, which is registered to the whitelist (can be spawned regardless of wire_expression2_propcore_sents_whitelist). (Can be used to make a lookup table) (25 ops)
= sentGetData(
Class)
Returns a table, where keys are parameter names (key sensitive!) and values as a table, where 'type' is a value type, 'default_value' is the default value that will be used, if none provided, and 'description' is a description of the parameter. (30 ops)
= sentGetData(
Class,
Key)
Returns a table, where 'type' is a value type, 'default_value' is the default value that will be used, if none provided, and 'description' is a description of the parameter. (10 ops)
= sentGetDataTypes(
Class)
Returns a table, where keys are parameter names (key sensitive!) and values is (lua-)types. (25 ops)
= sentGetDataType(
Class,
Key)
Returns parameters's (lua-)type of the parameter. (5 ops)
= sentGetDataDefaultValues(
Class)
Returns a table, where keys are parameter names (key sensitive!) and values is default values, which will be applied if none would be provided. (25 ops)
= sentGetDataDefaultValue(
Class,
Key)
(5 ops)
= sentGetDataDescriptions(
Class)
Returns a table, where keys are parameter names (key sensitive!) and values is descriptions of the parameter. (25 ops)
= sentGetDataDescription(
Class,
Key)
(5 ops)
= sentCanCreate()
Returns 1 if you can spawn a SENT, 0 otherwise. (Complete alias of propCanCreate()) (5 ops)
= sentCanCreate(
Class)
Returns 1 if you can spawn a provided class(type) SENT, 0 otherwise. (Accounts both for antispam and whitelist) (5 ops)
= sentIsWhitelist()
Returns 1 if the whitelist is enabled, 0 otherwise. (1 ops)
= sentIsEnabled()
Returns 1 if server allows spawning sents, 0 otherwise. (1 ops)
= seatSpawn(
Model,
Frozen)
Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen. (50 ops)
= seatSpawn(
Model,
Pos,
Rot,
Frozen)
Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen. (50 ops)
= seatSpawn(
Model,
Pos,
Rot,
Frozen,
Vehicletype)
Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen. String seatType, determines what animations the seat will have. For example phx_seat2 and phx_seat3 will have Jeep and Airboat animations. (50 ops)
:propDelete()
Deletes the specified prop. (10 ops)
:propBreak()
Breaks/Explodes breakable/explodable props (Useful for Mines). (10 ops)
:propDissolve()
Dissolves the specified entity. (10 ops)
:propDissolve(
Dissolvetype)
Dissolves the specified entity using the given dissolve type (_ENTITY_DISSOLVE). (10 ops)
:propDissolve(
Dissolvetype,
Magnitude)
Dissolves the specified entity with the given dissolve type (_ENTITY_DISSOLVE) and magnitude. (10 ops)
:use()
Simulates a player pressing their use key on the entity. (10 ops)
=
:propDelete()
Deletes all the props in the given table, returns the amount of props deleted. (30 ops)
=
: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)
=
:propIsDupeable()
(1 ops)
=
:propCanSetDupeable()
(1 ops)
:propNoDupe(
Nodupe)
(2 ops)
:propManipulate(
Pos,
Rot,
Freeze,
Gravity,
Notsolid)
Allows to do any single prop core function in one term (position, rotation, freeze, gravity, notsolid) (10 ops)
:propFreeze(
Freeze)
Passing 0 unfreezes the entity, everything else freezes it. (10 ops)
:propNotSolid(
Notsolid)
Passing 0 makes the entity solid, everything else makes it non-solid. (10 ops)
:propDraw(
Drawenable)
Passing 0 disables rendering for the entity (makes it really invisible) (10 ops)
:propShadow(
Shadowenable)
Passing 0 disables rendering for the entity's shadow (10 ops)
:propSleep(
Sleep)
Puts an entity to 'sleep', causing it to stop moving until any physical interaction occurs. (10 ops)
:propGravity(
Gravity)
Passing 0 makes the entity weightless, everything else makes it weighty. (10 ops)
:propDrag(
Drag)
Passing 0 makes the entity not be affected by drag (10 ops)
:propInertia(
Inertia)
Sets the directional inertia (10 ops)
:propSetBuoyancy(
Buoyancy)
Sets the prop's buoyancy ratio from 0 to 1 (10 ops)
:propSetFriction(
Friction)
Sets prop's friction coefficient (default is 1) (10 ops)
=
:propGetFriction()
Gets prop's friction coefficient (10 ops)
:propSetElasticity(
Elasticity)
Sets prop's elasticity coefficient (default is 1) (10 ops)
=
:propGetElasticity()
Gets prop's elasticity coefficient (10 ops)
:propMakePersistent(
Persistent)
Setting to 1 will make the prop persistent. (10 ops)
:propPhysicalMaterial(
Physprop)
Changes the surface material of a prop (eg. wood, metal, ... See Material_surface_properties ). (10 ops)
=
:propPhysicalMaterial()
Returns the surface material of a prop. (10 ops)
:propSetVelocity(
Velocity)
Sets the velocity of the prop for the next iteration (10 ops)
:propSetVelocityInstant(
Velocity)
Sets the initial velocity of the prop (10 ops)
:propSetAngVelocity(
Velocity)
Sets the angular velocity of the prop for the next iteration (10 ops)
:propSetAngVelocityInstant(
Velocity)
Sets the initial angular velocity of the prop (10 ops)
:propStatic(
Static)
Sets to 1 to make the entity static (disables movement, physgun, unfreeze, drive...) or 0 to cancel. (10 ops)
:boneManipulate(
Pos,
Rot,
Isfrozen,
Gravity,
Collision)
Allows to do any single bone function in one term (position, rotation, freeze, gravity, collision) (10 ops)
:boneFreeze(
Isfrozen)
Passing 0 unfreezes that specific bone, everything else freezes it. (10 ops)
:setCollisions(
Enable)
Passing 0 will disable collisions with the everything but players (30 ops)
:setDrag(
Drag)
Passing 0 makes the bone not be affected by drag (30 ops)
:setInertia(
Inertia)
Sets the directional inertia (30 ops)
:setBuoyancy(
Buoyancy)
(30 ops)
:setPhysicalMaterial(
Material)
Sets the surface material of the bone. (eg. wood, metal, ... See Material_surface_properties ) (30 ops)
:setVelocity(
Velocity)
Sets the velocity of the bone for the next iteration (30 ops)
:setVelocityInstant(
Velocity)
Sets the initial velocity of the bone (30 ops)
:setAngVelocity(
Velocity)
Sets the angular velocity of the bone for the next iteration (30 ops)
:setAngVelocityInstant(
Velocity)
Sets the initial angular velocity of the bone (30 ops)
:makeStatue(
Enable)
Applies the 'statue' effect on a ragdoll. Remove it by passing 0. (5000 ops)
:setPos(
Pos)
Sets the position of an entity. (20 ops)
:reposition(
Pos)
Deprecated. Kept for backwards-compatibility. (20 ops)
:setLocalPos(
Pos)
Sets the position of an entity local to its parent. (20 ops)
:rerotate(
Rot)
Deprecated. Kept for backwards-compatibility. (20 ops)
:setAng(
Rot)
Set the rotation of an entity. (20 ops)
:setLocalAng(
Rot)
Set the rotation of an entity local to its parent. (20 ops)
:setPos(
Pos)
Sets the position of a bone. (20 ops)
:setAng(
Rot)
Set the rotation of a bone. (20 ops)
:ragdollFreeze(
Isfrozen)
Passing 0 unfreezes the entire ragdoll. (60 ops)
=
:ragdollGetAng()
(5 ops)
:ragdollSetPos(
Pos)
Sets the position of a ragdoll while preserving pose. (150 ops)
:ragdollSetAng(
Rot)
Set the rotation of a ragdoll while preserving pose. (150 ops)
=
:ragdollGetPose()
Gets a specially built table containing the pose of the ragdoll. See ragdollSetPose. (150 ops)
:ragdollSetPose(
Pose,
Rotate)
Sets the pose of a ragdoll while preserving position. Setting rotate to 0 makes the ragdoll use the pose's original angle. See ragdollGetPose. (150 ops)
:ragdollSetPose(
Pose)
Sets the pose of a ragdoll while preserving position and angle. See ragdollGetPose. (150 ops)
:parentTo(
Target)
Parents one entity to another. (20 ops)
:parentToAttachment(
Target,
Attachmentname)
Parents one entity to anothers attachment. (20 ops)
:deparent()
Unparents an entity, so it moves freely again. (5 ops)
:parentTo()
Parents one entity to another. (5 ops)
On)
propSpawnEffect(Set to 1 to enable prop spawn effect, 0 to disable. (1 ops)
On)
propSpawnUndo(Set to 0 to force prop removal on E2 shutdown, and suppress Undo entries for props. (1 ops)
= propCanCreate()
Returns 1 when propSpawn() will successfully spawn a prop until the limit is reached. (1 ops)
:setEyeTarget(
Pos)
For NPCs, sets the eye target to the world position. For ragdolls, sets the eye target to the local eye position (10 ops)
:setFlexWeight(
Flex,
Weight)
(10 ops)
:setEyeTargetLocal(
Pos)
Sets the eye target to the local eye position (30 ops)
:setEyeTargetWorld(
Pos)
Sets the eye target to the world position (30 ops)
:setFlexWeight(
Flex,
Weight)
(20 ops)
:setFlexScale(
Scale)
Sets the flex scale of the entity (20 ops)
= Collision:toTable()
(20 ops)
= Collision:hitPos()
Returns a vector of where the collision ocurred (5 ops)
= Collision:pos()
Returns a vector of where the collision ocurred Alias of hitPos(xcd:) (5 ops)
= Collision:position()
Returns a vector of where the collision ocurred Alias of hitPos(xcd:) (5 ops)
= Collision:ourOldVelocity()
Returns a vector of the velocity of the tracked entity before the collision occurred. (5 ops)
= Collision:entityOldVelocity()
Returns a vector of the velocity of the tracked entity before the collision occurred. Alias of ourOldVelocity(xcd:) (5 ops)
= Collision:theirOldVelocity()
Returns a vector of the velocity of the hit entity before the collision occurred (5 ops)
= Collision:hitEntityOldVelocity()
Returns a vector of the velocity of the hit entity before the collision occurred Alias of theirOldVelocity(xcd:) (5 ops)
= Collision:hitNormal()
Returns the hitnormal(vector) of the surface on the tracked entity that hit the other entity (5 ops)
= Collision:hitSpeed()
Returns a vector of the speed the impact occurred with (5 ops)
= Collision:ourNewVelocity()
Returns a vector of the velocity of the tracked entity after the collision occurred. (5 ops)
= Collision:entityNewVelocity()
Returns a vector of the velocity of the tracked entity after the collision occurred. Alias of ourNewVelocity(xcd:) (5 ops)
= Collision:theirNewVelocity()
Returns a vector of the velocity of the hit entity after the collision occurred. (5 ops)
= Collision:hitEntityNewVelocity()
Returns a vector of the velocity of the hit entity after the collision occurred. Alias of theirNewVelocity(xcd:) (5 ops)
= Collision:ourOldAngularVelocity()
Returns a vector of the angular velocity of the tracked entity before the collision occurred. (5 ops)
= Collision:entityOldAngularVelocity()
Returns a vector of the angular velocity of the tracked entity before the collision occurred. Alias of ourOldAngularVelocity(xcd:) (5 ops)
= Collision:theirOldAngularVelocity()
Returns a vector of the angular velocity of the hit entity before the collision occurred. (5 ops)
= Collision:hitEntityOldAngularVelocity()
Returns a vector of the angular velocity of the hit entity before the collision occurred. Alias of ourOldAngularVelocity(xcd:) (5 ops)
= Collision:speed()
Returns a number representing the speed at which the collision occurred. (2 ops)
= Collision:ourSurfaceProps()
Returns a number representing the surface properties of the tracked entity (2 ops)
= Collision:entitySurfaceProps()
Returns a number representing the surface properties of the tracked entity Alias of ourSurfaceProps(xcd:) (2 ops)
= Collision:theirSurfaceProps()
Returns a number representing the surface properties of the hit entity (2 ops)
= Collision:hitEntitySurfaceProps()
Returns a number representing the surface properties of the hit entity Alias of theirSurfaceProps(xcd:) (2 ops)
= Collision:deltaTime()
Returns a number representing how long ago the last collision between the tracked entity and the hit entity was, in seconds. Capped at 1 second. (2 ops)
= Collision:hitEntity()
Returns the entity that was hit for this collision. (2 ops)
= trackCollision(
Ent)
Starts tracking collisions for the entity, will fire event entityCollision when they occur. Does not track when players or vehicles hit world, only other entities. Needs event entityCollision(entity, entity, collision) in order to run. Returns 1 on success or 0 on error in non-strict (20 ops)
= trackCollision(
Ent, Function Cb)
Starts tracking collisions for the entity, will call the provided function, then fire event entityCollision when they occur. May track without event entityCollision. Passed callback function needs argument signature of (eexcd), aka (entity, entity, collision) For more info see trackCollision(e) (20 ops)
= isTrackingCollision(
Ent)
Returns 1 if the entity's collisions are already being tracked, 0 if not. Errors on an invalid ent (5 ops)
Ent)
stopTrackingCollision(Stops tracking collisions for the entity. Error in strict if entity is invalid or entity isn't being tracked (5 ops)