Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/archive/global.php(40) : eval()'d code on line 2
[TUTORIAL] A Beginner's Guide:The Spawn Room [Archive] - TF2Maps.net Forums

PDA

View Full Version : [TUTORIAL] A Beginner's Guide:The Spawn Room


Half-Life_Maniac
12-06-2007, 04:23 AM
In this tutorial, we'll make a safe place for players to spawn and resupply, while keeping enemies out.

The Room

Obviously, the first thing you'll want is a room, so go ahead and make one. I've got a floorspace of 384x304, but that is up to you of course. You don't want it too cramped, nor too open. I've left a gap to insert a door later on.

http://img141.imageshack.us/img141/290/respawn1js8.th.jpg (http://img141.imageshack.us/my.php?image=respawn1js8.jpg)

Respawn & Resupply Ents

We'll first add places for players to spawn. Place an info_player_teamspawn entity. Bring up its properties (alt+enter). The only settings you need to change are the Team and Angles. Since we're working with RED team for the moment, set the Team as Red. Use the compass so that the entity is facing the exit.

Now clone (shift+drag) this entity until you have at least 16 in the room.

Next, create a brush that fills the room, and tie it to the entity func_respawnroom. This area allows players to switch classes instantly, and prevents engineers building. In its properties, set its Team to Red and give it a logical name. I'm using "respawn_red1".
Note: See how I've used "red" in the name? Make sure all your new entities follow this pattern. This will be important in the last part of the guide.

For the resupply locker, first place a prop_dynamic. For its World Model, choose "models/props_gameplay/resupply_locker.mdl". Give it a name as well. "resupply_red1" will do.
Then, create a func_regenerate surrounding the locker. Set its Team, and Associated Model to the name of the locker you just made. In our case, "resupply_red1".

http://img464.imageshack.us/img464/9149/respawn2pu9.th.jpg (http://img464.imageshack.us/my.php?image=respawn2pu9.jpg)

Doors

A hole in the wall isn't going to be much good, so we'd best make a door to fill it up.
Insert a prop_dynamic. Set its World Model as "models/props_gameplay/door_slide_large_dynamic.mdl". With this particular model, you get a door trim with animated sliding door. Give it a name, something like "door_red_respawn1_prop".
Now create a func_door which fills the doorway, but slightly overlaps the prop door. This will be an invisible door which controls the prop door. Give it the following properties;

Name: door_red_respawn1
Render Mode: Don't Render
Speed: 500
Delay Before Reset: -1
Move Direction: Up
Lastly, check its Flags and ensure that Touch Opens is not ticked.

Now we need to tell the prop door to play its opening animation when the func_door is opened. Bring up the Outputs of the func_door, and the two following outputs;

My output named: OnOpen
Target entities named: door_red_respawn1_prop
Via this input: SetAnimation
With a parameter override of: open

My output named: OnClose
Target entities named: door_red_respawn1_prop
Via this input: SetAnimation
With a parameter override of: close

Finally, create a trigger_multiple that extends well past the door so that players can trigger the func_door to open as they approach. Since we also want this trigger to only work for one team (RED) we will need to use a filter entity. Place a filter_activator_tfteam somewhere on the map. Set its Team as Red, and name it "filter_red_team".
Back on the trigger_multiple, Set the Filter Name to the name of the filter you just created. Also, set the Delay Before Reset to 0.

Just another two outputs remain;

My output named: OnStartTouchAll
Target entities named: door_red_respawn1
Via this input: Open

My output named: OnEndTouchAll
Target entities named: door_red_respawn1
Via this input: Close

Keeping the Enemy Out

One last thing we can do with our door is place a func_respawnroomvisualizer. While invisible and non-solid to the team that owns the spawn, it appears as a no entry sign and blocks the enemy team from passing through the open door.
Create the entity somewhere inside the doorway, filling the gap. All sides should be textured with tools/toolsnodraw except for the outer side, which should use overlays/no_entry. In its properties, the only thing you have to set is its Associated Respawn Room. For us, that'd be respawn_red1

Lighting and Detail

This is only a simple example map, but it wouldn't hurt to make this look a little more like an actual respawn room.
The first thing we'll want is some lights. Place a light prop or two with the prop_static entity. I've used the model "models/props_lights/light_fluorescent_basement.mdl". Just underneath the light fixture, place a light_spot. For longer lights like I've used, you might want to use 2 light_spots. Choose a light blue/white colour, and a brightness of about 500.

Place any other details you want. I've placed a couple of prop_static benches ("models/props_spytech/bench001a.mdl"), a func_detail door trim, as well as a RED team logo info_overlay ("signs/team_red").

http://img147.imageshack.us/img147/861/respawn3um6.th.jpg (http://img147.imageshack.us/my.php?image=respawn3um6.jpg)

Last but not least, you should place an env_cubemap entity to ensure that any shiny surfaces reflect their surroundings correctly. No extr aproperties are required.

Optimisation

One final thing you can do is increase optimisation by the use of a func_area portal. What this does is prevents the engine from rendering anything on the opposite side of the door when it is closed (since usually, the engine will just assume the player can always see it, and render unnecessary parts of the map).

Start with a solid textured completely in "tools/toolsareaportal" which fills the doorway. However, ensure that it is actually placed inside the door prop. You'll likely have to make it only 1 unit thick in order to fit.
Tie it to the entity func_areaportal.
Set its Name of Linked Door to the name of the respawn door, "door_red_respawn1".
lastly, set its Initial State to match the state the respawn door will start in- Closed.

http://img147.imageshack.us/img147/6757/respawn4zd5.th.jpg (http://img147.imageshack.us/my.php?image=respawn4zd5.jpg)

One for BLU Team

At the moment, only RED team has a spawn room, which is hardly fair for the BLUs.
The first thing to do is select your whole room and clone (Shift&drag) it to another part of the map. Once you've done this, either keep your current selection, or select the old respawn and click the "New Visgroup" button (dotted red button on the upper toolbar). In the Visgroup window that pops up, enter a name of "Red Spawn". This will hide one of your spawn rooms in the editor, leaving us with what we'll turn into the BLU spawn.
First, let's retexture it. With the Texture Application tool, select one of the floor or wall textures of your spawn, and then click the "Replace" button. Make sure the "Hidden objects too" box is not ticked, and then click the right-hand "Browse" button. Find and select the blue equivilent texture for whatever surface you selected, and click Ok. All textures of that type wil be replaced with your new texture.
Repeat this process for all textures that need replacing.

The last thing to do is to go through every entity and reconfigure it to work for BLU instead of RED.
At least it would be if it weren't for this handy little feature!
Just like in any word editor, there is a "Replace" function specific to entities.
Go ahead and select Edit-Replace... (Ctrl+Shift+R).
In the "Find what"" box, enter "red".
In the "Replace with:" box, enter "blue".
Make sure that the "Visable objects only" box is not ticked! Press "Replace All" when you're done.

Every entity with a reference to the word "red" now uses "blue" instead.
Unfortunately, this is not 100% effective. While this works for instances where you had to type either "red" or "blue" (such as a Name field) this process works. However, in cases where you need to actually select the team from a drop-down box, you'll have to manually go and set the correct team. Check your info_player_teamspawns, func_respawnrooms, func_regenerates, and filter_activator_tfteams.

Finally, you can bring your original RED spawn back out of hiding by ticking its name in the little VisGroups window on the right. You should also select and hide/unhide the new BLU spawn so it has it sown visgroup as well. Doing this makes it easier to work with parts of the map at once.

Hopefully this has been a helpful tutorial. The example map built for this tutorial can be be found here. (http://www.freespaces.com/hlmmaps/tuts/tf2_respawn.zip) (Save Target As..)

Immortal-D
12-09-2007, 06:47 PM
I can't believe this has been passed up. The spawn room seems like such a basic thing, but adds so much to the game. The setting of the map can be determined by the spawn room. Anyways, very good write up :) I especially dig the part on optimizing, cuz you can never have enough of that.

lerlerson
12-09-2007, 06:57 PM
Wow, very good, helpful tutorial for new mappers, and this would have really helped when I started, especially the Optimization part. I actually haven't done that, but I shall now.

Half-Life_Maniac
12-09-2007, 08:57 PM
Phew, nice to get some replies. I was starting to think it was too long for people to even bother reading. Also, I've noticed there's a bit of a problem with the map download link giving a 403 error, due to my host being rubbish. To get the map, right click the link and "Save Target As..."

[Edit] Updated the tutorial with a new section on cloning your spawn, as well as fixed typing errors.

Open Blade
12-12-2007, 08:03 PM
I downloaded your room, copied everything as you said, replaced the "red" entities with "blue" as you said, added a hallway to connect both rooms and a few lights, loaded it up and everything is great except each team can open both doors.

Nizzem
12-12-2007, 08:10 PM
make sure your using a filter_activator_tfteam like specified in the tutorial and make sure you have the 'touch opens' flag unchecked on your func_doors

Open Blade
12-12-2007, 10:19 PM
Ok - it was the filter, it was not set to correct team..........now there is another problem. I cannot pass through the door. I checked the func_respawnroomvisualizer and it's set right but the no entry texture is on the portal brush. What now?



What's odd is that when I remove both area portals, I can pass through Red door as Red player (blue door won't open for Red, that's good), but when I spawn as a Blue player, the door opens but I can't pass through. I checked the func settings and the visualizer and they appear to be correct for both. Grrrrr. I can shoot through it and see the particles outside in the hallway but cannot pass through it.

Open Blade
12-12-2007, 10:51 PM
Okay, found out what it was. The func_respawnroom brush on blue was set to red team. Still, I could only get it to work without the area portals.

MacNetron
12-13-2007, 03:11 PM
You might want to add the fact that the spawnpoints are floating.
I noticed this when googling on my errors I got on "got a velocity too low on Z" in combination with: "spawnpoint (x y z) is not clear".
Appears I'm falling in eternity... even without portals.

Alas, when my room works, there will be cake.

Half-Life_Maniac
12-13-2007, 04:49 PM
You're not suggesting that spawn points should not float, are you?

They should always be a short distance off the ground to prevent getting stuck, and have a clear space around them.

Intraman
12-13-2007, 05:01 PM
Err just to clear things up. The info_player_teamspawn should be "floating" but the func_respawnroom should be touching the floor brush.

AussieTemplar
12-18-2007, 12:14 AM
Hey man.

First of all, its my first time on these forums. Great Tutorial btw ;)

Now, I wanted to create a room WITHOUT the door - so I left out everything that had to do with the door.

I compiled, got in the game. I spawned, resupply worked fine etc. Then it seemed when I left func_respawnroom my game crashed. I did it over and over again, and it still crashed.

Anything guys?

Half-Life_Maniac
12-18-2007, 12:31 AM
Perhaps you left the func_areaportal in there? That might cause problems if it's tied to a non-existing doorway.
Try a Map- Check for Problems (alt+p) and look for any errors to do with outputs.

AussieTemplar
12-18-2007, 01:10 AM
Thanks for speedy reply.

Nothing is left. No problems.

AussieTemplar
12-18-2007, 09:22 PM
Fixed :)

Half-Life_Maniac
12-18-2007, 09:39 PM
Mind telling us how you solved it? Just so anyone else who runs into the problem knows.

Paddy
12-26-2007, 02:11 PM
Um im new to this and a little bit stuck! I think im making the functions wrong because they keep turning into walls aswell so you cant see the resupply unit and the door! can someone please explain how to do this?

Thanks,

Paddy

Snipergen
12-26-2007, 02:13 PM
so you make a brush, give all sides the texture 'tools/toolstrigger', than you press ctrl+T to tie it to an entity (func_respawnblablabla)

Okay? :)

Paddy
12-26-2007, 03:31 PM
oh! that sounds like it makes sense thanks! i dint now you had to make the sides the tool/triiger thing!

This forum is great for giving advice thanks guys!

Paddy

Paddy
12-26-2007, 04:18 PM
um sorry to post again so soon! but i created everything as said and when i ran it to test it the resupply locker doesn not appear but it does give you ammo and health! also the door doesnt work and appears broken as the textures go all funny and wierd.

has anyone experienced this and been able to fix it before?

thanks,

Paddy

Nizzem
12-26-2007, 04:47 PM
Make sure the resupply lock is Prop_dynamic.

And your going to have to be clearer about the door.. It could be caused by a closed areaportal..

Gonzales
12-26-2007, 04:49 PM
um sorry to post again so soon! but i created everything as said and when i ran it to test it the resupply locker doesn not appear but it does give you ammo and health!

Is it a prop_dynamic or a prop_static? I believe it has to be a prop_dynamic...

Could you provide a screenshot of your door? It's kind of hard to tell exactly what's wrong from the information you provided. =/

Edit: Bah, Nizzem beat me to it.

Snipergen
12-26-2007, 06:05 PM
like these guys said, prop_dynamic and link the animation to the trigger.

You have to think like the engine. That locker doesnt give you health and ammo, its that brush that does it. The brush is just linked to the locker :)

Paddy
12-27-2007, 04:36 AM
ok i get this error when i load up the map which is why it doesnt show the locker:
c:/users/patrick/pictures/error healthbox
and if that doesnt work it says
"func_regenerate(trigger_resupply_red1) unable to find associated model named resup1"

resup1 is the name of the locker

also http://www.flickr.com/photos/22174858@N05/2140979208/

thats the picture of the door.

Thanks

Paddy

Paddy
12-27-2007, 04:39 AM
ahh the picture isnt working its from flickr!
you should be able to find it by searching flickr for "tf2mapping paddy door"
hope that works

Paddy
12-27-2007, 05:04 AM
ok ive got the door to work like the locker does but i still cant see either of them! i've done everything it says in the tutorial but they are invisible!

Snipergen
12-27-2007, 06:09 AM
imageshack mate! cant find it on flicker

Paddy
12-27-2007, 06:23 AM
well ive fixed what the screenshot was off but in the future i will use that! so now the problem is that the door isnt showing itself just like the locker!
i get the error "func_regenerate(trigger_resupply_red1) unable to find associated model named resup1" in the console when i load the map and i think this may be why the locker isnt showing can anyone confirm that?

and for the locker trigger is there meant to be anything in the outputs or something?

Snipergen
12-27-2007, 07:42 AM
name your locker, make sure its a prop_dynamic

name it locker_model_01

than refer to that locker in the output of your func_regenerate.

Makes sense doenst it? Check your names and your links to the trigger and prop_dynamic. Make sure you name everything correctly like i do it

prop_dynamic: name = locker_model_01
func_regenerate: name = locker_regenerate_01

Paddy
12-27-2007, 10:03 AM
SniperGen i love you lol! I've managed to do it all now so thanks for all your help guys!


Paddy

WolffBite
02-10-2008, 06:33 PM
I'm having a problem with my door animations.

The door animation DOES work, but it also causes the prop door to move up when you approach is (door slides up and the entire door frame aswell).

The func_door is set to move direction "up" but I can't understand why the prop door is also in its entirety moving up aswell...

I've tried everything... but it still keeps going up at the same time as the animation. I really want to fix this, because all the other doors look pretty lame just sliding up into walls and stuff.

EDIT:Resolved... apparently I had given the prop doors a parent (the func_door) and that was causing the problem... silly silly me.

Locus
02-13-2008, 07:52 AM
Thanks for posting this tutorial, very helpful :)

I've tried downloading the map file but the host (freespaces.com) appears to be down, at least for me. Could you upload it to another host?

Vander
02-16-2008, 06:08 PM
Save target as is not working. :(

Half-Life_Maniac
02-17-2008, 03:28 AM
Hello there,

Yes, it seems my host has gone and died. Maybe even for good.
I have recently formatted and built a new computer, so I don't have the maps with me right now. They are of course backed up!

In the mean time, if anyone knows of a decent file host, let me know!

peclarkjr
02-20-2008, 08:34 AM
I've been struggling with creating the func_regenerate. I created the prop_dymanic...supply locker and added the info to properties. Now I cant find the func_regenerate to create it. I looked in categories/entities/objects but its not there. Can you point me in the right direction? Where can I find func_regenerate.

Thanks so much!

peclarkjr
02-20-2008, 09:05 AM
Ok so I create a brush, materials/tools/toolstrigger around it? Tie to entity? Select its properties and find func_regenerate that way? When I do this Im not alllowed to edit the Associated Model. How do i get to edit that?

Thanks!

richhelvey
03-10-2008, 08:35 PM
I'm having the same problem with setting the resupply lockers. The prop_dynamic named BLU_locker_01 doesn't show up in the func_regenerate's Associated Model pull down. When I type the name in manually, it stays red after hitting apply and the locker doesn't show up when running the map.

Any strange gotcha's I might be missing?

Thanks,
-Rich

MangyCarface
03-11-2008, 01:21 AM
Rich, try using the little tool under associated model that allows you to click on the prop itself to draw its name. Looks like a teardropper.

richhelvey
03-11-2008, 08:27 AM
I was using GLOBAL ENTITY NAME instead of NAME on the locker model.

Since NAME is 7 lines down amidst all the other stuff I was ignoring, I never saw it.

Problem solved.

I do like the eyedropper thing though.

Thanks,
-Rich

taotd
04-06-2008, 01:12 AM
My respawn door, when approached, makes the sound of the door sliding up, but doesn't animate and won't let anyone through

NVM, fixed it. Apparently the shutters don't like being intersected with other walls

Immortal-D
04-06-2008, 11:47 AM
Ok so I create a brush, materials/tools/toolstrigger around it? Tie to entity? Select its properties and find func_regenerate that way? When I do this Im not alllowed to edit the Associated Model. How do i get to edit that?

Thanks!

func_anything has to be created manually. Select a brush and hit ctrl-t. This defaults to func_detail. From there, you can browse the list of stuff and select regenerate.

BreadHeadFred
04-17-2008, 02:50 PM
Hey, I'm pretty new here and new to mapping. I have a problem and I hope someone can find the time to help me...

I'm sure I made the door step by step like in the guide, but for some reason it doesn't show up in-game. I hear the sound of the door opening and closing, so I know it's there and it seems to work fine, but I simply can't see it. It's just one big hole in the wall.

EDIT: Oh, somehow I skipped the previous page, I've got the same problem as the last poster on page 4 had, except I CAN pass through the door. I'm not exactly sure what you meant, though...could someone give a little more detailed explanation?

94Sniper
04-27-2008, 02:32 PM
This tut is perfect for what I needed! thx!

TF2Maps.net is proudly hosted by