trigger_changelevel in CO-OP?

Avatar
YM_Industries
67 Posts
Posted Sep 18, 2011
Hello everyone!
I wish to use a smooth level transition in co-op (I.E. One where the players don't have to be in the chamber things. I can guarantee that the players will both be in the trigger_transition area at the transitioning time so no need to worry about bugs that might cause. (Unless their cheaters, in which case they deserve to die)
Has anyone got this working?
As a side note, what are the info_transition_entry and info_transition_exit for? Does anyone know? They are currently undocumented.
EDIT: When passing through the trigger_changelevel the console says: "In level transition:"
It doesn't say anything else...
EDIT #2: It spams this the whole time while in the trigger area. Looks to be about once per frame.
Advertisement
Registered users don’t see ads! Register now!
Avatar
MasterLagger
1,695 Posts
Posted Sep 19, 2011
Replied 1 day later
Well, maybe you could look inside an co-op exit instance to see what it does. I'm not saying to do exactly what it does, but find out what makes the level transitions work. I did that to find out how to spawn co-op players without falling though a tube.
Avatar
spongylover123
944 Posts
Posted Sep 19, 2011
Replied 31 minutes later
In portal 2 valve never use a trigger change level, instead they use a script or elevators, that's how they have the aperture laboratories logo
Avatar
YM_Industries
67 Posts
Posted Sep 20, 2011
Replied 6 hours later
So... I'm assuming that I can probably just do whatever mappers did in other multiplayer games... L4D had coop, didn't it? What did they do for map transitions?
Avatar
ChickenMobile
2,460 Posts
Posted Sep 20, 2011
Replied 12 minutes later
l4d uses a info_changelevel not a trigger_transition. It figures out what area is the safe room using landmarks. I think you can still use a trigger_transition in L4d but it is not recommended.

Portal 2 coop doesn't use a trigger_transition, it uses a transition script in order to figure what map comes next etc. Valve made separate .bsps anyway because of the level choosers in the hub.

Here's what you should do:
- Create your own custom transition script- edit the default instances to suit and saveas your custom instance- Split the map into appropriate sections so the map isn't too laggy- Pack the script into your vpk or bsp, then release

Avatar
KenJeKenny!?
238 Posts
Posted Sep 20, 2011
Replied 43 minutes later

chickenmobile wrote:
l4d uses a info_changelevel not a trigger_transition. It figures out what area is the safe room using landmarks. I think you can still use a trigger_transition in L4d but it is not recommended.

Portal 2 coop doesn't use a trigger_transition, it uses a transition script in order to figure what map comes next etc. Valve made separate .bsps anyway because of the level choosers in the hub.

Here's what you should do:
- Create your own custom transition script- edit the default instances to suit and saveas your custom instance- Split the map into appropriate sections so the map isn't too laggy- Pack the script into your vpk or bsp, then release

Yes but i've read posts from alot of people saying you should also do this in SP maps... however a trigger_changelevel works fine in SP.

I'm almost positive there is a easier workaround...maybe through a trigger and server-side console commands?

Avatar
YM_Industries
67 Posts
Posted Sep 20, 2011
Replied 52 minutes later

chickenmobile wrote:
l4d uses a info_changelevel not a trigger_transition. It figures out what area is the safe room using landmarks. I think you can still use a trigger_transition in L4d but it is not recommended.

Portal 2 coop doesn't use a trigger_transition, it uses a transition script in order to figure what map comes next etc. Valve made separate .bsps anyway because of the level choosers in the hub.

Here's what you should do:
- Create your own custom transition script- edit the default instances to suit and saveas your custom instance- Split the map into appropriate sections so the map isn't too laggy- Pack the script into your vpk or bsp, then release

Thanks Chicken, but the problem is, I'm making a map where I want a play again function. I don't want the players to start at the begining of the map again, I want to have a seperate spawn point for those who have used the play-again to those playing for the first time. My plan was that I would just use a trigger_changelevel with a landmark. This trigger would start disabled and be enabled when the player pressed the restart button. They would then walk (actually fall) into the trigger and it would restart the map but keeping them in the same place. Because the trigger is disabled by default it would not get stuck in a loop. All my plans have now been ruined. Looks like I'll have to make 2 maps now (1 for first time, 1 for restarted) :sad:
(info_changelevel doesn't seem to be in Portal 2! EPIC FROWNY :C
EDIT: I might be able to get away with using some sort of env_global system... TO THE WIKI!
EDIT 2: Thought I could bypass all that script changing and make an easier install using a point_changelevel turns out... YOU CAN'T! So that's interesting... Is a script REALLY the only way? I suppose I could use a server command... Hmm, but will is preserve env_global settings?
EDIT 3: So I implement a server command changelevel system only to realise that the trigger activating it all was disabled. It probably would've worked! :sigh:

Avatar
baca25
342 Posts
Posted Sep 20, 2011
Replied 30 minutes later
What I did, was I opened the exit instance, figured out that the script changed the level, realized I dont know much about scripts, so I found what triggered the script, deleted the script, and added a point_servercommand in its place, and triggered it from where the script was triggered. Now its my prefab. So I dont know exactly if you are trying to use the exit elevators or not, but if your not, I always use a coop_manager with a point_servercommand.
Avatar
ChickenMobile
2,460 Posts
Posted Sep 20, 2011
Replied 23 minutes later
So did you want the players to start again after you have finished the campaign (you can close Portal 2 and open again and you can start at new spawn)? Or did you mean that you want an option for the players to start again after they have finished without returning to the hub or exiting the game?

The first would be overly complex and is impossible without saving and reading from some file, which is only available if you can create game code (i.e. modding). We all know that modding is not currently available for Portal 2 so this is practically out of the option.

For the second you can just make a logic_coop_manager that would teleport the players to the preferred spawn. For the bot spawns you can deactivate and activate the wanted spawn (known as the active spawn), as seen in the airlocks. I would also incorporate some kind of fade here, so it doesn't looks as sloppy when you restart.
Remember to reset all your entities so then the puzzle isn't already completed when you pass through again. You can use point_templates to re-spawn objects which aren't spawned by cube spawners etc.

Avatar
YM_Industries
67 Posts
Posted Sep 20, 2011
Replied 36 minutes later
Thanks again Chicken, I didn't think of logic_coop_manager, mainly because it seems to do so many different things and I haven't looked them all up. I have achieved success using an env_global to enable and disable spawns in conjunction with a logic_auto. Thanks though!
EDIT: I actually don't think I could use a logic_coop_manager after looking it up. But the switching spawn points on and off should do nicely.
EDIT 2: I apologise for being so secretive and confusing you all! I really don't want to give anything away about my upcoming map!
Advertisement
Registered users don’t see ads! Register now!
Avatar
MasterLagger
1,695 Posts
Posted Sep 20, 2011
Replied 13 hours later
Well, I got everything except the level to change. Hmm... starting to think about making the coop instance do all the work for me. Make a few triggers in the main map that connect to the instance outside the map. This might work. Will try tomarrow, this could be a big breakthrough in ending levels in coop.