Facing the player.

Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
In hammer, does anyone know how to change the angle of an object so it is always facing the player no mater where the player is? I didn't think it was possible, but I'm trying to make a boss fight, and I was studying the bossfight from the campaign and wheatly did that. I want to do this so the boss I'm making doesn't look up or down to look at the player, but just to rotate along the z-axis.
Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Jul 25, 2013
Replied 28 minutes later
Try parenting it to a func_tank entity. Give it a pitch rate and range of 0 to prevent it from moving up and down, a yaw range of 360, and the yaw rate will determine how fast it can turn. The output OnFire will tell you that it's facing straight towards the player.

Note that you will have to add in an extra KeyValue without smartedit: "bullet 0". I still don't fully understand why, but it's necessary.

Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
Replied 1 hour later
Ok, thank you, however. how do you get the func_tank to face the player. Now that I know that is what I need to use, I have tested around to try to figure it out, and I have looked for tutorials and explanations online. Unfortunately, I am not finding anything. Does anyone know how to get the func tank to follow the player?
Avatar
Ultiman9711
118 Posts
Posted Jul 25, 2013
Replied 20 minutes later
Send an input to the func_tank as "SetTargetEntity", with parameter !player. No, that exclamation isn't a typo, remember to include that as well!
Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
Replied 4 minutes later
Yes, that was one of the things I tested. Unfortunately, it didn't work.
Avatar
FelixGriffin
2,680 Posts
Posted Jul 25, 2013
Replied 1 hour later
Then send it an Activate input.
Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
Replied 10 minutes later
My first thought when you said "active input" was an input that wasn't deactivated. I was using a logic auto for the input, so that couldn't be the problem. So I tried putting a trigger_multiple around and having it output "on touching". That sounds like it would be active. But that isn't working either. Sorry, I've only been using hammer for a couple months, so while I understand a lot about it, I don't get some of the finer details. What do you mean by "active input"?
Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
Replied 4 minutes later
And if it is one of the things I think it means, then I tried that too. I am thankful for the help so far though.
Avatar
FelixGriffin
2,680 Posts
Posted Jul 25, 2013
Replied 4 hours later
Sorry, what I mean is that the input itself is named Activate.

As in, place a logic_auto. Then add an output: OnMapSpawn > [func_tank] > Activate > [no parameter] > 0.00 > No. :smile:

Avatar
Goldenknighttim
182 Posts
Posted Jul 25, 2013
Replied 1 hour later
Yea, that worked. Lol, I feel a little dumb now for misreading your post and not thinking of that myself. Thanks a lot for all the help.
Avatar
Dafflewoctor
415 Posts
Posted Jul 29, 2013
Replied 4 days later
On the same topic, I am trying to make a "boss fight" (though you're not actually fighting someone in the room with you :wink:) and I was wondering how you get bombs to aim at the player. (sorry for bumping an old post but it was on the same topic.)
Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Jul 29, 2013
Replied 24 minutes later
I used RunScriptCode self.SetOrigin(GetPlayer().GetOrigin()); to send an info_target to the player's location, then aimed a trigger_catapult at it. There's an entity that's supposed to work but tends to launch bombs straight up, or you can just aim the catapult at the player if you don't want the "lock on" effect seen in the game.