Messed-Up Levelchanges
Quote from WinstonSmith on July 18, 2009, 11:12 pmCan 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!
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!
Quote from WinstonSmith on July 18, 2009, 11:17 pmHere's the second map--apparently you may only post one attachment per post. You need both to see the problem!
Here's the second map--apparently you may only post one attachment per post. You need both to see the problem!
Quote from HMW on July 19, 2009, 4:39 pmWell...
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.
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 )
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.
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from WinstonSmith on July 19, 2009, 5:00 pmWow, 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!
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!
Quote from HMW on July 20, 2009, 6:03 amWinstonSmith 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!
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
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!
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from theVDude on July 20, 2009, 11:37 amI 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 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.
Quote from WinstonSmith on July 20, 2009, 12:45 pmHMW 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?
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.
I know...isn't breaking maps awesome?
Quote from theVDude on July 20, 2009, 3:24 pmThere 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.
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.
Quote from WinstonSmith on July 24, 2009, 2:45 pmWell, 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?
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?
Quote from Remmiz on July 24, 2009, 2:48 pmNot 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.
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.