Launch console commands?

Avatar
josepezdj
2,386 Posts
Posted Jun 05, 2013
Replied 8 minutes later
Oh, of course! Sorry I'm dumb! it DOES make a difference the place where you place the func_button in hammer in the beginning if you use the SetParentAttachmentMaintainOffset! Place it exactly where you want it to be in front of the player then fire those outputs I posted... I think this will be right what you want to achieve.
Advertisement
Registered users don’t see ads! Register now!
Avatar
bawng
14 Posts
Posted Jun 05, 2013
Replied 25 minutes later
No need to apologize! I'm just very grateful that you are helping me! :smile:

Anyway, I tried placing it at various distances in front of the info_player_start. Too close, and the player gets stuck. Just a little bit further and the player gets stuck when moving forward. Event further away, player does not get stuck.
In all cases, the button jumps around erratically with movement. Also, the button remains unpressable.

I must be doing something very wrong. :smile:

Avatar
bawng
14 Posts
Posted Jun 05, 2013
Replied 2 hours later
I decided to not override +Use and instead trigger the activity by simultaneously pressing Attack and Attack2.

This works fine. What I am doing with this is switching between portal gun and my custom rocket launcher.

However, the rocket launcher isn't really working as I want it to. I have it parented to !player, and SetParentAttach to "eyes" and this works sort of well. However, apparently "eyes" does not follow the crosshair movement very good. While looking forward, it points slightly downwards. The further up you look, the further down (relatively) it is pointed. So, if looking straight ahead (0degrees) my rocket launcher points maybe -20 degrees. If looking up 45 degrees, my rocket launcher points to perhaps 10 degrees. It is similarly off when looking downwards.

I figure that the player model simply doesn't move in a 180 degree angle as the viewport does.

So, I suppose I should use some other way the introduce a rocket launcher.

The simplest would be to import the rpg from Half-Life 2, but I have no idea on how to do that, or even if it would work.

The other way would be to make my rocket launcher (a physbox) always point towards the mouse crosshair, but I don't know how to do that either. :smile:

Avatar
FelixGriffin
2,680 Posts
Posted Jun 05, 2013
Replied 28 minutes later
The RPG would not work, you can't import weapons. The models, yes, but not the code. The best way might be to have the player pick up the weapon with +use when needed, then have it be a func_physbox with preferred carry angles 0 0 0. Look at the trailer for the sphere cannon thingy, it uses that method.
Advertisement
Registered users don’t see ads! Register now!
Avatar
bawng
14 Posts
Posted Jun 05, 2013
Replied 35 minutes later
Oh, too bad.

I'll try that! Thanks!