[help] Cannon / Turret

Discussion in 'Mapping Questions & Discussion' started by PootisSpencer, Mar 2, 2013.

  1. PootisSpencer

    PootisSpencer L1: Registered

    Messages:
    11
    Positive Ratings:
    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.


    [​IMG]
     
  2. Egan

    aa Egan

    Messages:
    1,319
    Positive Ratings:
    1,522
  3. PootisSpencer

    PootisSpencer L1: Registered

    Messages:
    11
    Positive Ratings:
    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.
     
  4. henke37

    aa henke37

    Messages:
    1,955
    Positive Ratings:
    465
    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.
     
  5. PootisSpencer

    PootisSpencer L1: Registered

    Messages:
    11
    Positive Ratings:
    3
    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.
     
  6. PootisSpencer

    PootisSpencer L1: Registered

    Messages:
    11
    Positive Ratings:
    3
    hm, seems that func_rotate used in above video
    won't work in TF2.
     
  7. Egan

    aa Egan

    Messages:
    1,319
    Positive Ratings:
    1,522
    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: Mar 5, 2013
  8. WhyNott

    WhyNott L1: Registered

    Messages:
    27
    Positive Ratings:
    1
    Wouldn't it be just easier to use func_tank?