Transition Doors Created 2 weeks ago2024-02-05 17:36:29 UTC by jkrz jkrz

Created 2 weeks ago2024-02-05 17:36:29 UTC by jkrz jkrz

Posted 2 weeks ago2024-02-05 17:36:29 UTC Post #348552
I wanna make a door where if a player presses use, the screen fades to black and when it fades back in, the player will be in the location behind the door.

So far i've thought of either making use of a teleport trigger that would teleport the player behind the door after pressing use or the same thing but with a changelevel trigger but I'm totally new to mapping so I don't know if there's an easier way to do it.

I know that Cry of Fear uses this type of doors but when i checked the maps it seems that they programmed their own entity and I'd like to do it with the stuff that's already avalible by default in Jack.
Posted 2 weeks ago2024-02-06 01:12:14 UTC Post #348555
Welcome!

There are a few ways to achieve this effect, but almost any setup you try is going to involve a multi_manager. This will let you set your events on a timed sequence, and can be triggered by making the door a func_button.

I recommend reading the tutorials and wiki entries about these entities, and once you've got them figured out, you want to use the multi_manager to trigger some more entities to create your effect.

You'll want:

1. a func_wall_toggle - this can be an invisible block in front of the door, inside the player. It should be set to "starts invisible" via its flags. It does nothing except freeze the player in place (unless you still want them to be able to run around as the room fades to black)
2. an env_fade - this will fade to a colour (or black) over a specified number of seconds.
3. a trigger_changelevel - this will load the new map.

The multi_manager can delay all these to happen in sequence, so you freeze, fade and finally change level.
Archie ArchieGoodbye Moonmen
Posted 2 weeks ago2024-02-06 02:42:16 UTC Post #348556
Oh I had no idea that I can freeze the player like that. I kept using the camera lol, thanks

With this method everything works great - I press use on the door > freeze > fade > map change. But when I enter the next map, it just spawns me there without a fade in and since I can't add it to the same multi_manager cuz it's on a previous map, Idk what to do. I tried just using the "Level fade in" option but 1. It's too long and 2. It seems like it can only happen once, so if i leave and come back, the fade doesn't happen.

I also tried putting a trigger_once in the exact place where the player spawns and make it trigger a fade but again, that only makes it happen once and I don't want to make it a trigger_multiple because then it will trigger when i come back to the door.

Is there a way to trigger that env_fade only when i enter the map?
Posted 2 weeks ago2024-02-07 09:05:43 UTC Post #348565
The logic_auto entity has an "OnMapTransition" output that you can fire to trigger an entity every time the map is entered, I think that should do the trick.
Posted 2 weeks ago2024-02-07 10:15:41 UTC Post #348566
You can use an env_global. It's an entity that acts as a switch, whose state is shared between level transitions. There's a tutorial, too: Tutorial: Globals.

Using that, a multisource, and the "Master" property on the trigger_multiple, you can disable it after the player activates it by entering the area, and reenable it once the player leaves it and enters the other area.

I'm hazy on the specifics, but after some experimentation with entities you should be able to engineer a solution on your own.

Sounds pretty complicated though: hard to set up and utilizing a lot of entities per one such transition. Use such setups sparingly.
Posted 1 week ago2024-02-11 13:40:11 UTC Post #348569
Contrary to what it suggests, trigger_changelevel's 'Change Target' attribute can be used to trigger an entity on the next map.

Edit: Here is an example map with Archie's suggestion of using func_wall_toggle.
Posted 1 week ago2024-02-11 16:23:34 UTC Post #348570
trigger_changelevel's 'Change Target' attribute can be used to trigger an entity on the next map.
20 years of Half-Life mapping, and still learning something new
Archie ArchieGoodbye Moonmen
Posted 2 days ago2024-02-22 02:05:15 UTC Post #348602
I believe that this should be sufficient to solve the problem. The logic_auto entity has an output called "OnMapTransition" that may be used to cause an entity to be triggered each time the map is shown.
You must be logged in to post a response.