func_button
| CBaseButton |
func_button是固体实体,可在所有的
起源 游戏中使用。
该实体设计用于玩家可使用的按钮。当玩家使用+use时,按钮会移动到按下位置。
要查看使用func_button制作键盘的示例,请参阅button_keypad预设。
这对小物件特别有用,因为小按钮笔刷可能会因vbsp的bug[澄清]导致面丢失。
Keyvalues
<div id="Name" style="display:grid; padding:0 0 0 2em; margin-block:.5em 1em">
Name (targetname) <target_source>
Glow Entity (glow) <目标名> (仅存在于 ![]()
之中)
Use Look-At Limit (min_use_angle) <字符串> (存在于自
以来) (也存在于
之中)
Move Direction (Pitch Yaw Roll) (movedir) <angle>
Delay Before Reset (-1 stay) (wait) <整数>
Speed (speed) <整数>
Health (Obsolete) (health) <整数>
Lip (lip) <整数>
Sounds (sounds) <integer choices>
hl2/scripts/game_sounds_world.txt或相应游戏的Soundscript文件中Buttons.snd开头的条目(后跟此表中Value列的数字)。Choices Value Description Default Sound Buttons 0None (Silent) common/null.wav 1Big zap & Warmup buttons/button1.wav 2Access Denied buttons/button2.wav 3Access Granted buttons/button3.wav 4Quick Combolock buttons/button4.wav 5Power Deadbolt 1 buttons/button5.wav 6Power Deadbolt 2 buttons/button6.wav 7Plunger buttons/button7.wav 8Small zap buttons/button8.wav 9Keycard Sound buttons/button9.wav 10Buzz buttons/button10.wav 11Buzz Off buttons/button11.wav 12latch locked doors/latchlocked2.wav 13Latch Unlocked doors/latchunlocked1.wav 14Lightswitch buttons/lightswitch2.wav 15small bleek buttons/button15.wav 16small deny buttons/button16.wav 17small doop buttons/button17.wav 18small tech deny buttons/button18.wav 19click and combine screen fuzz buttons/button19.wav 20roomy beep buttons/button20.wav Levers 21lever or wheel: turn + move sqeek buttons/lever1.wav 22lever or wheel: latch + release gas buttons/lever2.wav 23lever or wheel: ratchet + sqeek buttons/lever3.wav 24lever or wheel: large ratchet buttons/lever4.wav 25lever or wheel: clanky + gas release buttons/lever5.wav 26lever or wheel: latch + large metal thud buttons/lever6.wav 27lever or wheel: smaller ratchet buttons/lever7.wav 28lever or wheel: smaller lever move buttons/lever8.wav New buttons 31shock buzz buttons/button21.wav 32clickbeep buttons/button22.wav 33tech blip buttons/button23.wav 34clickbeepbeep open buttons/button24.wav 35small high blip buttons/button12.wav 36small tech fuzz blip buttons/button13.wav 37small click bleep (change to lightswitch) buttons/button14.wav Combine Buttons 40combine door lock - locked buttons/combine_button_locked.wav 41combine blip growl buttons/combine_button1.wav 42combine squick growl buttons/combine_button2.wav 43combine whine purr buttons/combine_button3.wav 44combine click talk buttons/combine_button4.wav 45combine click growl fizz buttons/combine_button5.wav 46combine click fizz (deny) buttons/combine_button6.wav 47combine click talker buttons/combine_button7.wav
Locked Sound (locked_sound) <integer choices>
Choices Value Description Default Sound 0None common/null.wav 2Access Denied buttons/button2.wav 8Small zap buttons/button8.wav 10Buzz buttons/button10.wav 11Buzz Off buttons/button11.wav 12Latch Locked doors/latchlocked2.wav
Unlocked Sound (unlocked_sound) <integer choices>
Choices Value Description Default Sound 0None common/null.wav 1Big zap & Warmup buttons/button1.wav 3Access Granted buttons/button3.wav 4Quick Combolock buttons/button4.wav 5Power Deadbolt 1 buttons/button5.wav 6Power Deadbolt 2 buttons/button6.wav 7Plunger buttons/button7.wav 8Small zap buttons/button8.wav 9Keycard Sound buttons/button9.wav 10Buzz buttons/button10.wav 13Latch Unlocked doors/latchunlocked1.wav 14Lightswitch buttons/lightswitch2.wav
Locked Sentence (locked_sentence) <integer choices>
Choices Value Description 0None 1Gen. Access Denied 2Security Lockout 3Blast Door 4Fire Door 5Chemical Door 6Radiation Door 7Gen. Containment 8Maintenance Door 9Broken Shut Door
Unlocked Sentence (unlocked_sentence) <integer choices>
Choices Value Description 0None 1Gen. Access Granted 2Security Disengaged 3Blast Door 4Fire Door 5Chemical Door 6Radiation Door 7Gen. Containment 8Maintenance area
Master (Obsolete) (master) <target_destination>
Flags
- Don't move : [1]
- Toggle : [32]
- 使按钮在被反复按下时触发"OnIn"和"OnOut"输出。
当同时设置"Damage Activates"时不会触发"OnOut"。解决方法是可以让此按钮"按下"另一个只设置了"toggle"和"don't move"标志的按钮。
- Touch Activates : [256]
- Damage Activates : [512]
- 设置后,按钮在被伤害时会触发"OnPressed"。与其他输入选项一样会遵守锁定状态。
"OnDamaged"会在按钮被按下时触发,即使被锁定也会触发。
- Use Activates : [1024]
- Starts locked : [2048]
- 默认锁定
- Sparks : [4096]
Inputs
- Lock
- 锁定按钮,使其无法使用。
错误:不要在按下状态时锁定;解锁后将无法返回。 [todo tested in ?]
- Unlock
- 解锁按钮,使其可用。
- Press
- 模拟按下按钮的操作。
- PressIn
- 模拟按下按钮的操作,将其移动到底部位置。
- PressOut
- 模拟松开按钮的操作,将其移动到顶部位置。触发OnPressed输出。
Outputs
- OnDamaged
- !activator = 造成伤害的实体
!caller = this entity
当按钮受到伤害时触发,无论是否锁定或是否设置了"Damage Activates"。
示例:可用于通过摧毁被锁按钮来开门,而按"+use"会播放"Deny"音效。
- OnPressed
- !activator = 按下按钮的玩家或触发此输入的实体
!caller = this entity
当按钮通过标志设置的任何方式被激活时触发。
- OnUseLocked
- !activator = 使用按钮的玩家
!caller = this entity
当按钮在锁定时被使用时触发。
- OnIn
- !activator = 导致按下的实体或最后伤害按钮的实体[证实]
!caller = this entity
当按钮到达按下位置时触发。
- OnOut
- !activator = 导致按下的实体或最后伤害按钮的实体[证实]
!caller = this entity
当按钮到达松开位置时触发。"Delay Before Reset"会在延迟结束后触发此输出。如果设置了"Toggle"标志,再次按下按钮会触发此输出。