Detect +use with enable/disable?

Avatar
FelixGriffin
2,680 Posts
Posted Mar 08, 2014
I'm trying to find a parentable brush entity that can detect +use, such as a func_button, but which can have its solidity toggled like a func_brush (and not block +use when disabled). Is there such a brush entity in Portal 2?

In essence, I need to detect +use on a motiondisabled cube, but not block the player from picking it up when it's not motiondisabled.

Advertisement
Registered users don't see ads! Register now!
Avatar
TeamSpen210
608 Posts
Posted Mar 08, 2014
Replied 37 minutes later
Couldn't you just kill the button when the cube is motion enabled and SpawnAtEntityOrigin it when the cube is disabled?
I think there's a non-FGD input (I saw ingame) that lets you set the origin of an object local to it's parent, if the input exists for func_buttons you could move the button to 10000 units away from the cube to disable it.
Avatar
FelixGriffin
2,680 Posts
Posted Mar 09, 2014
Replied 15 hours later

TeamSpen210 wrote:
Couldn't you just kill the button when the cube is motion enabled and SpawnAtEntityOrigin it when the cube is disabled?
I think there's a non-FGD input (I saw ingame) that lets you set the origin of an object local to it's parent, if the input exists for func_buttons you could move the button to 10000 units away from the cube to disable it.

The first option won't work with cubes from droppers, because I don't know what the targetnames of the cubes will be until runtime.

The second might cause problems with the distant button swinging around through triggers and such, but I'm inclined toward it unless there's a better solution.

Avatar
HMW
806 Posts
Posted Mar 09, 2014
Replied 2 hours later
The department of trying stuff until it explodes, writes:

Turn off "smart edit" and add a "spawnflags" attribute to the cube, with the value 256.
This corresponds to the "generate output on +use" flag that some other entities have, and will generate an "OnPlayerUse" event when the player +uses the cube, even if it's motion-disabled.

If you just want the player to be able to pick it up, maybe 64 works too. ("Enable motion on Physcannon grab")

Avatar
Ace Ryder
45 Posts
Posted Sep 30, 2014
Replied 6 months later
Is there a way to make say a func_button detect +use and -use, so that something turned on on +use and off on -use....essentially meaning the player has to hold the use key?
Avatar
FelixGriffin
2,680 Posts
Posted Oct 01, 2014
Replied 1 day later
I don't think so. You could try a momentary button, depending what you need it for.
Avatar
Ace Ryder
45 Posts
Posted Oct 01, 2014
Replied 35 minutes later
I need something that works exactly like func_button_timed
Avatar
TeamSpen210
608 Posts
Posted Oct 02, 2014
Replied 1 hour later
Found something - the Alias console command lets you bind a command to a another command, so you can trigger relays or something using ent_fire from that.
Avatar
josepezdj
2,386 Posts
Posted Oct 06, 2014
Replied 4 days later
@Ace Ryder: what exactly are you attempting to make? Please explain, I might have an alternate way to do it, but I'd like to test it out achieving what you are attempting to make, understand?
Advertisement
Registered users don't see ads! Register now!
Avatar
Ace Ryder
45 Posts
Posted Oct 06, 2014
Replied 5 hours later
@josepezdj I'd like to have two valves, I want both players to be holding e on the valves and trigger a coop_manager. So if one person stops holding e for even a picosecond, the trigger can't work.