[help] Cannon / Turret

PootisSpencer

L1: Registered
Nov 28, 2011
11
3
This isn't a major project, more of a learning exercise.


I have this tower-mounted cannon and I want it to track/follow players and tfbots so that the it will point at that player (and eventually fire rockets) at them.

I know how to spawn entities, so getting the rockets to work is easy, but I don't know how to make the cannon move and point to it's target.


turrettower.png
 

PootisSpencer

L1: Registered
Nov 28, 2011
11
3
I've actually seen parts of this video before, but it's a 3-part episode mostly consisting of how to make basic shapes, and no working demo to prove that all of this works...

I was hoping for a more direct answer such as make <entities> and connect <output> to <input> and viola!

fine, I'll have to sit through all of it I suppose...
thanks.
 

henke37

aa
Sep 23, 2011
2,075
515
Thing is, it is rather complicated. It needs to track a single player. To do this it needs to select said player out of all the players on the server. Then it needs to rotate towards the selected player, probably with a maximum rotation speed. And once it has aimed it needs to run a timer to fire only every N time units.

It really sounds like something you need c++ code for.
 

PootisSpencer

L1: Registered
Nov 28, 2011
11
3
It really sounds like something you need c++ code for.

is that possible without requiring the server or client requiring said c++ code?
I don't want to have to require external files just get 1 object on a single specific map to work.
would be nice if TF2 included HL2's turret entities.
 

Egan

aa
Feb 14, 2010
1,375
1,721
You'll have to make something tricky out of func_door_rotating if you do actually want it to work. And he goes over all of the entity work getting it actually working, "no working demo to prove that all of this works...". He shows that at the end of part 3.

The only examples I can recall seeing of something like this were in those CS:S war maps, but they too used func_rotating for most of the stuff. You could do it with plugins for sure, but I don't think that's what you were goin' for, was it? :p

Edit: There was once a tank test map on here that I had downloaded at one time where you could control the entire tank remotely and spin the top to rotate the barrel around. I recall that working, so somehow it's possible. (I tried searching for the actual map, but can't find it, sorry :( )
 
Last edited: