Ekkruker@Posted: Thu Aug 12, 2004 6:22 am :
A few people have been asking about this, and they are great anyways, so here goes:


First, right click and add a "env->env_storagecabinet". You'll be left with an awkward square that doesn't look quite like a storage cabinet. To fix this, press 'N' and put 'anim' in key and 'open' in val. Hit enter and it shows the correct model. (Press 1 to space the grid by one. Press 4 to go back to default).

Next, create a thin brush as so:

Image(Click Image for Full Size)

Make sure its aligned as such. Now, select the brush and give it the texture 'common->entitygui'. Now click the GUI button and select 'controlpanels->cabinet'. Next are some keys you must set as you want:

gui_parm1 -> This is the first number of the passcode. Put only one digit.
gui_parm2 -> This is the second number. One digit.
gui_parm3 -> This is the third number. One digit as well.
gui_parm4 -> The name that appears on the GUI.
gui_parm5 -> This is the number that appears in the upper right of the GUI. Just for show, no importance.

Now you have that set up you have to connect the GUI to the locker itself. Set the GUI's 'target' key to the locker's 'name' key.

Next, plop down a trigger->relay_trigger in front of the locker. Back at the GUI, set the GUI's 'target2' key to the relay_trigger's 'name' key.

This is the time you put the items into the locker. You might even put a shelf into the locker (a brush with a shelfy texture) and put stuff on there. That part is up to you. Put whatever item you want in the locker now. Next, select the relay trigger and change its 'target1' to the first item's 'name, its 'target2' the the second, 'target4' to the fourth, 'target748' to the seven-hundred eigth and so on. Then, set each item's 'triggerFirst' key to '1'.

Now, the cabinet has no collision. The way I got around this was to put clip brushes (brushes with the texture 'common->clip_plusmovables') around the very edges of the cabinet and on top and such. Just put them around until you get it so that the camera can never go inside the cabinet.

I hope this helps, and Lophyte gets a lot of credit for this too, I didn't figure it out alone! :P


EDIT: The piece that the gui must be on needs to be a func_static. After you shape and texture it, right click with it selected and go to func->func_static and it will change it. Thanks to pad for pointing this out.



pad@Posted: Thu Aug 12, 2004 8:06 am :
It is all fine, but haven't You forgotten to write that locker should be func_static ? Without that my locker didn't work.



PsychoDad@Posted: Thu Aug 12, 2004 8:12 am :
Nice one!

One question: How do I change the tutorial, so that a locker is already open?



The_Hell@Posted: Thu Aug 12, 2004 9:23 am :
Hey! I was supposed to write a tutorial :twisted:
I figured everything out, but it was late in my country so i went to sleep...



Ekkruker@Posted: Thu Aug 12, 2004 9:35 am :
pad wrote:
It is all fine, but haven't You forgotten to write that locker should be func_static ? Without that my locker didn't work.


Er, be more specific about didn't work..



pad@Posted: Thu Aug 12, 2004 10:10 am :
I meant i hadn't seen it at all.



Ekkruker@Posted: Thu Aug 12, 2004 10:12 am :
Ekkruker wrote:
You'll be left with an awkward square that doesn't look quite like a storage cabinet. To fix this, press 'N' and put 'anim' in key and 'open' in val. Hit enter and it shows the correct model.


Did you do that part?



pad@Posted: Thu Aug 12, 2004 10:25 am :
Yes i did. I am a total newbie, so i followed Your tutorial step-by-step.
On picture You presented locker's brush has light blue color (like all statics), so i tried in that way and then it worked all ok.
Sorry if i misunderstood something - as i said - i am newbie.



Ekkruker@Posted: Thu Aug 12, 2004 10:54 am :
pad wrote:
Yes i did. I am a total newbie, so i followed Your tutorial step-by-step.
On picture You presented locker's brush has light blue color (like all statics), so i tried in that way and then it worked all ok.
Sorry if i misunderstood something - as i said - i am newbie.


Ok, but what did you do exactly (to make it a static)? If there is something wrong that you had to do I'll need to add that on :P.

Also, im a newb too: I just started the editor on Sunday :P. This editor is fast learnin'. :D



pad@Posted: Thu Aug 12, 2004 11:15 am :
In my final version i :
- created brush
- changed it to patch (Patch->Simple Patch Mesh...)
- put it in proper position (rotate, move, etc.) - patch is flat so i just put it in front of desired surface
- changed it to 'func_static'

Entity parameters and all other actions (trigger etc.) exactly same as described in tutorial.



Ekkruker@Posted: Thu Aug 12, 2004 11:17 am :
pad wrote:
In my final version i :
- created brush
- changed it to patch (Patch->Simple Patch Mesh...)
- put it in proper position (rotate, move, etc.) - patch is flat so i just put it in front of desired surface
- changed it to 'func_static'

Entity parameters and all other actions (trigger etc.) exactly same as described in tutorial.


OH your talking about the thingo the GUI goes on. I thought you were talking about the locker itself.. Yes it needs to be a func_static I forgot to mention that. I'll add it now.



Rayne@Posted: Thu Aug 12, 2004 11:55 am :
and yes, use a simple patch mesh when you need ONE SIDED surfaces... :D



Ekkruker@Posted: Thu Aug 12, 2004 12:09 pm :
Rayne wrote:
and yes, use a simple patch mesh when you need ONE SIDED surfaces... :D


Actually, I left the one in my map as a thin mesh as in the picture. For one thing, it has collision so you don't have to set up a clip brush right there. Besides, thats the way the stock maps do it, anyways.



Circastes@Posted: Sat Aug 14, 2004 3:57 pm :
Say, is the GUI supposed to be super-sized? Like, it doesn't fit on the func_static, let alone the area given on the actual cabinent model.
Let me know if I'm doing something wrong, and if I'm not, let me know if there's a way to resize GUIs.

EDIT: Oh right, surface inspector. ;)



amusedtoe@Posted: Sat Aug 14, 2004 5:47 pm :
It's always nice when someone's already asked the question for you. :D



OldRod@Posted: Sat Aug 14, 2004 7:29 pm :
I'm having a strange problem with this gui object.

I made the cabinet and then created the gui brush as shown in the above picture. It's a 1 pixel thick brush and sized to cover the size shown in your example. I textured it and turned it into a func_static, then entered all the keys.

When I run the level in-game I see this:

Image

It's like a '+' shape billboard, so I see two intersecting planes from whatever angle I view it. Plus, when I approach it, I get the GUI sound and the cursor changes, but I can't push any of the buttons.

What did I do wrong? :(

*edit* Here's the entity in the actual map file. Looks like all the keys are set ok unless I'm not understanding something :)

Code:
// entity 3
{
"classname" "func_static"
"name" "func_static_4"
"model" "func_static_4"
"origin" "-603 330 90"
"gui" "guis/controlpanels/cabinet.gui"
"gui_parm1" "1"
"gui_parm2" "2"
"gui_parm3" "3"
"gui_parm4" "Stuff"
"gui_parm5" "666"
"target" "env_storagecabinet_2"
"target2" "trigger_relay_1"
// primitive 0
{
brushDef3
{
  ( 0 0 -1 -8 ) ( ( 0.03125 0 0 ) ( 0 0.03125 -0.03125 ) ) "textures/common/entitygui" 0 0 0
  ( 0 0 1 -8 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0.03125 ) ) "textures/common/entitygui" 0 0 0
  ( 0 -1 0 -6 ) ( ( 0.03125 0 0.03125 ) ( 0 0.03125 0 ) ) "textures/common/entitygui" 0 0 0
  ( 1 0 0 -1 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/entitygui" 0 0 0
  ( 0 1 0 -6 ) ( ( 0.03125 0 -0.03125 ) ( 0 0.03125 0 ) ) "textures/common/entitygui" 0 0 0
  ( -1 0 0 0 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/entitygui" 0 0 0
}
}



OldRod@Posted: Sat Aug 14, 2004 8:14 pm :
Ok, with enough trial and error, I finally got it working. A couple things you might want to add to your tutorial to help other clueless newbs like myself :) :

1 - create the brush for the gui and texture it, then make it into a patch mesh. Mine was a brush and was showing up like the one pictured in the previous post. This seems to be discussed in later posts after your tutorial, but it's never really spelled out

2 - Once you make the patch brush, bring up the surface window and click the 'Fit' button. If the texture is upside down in the editor window (like mine was) the patch won't show up in game, click the 'Flip X' button to fix it.

Now mine works :)

Thanks for the tutorial!!



OldRod@Posted: Sat Aug 14, 2004 9:42 pm :
Some more tips for people to customize their lockers :)

If you put ammo/items/weapons inside the locker and are using a clip brush around the locker to keep from going through it, you may not be able to actually pick up the items inside once you open it.

To get around this, add the following keys to your items:

"triggerfirst" "1" - this requires the item to be triggered before you can pick it up (the func_relay in the tutorial above triggers it, but it also puts it directly in your inventory - this makes it so you have to actually pick it up manually).

"triggersize" "20" - this makes the trigger area of the item bigger so you can pick it up while standing in front of the cabinet. After the cabinet opens, you still can't enter it due to the clip brush, so this allows the item to be picked up from just outside the cabinet - experiment with different values depending on how deep in the cabinet you placed your items.



Ekkruker@Posted: Sat Aug 14, 2004 11:15 pm :
OldRod wrote:
If you put ammo/items/weapons inside the locker and are using a clip brush around the locker to keep from going through it, you may not be able to actually pick up the items inside once you open it.


Yes. I didn't say to cover the entire locker with clip, though :P. Just make sort of shelves that block progress partially. Like so:

Image

Note that they don't intersect the items. That can cause problems. There is some vis fighting going on on the side but its not a big deal because you can't see clip brushes in game anyways. Although the larger triggerdistance can be used as well.. probably quicker :P.



skurk@Posted: Sat Aug 21, 2004 7:43 pm :
argh! for some reason, whenever i create a brush with the clip_plusmovables texture, it disappears when I click space to clone, or esc to deselect it! i've also tried creating the brushes with a different texture and applying clip_plusmovables to them all at once, but then they all disappear. has this happened to anybody else?