VGUI help

Avatar
QuantumNarwhal
35 Posts
Posted May 20, 2014
Really want to know how to do VGUI in maps, I've googled it, youtubed it, and all I found was examples. Please do not link me to the dev wiki, I got confused there.
Advertisement
Registered users don't see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted May 21, 2014
Replied 1 day later
What sort of VGUI do you mean? Most things with that prefix need to be hard-coded, which is impossible in Portal 2.
Avatar
CamBen
973 Posts
Posted May 21, 2014
Replied 2 hours later
The easiest way to do it is to put a func_brush in the player's chest and parent the vgui brush in front of it, then on the chest brush, use a logic_measuremovement to make it move with the player's eye movement.
Avatar
josepezdj
2,386 Posts
Posted May 22, 2014
Replied 3 hours later

CamBen wrote:
The easiest way to do it is to put a func_brush in the player's chest and parent the vgui brush in front of it, then on the chest brush, use a logic_measuremovement to make it move with the player's eye movement.

IIRC, you can parent it straight to the player's 'Eye' attachment point instead. However, you will have the brush moving too much and sort of rolling, like if it truly was parented to an actual eye (tested)

What I do for my maps' entry titles and other pop-up messages to fake a Hud display, is to parent the func_brushes to !player.

@QuantumNarwhal: I've digged deep for some time now into modifying the HUD, how it is programmed and what entities are involved... if what you mean by "VGUI" is what you see displayed on screen. As Felix said this is hard-coded and you will probably need to use the "mod" structure to be able to achieve actual changes on the Portal2 HUD. The best guide on how to modify the HUD I found is this one. Even though it was written for Counter Strike, it basically works the same in other Source games.

Avatar
QuantumNarwhal
35 Posts
Posted Jun 13, 2014
Replied 22 days later

CamBen wrote:
The easiest way to do it is to put a func_brush in the player's chest and parent the vgui brush in front of it, then on the chest brush, use a logic_measuremovement to make it move with the player's eye movement.

Whenever I spawn, I just get stuck in the func_brush.

Avatar
CamBen
973 Posts
Posted Jun 13, 2014
Replied 1 hour later
Disable collisions on it
Avatar
QuantumNarwhal
35 Posts
Posted Jun 14, 2014
Replied 20 hours later

CamBen wrote:
Disable collisions on it

Thanks for the last bit, that was pretty stupid of me not to notice that. How do I name the player entity though? Its asking me to give a 'Movement reference'.

Avatar
CamBen
973 Posts
Posted Jun 14, 2014
Replied 3 hours later
These should be the keyvalues:

Entity to measure : (blank)
Measure reference : reference_target (info_target entity near the player)
Entity to move : brush_vgui_01 (whatever it is called)
Movement reference : reference_target

Then using a logic auto, give the measuremovement an output to set entity to measure to !player

Avatar
QuantumNarwhal
35 Posts
Posted Jun 25, 2014
Replied 10 days later

CamBen wrote:
These should be the keyvalues:

Entity to measure : (blank)
Measure reference : reference_target (info_target entity near the player)
Entity to move : brush_vgui_01 (whatever it is called)
Movement reference : reference_target

Then using a logic auto, give the measuremovement an output to set entity to measure to !player

Everything with the moving brush is fine now, and I've been trying to put the vgui_movie_display entity to display on the moving brush (to make it into some sort of video communicator type thing) but it just doesn't display. I've used a vgui_movie_display before and it's worked fine, the only difference is this time it's got a parent - the moving brush.

Avatar
Gemarakup
1,183 Posts
Posted Jun 25, 2014
Replied 36 minutes later
I think you should use a moving image instead, since the VGUI movie thing probably doesn't work when moving.
Avatar
QuantumNarwhal
35 Posts
Posted Jun 26, 2014
Replied 1 day later

yishbarr wrote:
I think you should use a moving image instead, since the VGUI movie thing probably doesn't work when moving.

I'll try a gif. If not, I can work with an image.

Avatar
FelixGriffin
2,680 Posts
Posted Jun 26, 2014
Replied 2 hours later
You can't use gifs (or pngs or jpegs) in Portal 2. You need to make a VTF and VMT.
Avatar
Gemarakup
1,183 Posts
Posted Jun 26, 2014
Replied 24 minutes later

FelixGriffin wrote:
You can't use gifs (or pngs or jpegs) in Portal 2. You need to make a VTF and VMT.

Yeah, that's what I meant. Convert your GIF to VTF, and make a UnlitGeneric VMT.

Avatar
josepezdj
2,386 Posts
Posted Jun 26, 2014
Replied 2 hours later

QuantumNarwhal wrote:
I've been trying to put the vgui_movie_display entity to display on the moving brush (to make it into some sort of video communicator type thing) but it just doesn't display. I've used a vgui_movie_display before and it's worked fine, the only difference is this time it's got a parent - the moving brush.

It is VERY possible to make that system to work, I just made it. Maybe you are not parenting the entities correctly or firing the correct outputs.

*I parented my vgui_movie_display to the func_brush.

The func_brush to the func_tracktrain

The func_tracktrain has as first stop its due path_track

The path_track1 leads to path_track2

A prop_button move the train and enable/disable the vgui_movie_display and everything works like a charm! *

Make sure that you also put the correct video movie name and full path and file extension (for example: media/valve.bik)

Good luck

Avatar
QuantumNarwhal
35 Posts
Posted Jul 01, 2014
Replied 4 days later

josepezdj wrote:
QuantumNarwhal wrote:

I've been trying to put the vgui_movie_display entity to display on the moving brush (to make it into some sort of video communicator type thing) but it just doesn't display. I've used a vgui_movie_display before and it's worked fine, the only difference is this time it's got a parent - the moving brush.

It is VERY possible to make that system to work, I just made it. Maybe you are not parenting the entities correctly or firing the correct outputs.

*I parented my vgui_movie_display to the func_brush.

The func_brush to the func_tracktrain

The func_tracktrain has as first stop its due path_track

The path_track1 leads to path_track2

A prop_button move the train and enable/disable the vgui_movie_display and everything works like a charm! *

Make sure that you also put the correct video movie name and full path and file extension (for example: media/valve.bik)

Good luck

Where does the func_tanktrain come in? As in, what is it's purpose?

Advertisement
Registered users don't see ads! Register now!
Avatar
TeamSpen210
608 Posts
Posted Jul 01, 2014
Replied 3 hours later
func_tracktrains basically move along a path defined by path_tracks. They're useful if you want to move things more than in one direction. In this case you could attach your communicator to a rail and make it follow the player around, like what Whealtey does in the BTS area.