Skip to content
Deyan Dobromirov edited this page Jul 30, 2018 · 25 revisions

Description

The prop core functionality is used generally for manipulating props using an E2 script within Garry's mod environment. Manipulalation type can be anything like creating, deleting, teleporting, angling, gravity, inertia, buoyancy and much more

Controls

Convar sbox_E2_PropCore controls enable/disable of the extension.
2 : Players can affect their own props
1 : Only admins can ise the extensoion
0 : The extension is disabled
Convar sbox_E2_maxProps Controls the maximum amount of props spawned via E2 set this to -1 to disable the limit.
Convar sbox_E2_maxPropsPerSecond Controls the maximum amount of propes spawned for one second. Dont set this too high !

Expression 2 API

All the function descriptions are available in the table below:

................Prop.core.function................ .Out. .Description.
image:deparent() Unparents an entity, so it moves freely again.
image:parentTo() Parents one entity to another.
image:parentTo(image) Parents one entity to another.
image:propBreak() Breaks/Explodes breakable/explodable props (Useful for Mines).
propCanCreate() image Returns 1 when propSpawn() will successfully spawn a prop until the limit is reached.
image:propDelete() Removes the given entity(s). Returns how may are deleted.
image:propDelete() image Removes the given entity(s). Returns how may are deleted.
image:propDelete() image Removes the given entity(s). Returns how may are deleted.
propDeleteAll() Removes all entities spawned by this E2
image:propDrag(image) Passing 0 makes the entity not be affected by drag
image:propDraw(image) Passing 0 disables render]ing for the entity (makes it really invisible)
image:propFreeze(image) Passing 0 unfreezes the entity, everything else freezes it.
image:propGetElasticity() image Gets prop's elasticity coefficient
image:propGetFriction() image Gets prop's friction coefficient
image:propGravity(image) Passing 0 makes the entity weightless, everything else makes it weighty.
image:propInertia(image) Sets the directional inertia
image:propMakePersistent(image) Setting to 1 will make the prop persistent.
image:propManipulate(image,image,image,image,image) Allows to do any single prop core function in one term (position, rotation, freeze, gravity, notsolid)
image:propNotSolid(image) Passing 0 makes the entity solid, everything else makes it non-solid.
image:propPhysicalMaterial() image Returns the surface material of a prop.
image:propPhysicalMaterial(image) Changes the surface material of a prop (eg. wood, metal, ... See Material_surface_properties ).
image:propSetBuoyancy(image) Sets the prop's buoyancy ratio from 0 to 1
image:propSetElasticity(image) Sets prop's elasticity coefficient (default is 1)
image:propSetFriction(image) Sets prop's friction coefficient (default is 1)
image:propSetVelocity(image) Sets the velocity of the prop for the next iteration
image:propSetVelocityInstant(image) Sets the initial velocity of the prop
image:propShadow(image) Passing 0 disables rendering for the entity's shadow
propSpawn(image,image,image) image 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.
propSpawn(image,image) image 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.
propSpawn(image,image,image,image) image 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.
propSpawn(image,image,image) image 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.
propSpawn(image,image,image) image 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.
propSpawn(image,image) image 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.
propSpawn(image,image,image,image) image 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.
propSpawn(image,image,image) image 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.
propSpawnEffect(image) Set to 1 to enable prop spawn effect, 0 to disable.
propSpawnUndo(image) Set to 0 to force prop removal on E2 shutdown, and suppress Undo entries for props.
image:propStatic(image) Sets to 1 to make the entity static (disables movement, physgun, unfreeze, drive...) or 0 to cancel.
image:reposition(image) Deprecated. Kept for backwards-compatibility.
image:rerotate(image) Deprecated. Kept for backwards-compatibility.
seatSpawn(image,image) image Spawn a remodeled prop_vehicle_prisoner_pod
seatSpawn(image,image,image,image) image Spawn a remodeled prop_vehicle_prisoner_pod
image:setAng(image) Set the rotation of an entity.
image:setPos(image) Sets the position of an entity.
image:use() Simulates a player pressing their use key on the entity.

Expression 2 ⚙️

Getting Started 🕊

Guides (In learning order) 🎓

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render 🖌

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID 💳

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Extras 🔭

Clone this wiki locally