Garry's Mod

Garry's Mod

400 betyg
Control Map Entities - Entity:fire() E2 Function (Wiremod / ent_fire)
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Roleplay
Filstorlek
Lades upp
Uppdaterades
1.054 KB
13 aug, 2014 @ 2:06
20 apr, 2017 @ 12:00
6 ändringsnotiser ( visa )

Abonnera för att ladda ner
Control Map Entities - Entity:fire() E2 Function (Wiremod / ent_fire)

I 1 samling av LibertyForce
Horror- & Story-Map Enhancements (Single- and Multiplayer Tools)
6 artiklar
Beskrivning
This extension will add a new function to Expression 2 that allows you to fire an entity's input. It works much like the "ent_fire" console command, but without the need for "sv_cheats 1" and directly from within your E2 code.

Now you can easily control map entities:
  • Open, close, lock, unlock every door
  • Enable or disable thumpers, turrets and anything else that is compatible
  • Activate buttons without touching them or block them from being used
  • Start, stop, move forward / backward elevators and other things that use func_tracktrain.
  • Set keyvalues and spawnflags for entities.
All with wired buttons / events / or just anything you can think of (and build).


This is an Wiremod E2 extension. Therefore it requires Wiremod!


Syntax:
Entity:fire([string] input, [string] parameter)
Entity - a variable or function that returns the entity you want to manipulate
input - the entity's input that you want to fire (ex. "open")
parameter = optional: some inputs require additional parameter that you can send here

Entity:setKeyValue([string] keyvalue, [string/number] value)
Entity - a variable or function that returns the entity you want to manipulate
keyvalue - the keyvalue that you want to change (ex. "spawnflags")
value = the value that you want to set - either as number or string

entityMapID([number] id)
Returns entity that has given MapCreationID. Unlike entity(), it will always be the same on same map, no matter how much you clean up or restart it.
ID - the unique MapCreationID of the entity. Use the below function or Easy Entity Inspector to retrieve it.

Entity:getMapID()
Returns entity's MapCreationID. Only works on map entities.
Entity - a variable or function that returns the entity

Entity:getEntityName()
Returns the mapping name of this entity. Only works on (map) entities with an assigned name.
Entity - a variable or function that returns the entity


Example:
MyDoor:fire("lock") # This will lock the door that is assigned the variable "MyDoor". entityMapID(123):fire("kill") # This deletes the map entity with MapCreationID 123 from the map. Turret:setKeyValue("spawnflags",512) # Makes a floor turret friendly (like hacked by Alyx)


Multiplayer Notes:
  • This mod needs to be installed server-side! Clients don't need to install it and can still use the function.
  • This function does NOT allow to manipulate player entities (others or own).
  • Compatible with most Prop Protection addons: It uses the hook "CanProperty" to check if a player is allowed to manipulate an entity. If you don't have Prop Protection, all players are allowed to manipulate everything!
  • Prop Protection can be bypassed with the convar "wire_expression2_entfire_norestriction". If set to 1, it will allow all players to manipulate all entities, regardless of Prop Protection.


Click the following link for a guide that includes a list for inputs that you can fire and how you can get entities in E2. Beginners should read this! Do not ask questions answered in the FAQs.


>>> FAQ's / Documentation <<<

Other useful links:


Tags: wiremod wire expression 2 e2 chip developer input keyvalue key value entity map door combine turret elevator train open close lock unlock fire enable disable manipulate change
Populära diskussioner Visa alla (3)
5
28 dec, 2017 @ 18:35
KLISTRAD: Example E2 Codes
LibertyForce
4
21 okt, 2024 @ 11:19
KLISTRAD: FAQs / Documentation
LibertyForce
2
20 nov, 2015 @ 10:13
E2 Hacker Buddy help
Sykken
28 kommentarer
Diveryup 24 dec, 2023 @ 14:01 
how can i even use this i cant even find the thing
doofdrew 27 jul, 2023 @ 13:32 
how do i use this?
Intuitive 1 jul, 2023 @ 20:37 
I love this. Thank you!
YellowBanana4201 16 maj, 2023 @ 20:33 
Can it just allow buttons to be moved with the physgun?
YellowBanana4201 16 maj, 2023 @ 20:26 
Why do some of the buttons like the combine button point down when ever on a wall?
Benevolence 15 apr, 2023 @ 22:59 
I came across this too many times, because I had limited CPU\RAM, Now I might see this useful!:steamthumbsup:
{SWAG} Kyrator 6 mar, 2022 @ 15:18 
toturial for thumplers please
StrawWagen 1 sep, 2021 @ 11:58 
Admincore adds support for e:entsetinput(s) as well as E:entsetkeyvalue(s)
Quite useful if you're looking for something more
Armystuntman 26 jun, 2020 @ 10:17 
Or even better, add a version identical to ent_fire's console command variant, which uses the entity map name instead of specifying each map ID individually? This would make it easier to fire multiple entities which have the same name.
Specifying every single ID is a little tedious.
Armystuntman 26 jun, 2020 @ 10:14 
Can you make it possible to :fire() multiple entities, like in an array?