Brush That Aims At Objects

Discussion in 'Mapping Questions & Discussion' started by Digaag Wa Riz, Dec 10, 2013.

  1. Digaag Wa Riz

    Digaag Wa Riz L3: Member

    Messages:
    121
    Positive Ratings:
    84
    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: Dec 12, 2013
  2. DonutVikingChap

    DonutVikingChap L5: Dapper Member

    Messages:
    227
    Positive Ratings:
    142
    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!
     
  3. Crash

    aa Crash func_nerd

    Messages:
    3,148
    Positive Ratings:
    4,746
    tf_point_weapon_mimic is very fun. I use it a bunch on Trainsawlaser.
     
  4. DonutVikingChap

    DonutVikingChap L5: Dapper Member

    Messages:
    227
    Positive Ratings:
    142
    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.
     
  5. Digaag Wa Riz

    Digaag Wa Riz L3: Member

    Messages:
    121
    Positive Ratings:
    84
    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)?

    It only shoots grenades, rockets, stickies, and arrows. If only it had a "target" key...
     
    Last edited: Dec 11, 2013
  6. Crash

    aa Crash func_nerd

    Messages:
    3,148
    Positive Ratings:
    4,746
    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.
     
  7. Digaag Wa Riz

    Digaag Wa Riz L3: Member

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