Button-activated aerial faith plate SORT of works...

Avatar
gridmonkey
5 Posts
Posted May 22, 2011
Hey guys,

I'm working on my first map and spent pretty much all day trying to get this to work.

The goal is to have a catapult which fires immediately at the press of a button, launching a cube.

So basically I created a catapult in the floor using the wiki as a guide, and directly above it a trigger_catapult brush. The trigger starts out disabled, so that walking over the faith plate or placing an object on it doesn't do anything. Nearby is a button, which when pressed enables the trigger (and then disables it again after 1 second, so that the button/launcher combo can be used repeatedly). The button also outputs a FireUser1 to the trigger which activates both the launch animation and sound.

Pressing the button perfectly triggers the firing animation and sound, but doesn't launch the cube, even though I have "Everything" checked in the trigger_catapult's Flags tab. The cube just sits there, and the catapult fires right through it.

Now, if I stand on the faith plate and then drop a cube on the button, I get launched perfectly.

Also, I've found that if I repeatedly run over and over the button, it EVENTUALLY launches the cube after half a dozen or so attempts. Weird.

Can anyone pinpoint exactly what I'm missing here? Getting frustrated. Thanks.

Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted May 22, 2011
Replied 2 hours later
You are probably making things more complicated than they have to be. Why don't you use a filter so the cube is the only thing that activates it?

Also make sure that Physic objects are ticked in your flags as well. 'everything' doesn't necessarily mean everything :S

Avatar
gridmonkey
5 Posts
Posted May 23, 2011
Replied 22 hours later
Grrr, still pulling my hair out over this.

I experimented with the flags, but that doesn't seem to be the issue. It DOES launch the cube, just not consistently. Also I don't want to filter/restrict it too much because I need to be able to launch the player and even other items besides cubes.

So now what?

I noticed that if I drop the cube on the catapult and QUICKLY press the button (like within a second or so) it launches every time. But if I leave the cube sitting there for longer than that and then fire, it's a miss.

I've been having a lot of trouble with these trigger_catapult brush entities, but I can't tell if it's because I'm brand new at this or if they are just glitchy. On another part of the map, I have a catapult that is mounted to a rotating platform, so that you can aim the catapult one direction or another by pressing a button. It all works beautifully except that the launched object always goes the same direction, regardless of where the catapult is pointed. The catapult and trigger are both parented to the platform so in theory everything should rotate as a unit, but for some reason the trigger stubbornly refuses to rotate.

Again, grrrrrrrr. :mad:

Avatar
msleeper
4,136 Posts
Admin
Posted May 23, 2011
Replied 22 minutes later

gridmonkey wrote:
The button also outputs a FireUser1 to the trigger which activates both the launch animation and sound.

You should not be doing it this way. This is a perfect example of when to use a logic_relay. Have the button trigger the logic_relay, and have the logic_relay enable the trigger_catapult, as well as play the sound and animation.

You say that the cube will be launched if you quickly press the button. Is the cube still in motion when this happens, like has it settled to a stand still or is it moving around? I'm wondering if the trigger_catapult is not triggered by a stationary object for some reason. You could try adding a phys_explosion with a VERY small value, and have it fire at the same time you enable the trigger_catapult.

You say the trigger_catapult starts out disabled; do you ever Disable it? If so, are you giving it enough time to be activated and fired?

Avatar
ChickenMobile
2,460 Posts
Posted May 23, 2011
Replied 7 minutes later
Maybe a stationary cube can't 'StartTouch' a Catapult trigger?

P.S. For the second paragraph: have you parented the info_target that the catapult launches to, to the rotating platform?

Avatar
CroSSGunS
23 Posts
Posted May 23, 2011
Replied 1 hour later
There's a "OnStartTouching" output isn't there? Or something like it?
Avatar
CraigChrist
41 Posts
Posted May 23, 2011
Replied 12 hours later
If i'm uderstanding correctly the catapult won't launch the cube if the trigger_catapult is enabled after the cube is settled.. thats probaby because physics turn off when the object is not moving so it doesnt calculate it when it's not needed.

I would solve this guerilla-style :smile: . Put point_push near the catapult with some small values and trigger it just when the catapult is activated and then quicky turn it off.. it should be enough to wake the cube so it can be launched.

Hope i helped.

Cheers

Avatar
gridmonkey
5 Posts
Posted May 24, 2011
Replied 9 hours later
Thank you all for the suggestions. These all seem like perfectly good ideas, but unfortunately nothing seems to work. I tried both the point_push and the phys_envexplosion and succeeded in pushing the cube around a bit, but that's it. I can still launch the cube if I press the button immediately after setting it down on the catapult, or alternatively by rapid-firing the button 4-6 times. Otherwise, it just sits there.

chickenmobile wrote:
For the second paragraph: have you parented the info_target that the catapult launches to, to the rotating platform?

I'm actually not using a target. The trajectory doesn't have to be exact, it just needs to go one direction or the other.

msleeper wrote:
You should not be doing it this way. This is a perfect example of when to use a logic_relay. Have the button trigger the logic_relay, and have the logic_relay enable the trigger_catapult, as well as play the sound and animation.

Okay, I added the relay. In this case it doesn't make any difference that I can tell but if that's the "right" way to do it, I'll get in the habit now. Thanks for the tip.

Quote:
You say the trigger_catapult starts out disabled; do you ever Disable it? If so, are you giving it enough time to be activated and fired?

I assume you meant to ask if I ever enable it (or else I'm really lost!) If so then yeah, enabling the trigger is the first thing in the sequence: Button activates logic relay which enables trigger with zero delay. One-tenth of a second later the noise & animation are set off. After half a second, the trigger is disabled again.

I'm very curious about the second question. Exactly how much time is "enough time" for it to be activated? I've moved all these time delays around by as much as a full second but so far I haven't noticed any difference -- the cube just gets ignored.

CroSSGunS wrote:
There's a "OnStartTouching" output isn't there? Or something like it?

This is mentioned in the Wiki entry on Triggers, but I don't really understand what it is or how to use it:
* OnStartTouch
OnEndTouch
- Outputs called whenever a entity matching all filters enters/leaves the trigger, regardless of whether it has passed any further tests. The entity that entered or left is the !caller.*

Avatar
msleeper
4,136 Posts
Admin
Posted May 24, 2011
Replied 11 minutes later

gridmonkey wrote:
I assume you meant to ask if I ever enable it (or else I'm really lost!) [. . .] After half a second, the trigger is disabled again.

No, I was asking when or if the trigger is ever disabled, and you answered me here. I wonder if you aren't giving it enough time to work - IE, half a second is too short of time.

You also seemed to miss a critical part of what I said:

msleeper wrote:
You say that the cube will be launched if you quickly press the button. Is the cube still in motion when this happens, like has it settled to a stand still or is it moving around? I'm wondering if the trigger_catapult is not triggered by a stationary object for some reason. You could try adding a phys_explosion with a VERY small value, and have it fire at the same time you enable the trigger_catapult.

Try this. I have a feeling the phys_explosion will solve all your problems.

Avatar
tungsten
8 Posts
Posted May 24, 2011
Replied 12 hours later
I can't test it at the moment, but you might try setting Use Threshold Check to False. My understanding is that an object has to be moving to trigger a trigger_catapult. Use Threshold Check <boolean> along with Lower Threshold <float>, Upper Threshold <float>, and Entry Angle Tolerance <float> control how much movement the object needs to trigger it.
Avatar
gridmonkey
5 Posts
Posted May 24, 2011
Replied 25 minutes later

msleeper wrote:
I wonder if you aren't giving it enough time to work - IE, half a second is too short of time.

Another good idea, but I tried changing it to two seconds and it still doesn't work, so I don't think that's it.

msleeper wrote:
You also seemed to miss a critical part of what I said:

msleeper wrote:

...I'm wondering if the trigger_catapult is not triggered by a stationary object for some reason. You could try adding a phys_explosion with a VERY small value, and have it fire at the same time you enable the trigger_catapult.

Try this. I have a feeling the phys_explosion will solve all your problems.

No no, I promise I didn't miss it! I appreciate the suggestion and it made a lot of sense so it was the first thing I tried. See the first part of my post above^^. (I couldn't find any entity named phys_explosion so I used env_physexplosion -- hopefully that's the one you were thinking of.)

tungsten wrote:
I can't test it at the moment, but you might try setting Use Threshold Check to False. My understanding is that an object has to be moving to trigger a trigger_catapult. Use Threshold Check along with Lower Threshold , Upper Threshold , and Entry Angle Tolerance control how much movement the object needs to trigger it.

Another good idea ...but again, no effect. :angrysquare:

Once again thanks everyone for your thoughts. I am starting to think this is hopeless and I'll just have to scrap the map. Maybe it really is some sort of a glitch with the trigger.

Avatar
Marlovious
111 Posts
Posted May 26, 2011
Replied 2 days later
I have this working. You need a trigger_push with the push direction set to -90 0 0 under your trigger_catapult.

Check out my quick .vmf

Proof of concept AFP fire on button press.

&

Avatar
gridmonkey
5 Posts
Posted May 28, 2011
Replied 1 day later

Marlovious wrote:
I have this working. You need a trigger_push with the push direction set to -90 0 0 under your trigger_catapult.

Check out my quick .vmf
Proof of concept AFP fire on button press.

Woohoo!! Thank you thank you! I'm out of town until tomorrow night, but I will try it the moment I get home. :smile:

Advertisement
Registered users don’t see ads! Register now!
Avatar
Marlovious
111 Posts
Posted May 28, 2011
Replied 1 hour later
No problem. I'd like to see where you use it.