Garry's Mod

Garry's Mod

Not enough ratings
[E2] Entity Manipulation Core
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Roleplay
File Size
Posted
Updated
14.992 KB
7 Jun, 2021 @ 3:56am
10 Jun, 2021 @ 8:14am
6 Change Notes ( view )

Subscribe to download
[E2] Entity Manipulation Core

Description
Based on following addons:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=726355111
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=299838500

This addon adds Expression 2 functions to control entities.

Function list:

void entity:entFire(string input, string param) void entity:entFire(string input, number param) void entity:entFire(string input) void entity:entFire(entity activator, string input, string param) void entity:entFire(entity activator, string input, number param) void entity:entFire(entity activator, string input)

Execute entity input (with given param and activator)
Calling Kill or KillHierarchy on map-spawned entities is disallowed

void entity:entKVSet(string key, string value) void entity:entKVSet(string key, number value)

Set KeyValues value of entity

table entity:entKVsGet()

Returns all KeyValues of entity as table

void entity:entDatadescSet(string key, [number/string/vector/angle/entity] value) void entity:entDatadescSetBoolean(string key, number value)

Set Datadesc value of entity

table entity:entDatadescGetTable()

Returns all Datadesc values of entity as table

string entity:entGetNameOrAssignRandom()

Returns name of entity or assign some random one (to use in inputs/keyvalues)

string entity:entGetName()

Returns name of entity

number entity:entGetMapID()

Return Map ID of entity (it remains same after map reloads and clenups) or -1 if not map entity

entity entityMapID(number id)

Returns entity by it Map ID

entity entSpawnEx(string class, [vector pos], [angle ang])

Spawns entity of given class at pos (if given) and angle (if given).
Will not spawn entity if class is blacklisted.

entity entSpawnExKVs(string class, vecor pos, angle ang, table kvs)

Spawns entity of givan class at givet pos and angles.
Entity is initialized with given KeyValues.
Will not spawn entity if class is blacklisted.

runOnEntityOutput(entity ent, string output)

Causes E2 to execute when ent fires it output

number entityOutputClk()

Returns 1 if E2 was executed due to entity output fire

entity entityOutputClkActivator()

Returns entity that was activator of output that caused E2 execution.

entity entityOutputClkEntity()

Returns entity that fired output that caused E2 execution.

string entityOutputClkOutput()

Returns name of output fire of which caused E2 execution.

string entityOutputClkParam()

Returns parameter of output that caused E2 execution.

Entity spawn filter
This addon has entity spawn filter support, so some configuration is required.

Filter file is reloaded by wire_expression2_entmanipulation_reload_spawn_filter console command.
File should be located in data/stpm64_e2/spawn_filter.txt
By default file is not provided, and without it
entSpawnEx(KVs)
will not work.

File syntax (put plus/minus sign exactly on line start and exactly one space after):

+ regexp

All entity classes that match this regexp will be allowed if not overriden by following lines.

- regexp

All entity classes that match this regexp will be disallowed if not overriden by following lines.


So
+ ^ai_.+ - ai_network
will match allow all entities with class starting with ai_, except ai_network

See default spawn_filter.txt here.
Popular Discussions View All (1)
0
7 Jun, 2021 @ 4:00am
PINNED: Entity Spawn filters
stpM64