Help with triggers and use

Avatar
CamBen
973 Posts
Posted Mar 17, 2013
So I've go a bit of an issue here, I want a cube to touch a trigger, and then be +used so it flies over to the player and is picked up. So this is what I tried

Onstarttouch !activator fireuser3

And on the cubes I have

Onuser3 @clientcommand command ent_fire !caller use

Now, I have / bound to ent_fire !picker use, and it works the right way, pulling in a straight path then picking it up. However, the player is not going to be looking directly at the cube for the most part, so !picker is not an option.

The user3 output is the one not working, because for some reason !caller is not valid, and I even tried !activator but still its not working so, I'm just wondering if there is a way to make a clientcommand or servercommand give a command to whatever called it?
you could AddOutPut when the cube touches the trigger

Advertisement
Registered users don’t see ads! Register now!
Avatar
srs bsnss
552 Posts
Posted Mar 18, 2013
Replied 11 hours later
Is it not working in-game, or is hammer just indicating that it's invalid? If it's the latter then there's a chance it does actually work.
Avatar
ChickenMobile
2,460 Posts
Posted Mar 18, 2013
Replied 1 hour later
Forcing to pick up a cube is a little harder than what first seems. What I suggest here is to actually pass the command 'Use' to a point_servercommand. I did a bit of testing and it seems like it cannot be called from an actual input that is from another entity.

Trigger:
OnStartTouch -> point_servercommand -> Command -> ent_fire cubename Use

Avatar
CamBen
973 Posts
Posted Mar 18, 2013
Replied 4 hours later

srs bsnss wrote:
Is it not working in-game, or is hammer just indicating that it's invalid? If it's the latter then there's a chance it does actually work.

Working in hammer, not ingame.> ChickenMobile wrote:

Forcing to pick up a cube is a little harder than what first seems. What I suggest here is to actually pass the command 'Use' to a point_servercommand. I did a bit of testing and it seems like it cannot be called from an actual input that is from another entity.

Trigger:
OnStartTouch -> point_servercommand -> Command -> ent_fire cubename Use

ok, got it. :thumbup: but I want this to be able to happen to any cube that happens to touch that trigger, so would it be possible to temporarily rename a cube with addoutput so it is named "cubepickup" and then named back after it is dropped by the player?

Avatar
TopHATTwaffle
113 Posts
Posted Mar 18, 2013
Replied 2 hours later
Yes you can. Very easily as well. When you want it to be renamed, just rename it with "Addouput" "Targetname CUBEPICKUP" then have all of the cubes have the following output:

Ondrop -> CUBEPICKUP -> Addoutput -> "Targetname NULLCUBE"

Avatar
CamBen
973 Posts
Posted Mar 18, 2013
Replied 10 hours later
Thanks for all the help, it's working now!
Avatar
FelixGriffin
2,680 Posts
Posted Mar 24, 2013
Replied 5 days later
Also, it DOES seem to work if the cube has something like OnUser3 !self Use. Then FireUser3 will act like Use should.
Advertisement
Registered users don’t see ads! Register now!
Avatar
CamBen
973 Posts
Posted Mar 25, 2013
Replied 14 hours later
Oh, cool. Well, I'll have to try that again, possibly