Messed-Up Levelchanges
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!
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
)
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.
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 
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!
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?
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.
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.
(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?
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.
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.