Brush That Aims At Objects

D

Digaag Wa Riz

Question!

I'm going to make my first mvm map that is going to have something that's either crazy awesome or extremely gimmicky depending on your disposition towards aerial bombardment. Okay, so I was wondering if there's an entity I can use that can point at another entity. Specifically, a brush-based entity. It obviously must be able to turn in any direction while maintaining it's orientation towards something even if it's parented to a moving object.

I know there are point entities for this but the point is to make it work with the tf_point_weapon_mimic shooting rockets.



I have an idea but I don't know how to accomplish it. I can use some entity to point at what I want the tf_point_weapon_mimic to shoot at, and then pass the pointing entity's angles as the tf_point_mimic's angles.


EDIT: I now have a working version. Have a look.
 
Last edited by a moderator:

DonutVikingChap

L5: Dapper Member
Mar 15, 2013
233
139
Start by making a func_brush that you can attach it to, then put your brush based entity on it, and then I think you can use the logic_measure_movement enitity and set it to sit on the base and point at the object you want. You can also set it to use mouse movement with some clever logic which is what I used to make my mouse-controlled turrets in TF2.

TopHATTwaffle made a really good tutorial on it, but not everything he says applies to TF2 like it does in CSS: http://www.youtube.com/watch?v=3CIWqRkLQ3g

If you're smart with entities, you can use that tutorial to get some understanding on how to use the logic_measure_movement and figure out the rest on your own. Good luck!

By the way, I've never heard of tf_point_weapon_mimic. Is that a new addition? I'll have to try that for my turrets!
 
D

Digaag Wa Riz

If I use a logic_compare_movement will the tf_point_weapon_mimic still be able to point at a target if the tf_point_weapon_mimic ITSELF is moving (parented to a func_tracktrain)?

Does it actually mimic a TF2 weapon like the name implies?
So you can shoot minigun bullets out of thin air? Because if so, that's really cool.

It only shoots grenades, rockets, stickies, and arrows. If only it had a "target" key...
 
Last edited by a moderator:

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
I can't say I've ever targeted anything, but you could always parent a brush to the train that is doing the targeting and then parent the weapon entity to that.

Combining patenting can lead to some complex movements.
 
D

Digaag Wa Riz

I found out a way that I can't believe works. How do I post vmfs? I really wanna show you guys. Basically with the magic of path_tracks, func_tracktrains, a tf_point_weapon_mimic, and loads of patience...I've managed to get it working.

In it's current form, it's a very crudely put together (and tiny) AC-130 gunship that travels in a fixed path and can fire on any target. For my mvm map I was thinking of allowing the player to pay credits to fire the cannon instead of using a logic_timer to trigger it like in this example. It's actually pretty cool and can target from any direction.