Garry's Mod

Garry's Mod

402 个评价
Control Map Entities - Entity:fire() E2 Function (Wiremod / ent_fire)
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 角色扮演
文件大小
发表于
更新日期
1.054 KB
2014 年 8 月 13 日 上午 2:06
2017 年 4 月 20 日 下午 12:00
6 项改动说明 ( 查看 )

订阅以下载
Control Map Entities - Entity:fire() E2 Function (Wiremod / ent_fire)

在 LibertyForce 的 1 个合集中
Horror- & Story-Map Enhancements (Single- and Multiplayer Tools)
6 件物品
描述
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
热门讨论 查看全部(3)
5
2017 年 12 月 28 日 下午 6:35
置顶: Example E2 Codes
LibertyForce
5
8 月 21 日 下午 1:42
置顶: FAQs / Documentation
LibertyForce
2
2015 年 11 月 20 日 上午 10:13
E2 Hacker Buddy help
Sykken
28 条留言
Diveryup 2023 年 12 月 24 日 下午 2:01 
how can i even use this i cant even find the thing
doofdrew 2023 年 7 月 27 日 下午 1:32 
how do i use this?
Intuitive 2023 年 7 月 1 日 下午 8:37 
I love this. Thank you!
YellowBanana4201 2023 年 5 月 16 日 下午 8:33 
Can it just allow buttons to be moved with the physgun?
YellowBanana4201 2023 年 5 月 16 日 下午 8:26 
Why do some of the buttons like the combine button point down when ever on a wall?
Benevolence 2023 年 4 月 15 日 下午 10:59 
I came across this too many times, because I had limited CPU\RAM, Now I might see this useful!:steamthumbsup:
{SWAG} Kyrator 2022 年 3 月 6 日 下午 3:18 
toturial for thumplers please
SkullWagen 2021 年 9 月 1 日 上午 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 2020 年 6 月 26 日 上午 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 2020 年 6 月 26 日 上午 10:14 
Can you make it possible to :fire() multiple entities, like in an array?