Messed-Up Levelchanges

Avatar
WinstonSmith
940 Posts
Posted Jul 18, 2009
Can anyone help out with this problem? It's been driving me up a wall, and I can't for the life of me figure out what I'm doing wrong. It's probably a simple step that I'll kick myself for not noticing, but still, any and all help is greatly appreciated.
I've attached the first of two levelchange examples. The first map is levelchange_test_start; this is the one that should be loaded first. If all was correct, the elevator doors would close once you enter, the next map loads, and you exit the second elevator. However, something is wrong. It appears (on my system, at least--I really hope I don't have to reinstall the SDK or Portal) that several classes of entities are carried over to the next map, including prop_dynamics and possibly prop_physics. This results in two sets of elevator doors existing after the change, and only one opening, making it impossible to enter the chamber. Also, the box dropper covers are carried over, appearing in random spots in the new chamber. This problem has me at my wit's end, and I'm even considering using a point_clientcommand to input a map <mapname here> console command. Quick and dirty, I know, but I might need to use it. Please help!
Advertisement
Registered users don’t see ads! Register now!
Avatar
WinstonSmith
940 Posts
Posted Jul 18, 2009
Replied 4 minutes later
Here's the second map--apparently you may only post one attachment per post. You need both to see the problem!
Avatar
HMW
806 Posts
Posted Jul 19, 2009
Replied 17 hours later
Well...

This is probably among the more nasty bugs I've ever encountered. Don't feel bad that you can't figure it out, there's quite a lot going on.

First of all, entities travelling with the player across level changes is a feature of the Source engine. For example, in HL2 it allows ally NPCs such as Alyx to move along with the player through several maps. Is also ensures that small objects and debris lying around near the transition area are accurately carried over.

Normally, a level change consists of three components:
- the trigger_changelevel that initiates the level change (you have that, obiously);- the info_landmark, that acts as a reference point to line up the position of transferred entities between the two levels (you also have that);- a trigger_transition surrounding the room / corridor / whatever that is common to both maps. All entities inside this trigger will be carried over.In absence of a trigger_transition, the game will try to transfer every entity in the map over to the new one. That's why you have other random stuff from the previous map appear in the new one.

An entity will NOT be transferred:
- if it is a brush entity (func_*), unless there is a brush entity in the destination map with the same globalname. In that case, the state of the old entity will be copied to the new one;- if it is attached (parent) to another entity that is not transferred.I never noticed this until now, because my exit elevator and doors are tied to a func_tracktrain, in order to allow it to move up the shaft. The func_tracktrain being a brush entity prevents the entire elevator assembly from being transferred. (You should make it like this BTW, it looks way better :smile:)

So to summarise:
- put a trigger_transition around the exit elevator and give it the same name as your info_landmark;- parent your elevator and doors to a brush entity.As far as I'm aware, you don't need a trigger_transition at the destination side, as you will never be going in the other direction.

Avatar
WinstonSmith
940 Posts
Posted Jul 19, 2009
Replied 20 minutes later
Wow, I feel like an idiot now. I had a feeling that something was missing and in its absence, the map would carry over all entities by default. There were two reasons I didn't create the full elevator shaft; for one, I thought it would be easier to simply eliminate the world geometry, because it seemed unnecessary to make the elevator move if the illusion of movement could be created. Also, I seem to have exceptionally bad luck with func_traintracks. That was a while ago, though, and I've gotten some tracks to work lately, so I'll try again; maybe I'll use a prefab. That would help a lot. I'll follow your steps and see if it works--I'm in eternal debt to you for your advice!
Avatar
HMW
806 Posts
Posted Jul 20, 2009
Replied 13 hours later

WinstonSmith wrote:
Wow, I feel like an idiot now.

Please don't! I wasn't putting trigger_transitions in my maps until now. I've just been lucky that this hasn't happened to me so far :biggrin:

WinstonSmith wrote:
There were two reasons I didn't create the full elevator shaft; for one, I thought it would be easier to simply eliminate the world geometry, because it seemed unnecessary to make the elevator move if the illusion of movement could be created.

True, only if you actually make the elevator move you get those funky lights moving across the inner surfaces of the elevator as it goes up, which adds a lot to the sensation of movement.

If you're looking for a prefab, check out Aldez's prefab pack!

Avatar
theVDude
120 Posts
Posted Jul 20, 2009
Replied 5 hours later
I was playing a map where I had some cubes, and they ended up coming with me, and I tossed them into a pipe and then jumped in, but ended up stuck crouching. Apparently, I wasn't supposed to have the cubes.
Avatar
WinstonSmith
940 Posts
Posted Jul 20, 2009
Replied 1 hour later

HMW wrote:
True, only if you actually make the elevator move you get those funky lights moving across the inner surfaces of the elevator as it goes up, which adds a lot to the sensation of movement. If you're looking for a prefab, check out Aldez's prefab pack!

I know, I was thinking about the lights. The only problem I have with that (and it's REALLY nitpicky, I know) is that I've always wondered where those lights come from. The walls of the elevator are solid--how are the lights able to pass through the ceiling and floor?
But I digress. I have had Aldez's Prefab Pack for a long time; I dip into it occasionally. The only problem is that the exit prefab is a disconnect-at-end elevator and not a levelchange elevator. In any case, I've tried modifying that prefab, modifying my own prefab, and a few other options, and I'm having problems with all of them. Anyway, I think I'm going to try to make a custom levelend prefab; I have an idea brewing. That would at least cut through the problem with elevators.

theVDude wrote:
I was playing a map where I had some cubes, and they ended up coming with me, and I tossed them into a pipe and then jumped in, but ended up stuck crouching. Apparently, I wasn't supposed to have the cubes.

I know...isn't breaking maps awesome?

Avatar
theVDude
120 Posts
Posted Jul 20, 2009
Replied 2 hours later
There wasn't any sign the level was going to load the next part, and I assumed I was supposed to take the cubes with me. So there I was with my cubes and I tossed them in the tube. I think it might've been on PESP, maybe.
Avatar
WinstonSmith
940 Posts
Posted Jul 24, 2009
Replied 3 days later
Well, since every attempt to make the elevator assembly work in my maps failed miserably, I've developed a concept for an alternate Testchamber Interlock. Here's a screenshot; it's supposed to be a sort of teleportation device (an idea that will play a role later in my mod). Any thoughts/feedback?
Avatar
Remmiz
631 Posts
Posted Jul 24, 2009
Replied 3 minutes later
Not bad although I would avoid using the ball catcher model...it just looks bad when you try to reuse models that we all know have a different purpose.
Avatar
WinstonSmith
940 Posts
Posted Jul 24, 2009
Replied 26 minutes later

Remmiz wrote:
Not bad although I would avoid using the ball catcher model...it just looks bad when you try to reuse models that we all know have a different purpose.

Excellent point, Remmiz. I figured because of its involvement with energy balls, the idea might be plausible; however, I suppose it wouldn't be all that much trouble to construct a brush-based, believable apparatus.

Avatar
WinstonSmith
940 Posts
Posted Jul 24, 2009
Replied 2 hours later
Image updated. Check above--what do you think of this version?
Avatar
hanging_rope
435 Posts
Posted Jul 24, 2009
Replied 1 hour later
Awesome sauce, but looks a bit scary, so I'd make it only turn on when the player gets inside.
Avatar
WinstonSmith
940 Posts
Posted Jul 24, 2009
Replied 4 minutes later

Hanging_rope wrote:
Awesome sauce, but looks a bit scary, so I'd make it only turn on when the player gets inside.

Don't worry; there's a sequence of events that starts up when the player enters the rig. Long story short, the only thing that's active before the player gets in is the web of lasers in the rings at the top.

Avatar
WinstonSmith
940 Posts
Posted Jul 31, 2009
Replied 6 days later
Good news. I've finally gotten the levelchange up and working!
(Not that spectacular an achievement, I know, but still.)
I only have one problem left. When the new map loads, the AI is automatically disabled. I think this is a fairly common problem, but I have no idea how to solve it. I have heard that it may have something to do with AI nodes, but I'm not sure. Anyone else have this problem?
Avatar
pestchamber
614 Posts
Posted Jul 31, 2009
Replied 4 minutes later

WinstonSmith wrote:
Good news. I've finally gotten the levelchange up and working!
(Not that spectacular an achievement, I know, but still.)
I only have one problem left. When the new map loads, the AI is automatically disabled. I think this is a fairly common problem, but I have no idea how to solve it. I have heard that it may have something to do with AI nodes, but I'm not sure. Anyone else have this problem?

I did. you need to run both maps first. ("map chamber1", "map chamber2"). It should say that "Graph out of date" or something like that, "rebuilding...". That should do it if i remember correct.

Advertisement
Registered users don’t see ads! Register now!
Avatar
WinstonSmith
940 Posts
Posted Jul 31, 2009
Replied 1 hour later

pestchamber wrote:
I did. you need to run both maps first. ("map chamber1", "map chamber2"). It should say that "Graph out of date" or something like that, "rebuilding...". That should do it if i remember correct.

THANK YOU PESTCHAMBER!
I should have realized that the game needs some AI nodegraph to function correctly. It's fine if there aren't any nodes to make that graph with, but the game at least needs to know that.