Getting a model to look at you

Discussion in 'Mapping Questions & Discussion' started by static2601, Jun 8, 2013.

  1. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    I was wondering how a would get a model or something to look at you or rotate on the z axis and follow you as you move around. It would only follow people within a set distance. I have a lot of experience in hammer (3+ years) but I can't think of a way to do this. I would think id have to parent the model to a func rotate or soemthing and have it follow a target thats within a trigger area. Thanks
     
  2. The Asylum

    aa The Asylum

    Messages:
    1,658
    Positive Ratings:
    439
    So is this going to be used for something like a health pickup or something similar? Is this a custom model? You may be better off using an env_sprite depending on what you have in mind
     
  3. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    it was gonna be a custom model, I tried a few things, Might be easier for me to just make a plugin that gets client position and changes the model angle to the clients position. Id rather have it in the map though.
     
  4. Crash

    aa Crash func_nerd

    Messages:
    3,063
    Positive Ratings:
    4,550
    I could think of a super sloppy way to do it involving a bunch of triggers cut out of a circular brush that trigger each rotation manually and it wouldn't be that accurate, but there is probably a better way than that.
     
  5. Beetle

    Beetle L9: Fashionable Member

    Messages:
    627
    Positive Ratings:
    141
    You're probably not going to get the result you want with Hammer alone. Hammer has enough problems with rotating things to begin with (in TF2)
     
  6. Crash

    aa Crash func_nerd

    Messages:
    3,063
    Positive Ratings:
    4,550
    I've used momentary_rot_button using this method for the radar dish in Stoneyridge and the spinning train in Trainsawlaser. I imagine it could be repurposed for something similar, it's just a matter of getting the proper angle of rotation set up to some sort of input.
     
  7. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    LOL Yeah I could do that and thought about it before, Id make a cylinder shaped trigger an cut it into a hundred pie slices and when each slice is touched, will change the move distance of the prop_door_rotating. That would be a little sloppy but would probably work but run my ent data through the roof, and its already pretty high. Ill just stick with a plugin for now.
     
  8. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    I could try that too, ill take a look at it later, thanks.
     
  9. Faux Rhinoceros

    aa Faux Rhinoceros Also known as Dr. Element

    Messages:
    1,470
    Positive Ratings:
    1,363
    ABS made an entry for the magnificent tunnel that had a door that came closer to the floor as you approached it, and further away from it when you moved away. All completely smoothly.

    I imagine something similar could be done here.
     
  10. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
  11. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,102
    Positive Ratings:
    5,982
  12. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    Step 1: Be handsome
    Step 2: Don't be ugly

    On a more serious note the door that Element mentions wouldn't really be relevant to this because that was just a linear relationship made possible with point_proximitysensor.

    There isn't really any simple and smooth way to do what you are asking, but whatever method you end up picking you would want a momentary_rot_button instead of a door, because it supports a variable position input rather than messing around with changing move distances.
     
  13. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,816
    Positive Ratings:
    4,655
    How do character's eyes look at you? Would that be able to be tapped into?
     
  14. Faux Rhinoceros

    aa Faux Rhinoceros Also known as Dr. Element

    Messages:
    1,470
    Positive Ratings:
    1,363
  15. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    Wow very nice! i love how the hallway broke apart and flipped over to become the path.(reminded me of Farcry 3 a little) Didnt know something like that was possible in Source. Must of used alot of entities. I would love to make something like this. I seen the door, Im guessing a trigger_look with velocity flagged.
    The last part where I had to jump to the door to the bedroom, I was a scout and had to double jump, how would you get there if your not a scout?
     
  16. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    I was trying trigger_look and logic_playerproxy, didnt work. Ill try the point_proximity_sensor.
     
    Last edited: Jun 8, 2013
  17. Faux Rhinoceros

    aa Faux Rhinoceros Also known as Dr. Element

    Messages:
    1,470
    Positive Ratings:
    1,363
    i have an idea how it could theoretically be done, but it would require an entity setup that can calculate inversed trigonometrical equations.

    Which i can't think of a way of doing.

    Valve needs to make a more detailed variable system.
     
  18. static2601

    static2601 L2: Junior Member

    Messages:
    79
    Positive Ratings:
    4
    well i think i need to get the client angles and set the angles of the model to them. I know how to do it in soucepawn but not hammer. I forget how exactly, though Ive done it once. Right now im trying to use point_proximity_sensor to detect my angles, targetname !activator(dont think it works like this) and trying to move the momentary_rot to a position of what im not sure yet.
    Ill post something if I ever figure it out.
     
  19. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    1. I don't think point_proximitysensor will work... UNLESS Element elaborates on his statement. I've done pseudo-trig with entities before... what were you thinking of?

    2. !activator only works as the target of an output (...maybe the parameter too? I can't really think of when that would be used, nor do I remember trying).

    3. mom_rot_bot position is a 0-1 range, 0 being "closed" and 1 being 100% of the move distance being traveled.

    4. about my map, the last platform slowly floats over there, a lot of people were too impatient to notice this, so you aren't alone. and no, it wasn't a trigger_look, like I said it was a p_ps. You can read more about it if you want.
     
    Last edited: Jun 9, 2013
  20. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,816
    Positive Ratings:
    4,655
    How did you do the sentry-defense that locks onto players in traingrid, Booj? Is that built in to the rigging of the sentry?