Portal 2

Portal 2

Not enough ratings
[HAMMER] Using Trico Everfire's Elevator Transition Instance
By Hazel Rose
Explains the use of Trico Everfire's elevator transition instance, its installation, as well as explaining all the keyvalues present in Hammer.
   
Award
Favorite
Favorited
Unfavorite
Introduction
NOTE: I am making this guide and sharing these files with permission. Even though these are public files, I still wanted permission before sharing them here. Okay, back to the guide.

Now you may be asking yourself, "Rose, just why should I use this instance? What does this instance and script that I just installed do?" The provided script and instance allows for more advanced elevator transitions in Hammer for both mods and Workshop maps. The instance forces the use of the custom transition script, rendering the Valve provided script useless for all maps using the provided instance. This does NOT overwrite any existing files, and will not affect Valve maps or other workshop or manually installed maps.

Again, this is for use with Hammer maps only. This isn't usable in BEEMod or PTI. I should also probably mention why this instance and script is better than Valve's provided files.

  • allows for easy screen assignment, especially for custom elevator videos (custom elevator videos are mod-only since you cannot pack custom .bik files)
  • custom portal gun settings
  • chapter text
  • PTI transition support (still requires the normal PTI ents instance in your map) (Hammer only)
  • convar settings support
  • auto non-PotatOS portal gun assignment
Installation
First off, you'll wanna download the files from the Portal Mapping and Modding[discord.gg] Discord server.

Next, extract the "transitions" folder from the .zip file and put them in your "scripts" folder. This folder contains the transition script itself. In my files, I have a "custom_content" folder, where I put all of my custom content that isn't included in base Portal 2


Grab the "transition_global_ents.vmf" file from the .zip file, and put it into your instances folder, anywhere you want. I just put mine directly in the instances folder.


Congratulations! You have now installed the required files! Now for the more difficult bit; using them in Hammer.
Using Them in Hammer
Even though I said it was the more difficult part, it's still fairly straight forward. If you are confused by any of the settings and keyvalues shown, the next section explains each one. For this example of usage, however, I will be using mostly default values. Bear with me here.

First up, add the instance into your map. No need to name the instance, since there's no inputs you can give it from other entities. The instance looks like this; doesn't look like much, but boy howdy does it work WONDERS.


Next, grab your arrival and/or departure elevator logic instance(s). In my example, I'm using the arrival logic supplied by Valve. Name this instance "@arrival_elevator". If you don't do this, your elevator videos will not work. If you have a departure elevator, name the departure elevator logic instance "@departure_elevator", or the elevator videos won't work.

Then add your base. I'm using an edited variant of the a4_base arrival instance. You're now basically setting up the elevators as you normally would. Once you've got all of that done, let's configure the transition instance.

Opening the properties for the instance, you're greeted to a LOT of variables. Don't be alarmed, as I will explain each variable in the next section. For tutorial purposes, here is what I have my variables set to:


Again, I'll explain the variables later. With these settings, the result becomes this:

If using a custom portal gun, say a portal gun that only fires orange portals, create a "weapon_portalgun", and name it "@PortalGunPreset". If using custom world models, place it where the player will spawn. This helps to try and give the player the portal gun. This is not fool proof, and can break. Please be careful.

Yes, this is a recreation of Triple Laser's elevator. Don't worry about it.
Keyvalues
Now I can explain all of the keyvalues, what they do, and some of their affects ingame.

  • $AStitletextcolor2 - The color the chapter title text will fade to. Default is white, like in base Portal 2's chapter titles. Changing this to an RGB value, such as 0 0 0, will make the text fade to black.
  • $AStitletextcolor - The color the chapter title text will fade from. Default is the light blue seen in Portal 2. Changing this to an RGB value, such as 0 255 0, will make the text fade from green.
  • $TitleshowDelay - The delay, in seconds, the characters of the title text appear. Default is the speed from Portal 2's chapter text..
  • $TitleText - The actual title text, such as "Sugarsweet Triple Laser", which appears near the center of the screen in big font.
  • $ASsubtitletextcolor2 - Same as $AStitletextcolor2, but for the subtitle. Default is the color from Portal 2's chapter text.
  • $ASsubtitletextcolor1 - Same as $AStitletextcolor1, but for the subtitle. Default is the color from Portal 2's chapter text.
  • $SubtitleshowDelay - Same as $TitleShowDelay, but for the subtitle. Default is the speed from Portal 2's chapter text.
  • $SubtitleText - The actual subtitle text, such as "Made by Erin-Rose", which appears underneath the chapter title.
  • $wantsTitle - A Boolean value of 0 (false) or 1 (true), which dictates whether the chapter text appears. Default is 0.
  • $wantsVideo - A Boolean value of 0 (false) or 1 (true), which dictates whether the elevator uses the elevator videos. Default is 0.
  • $departureVideo - The video that is displayed in the departure elevator room. Must be set to [MEDIA_LOCATION]/[MEDIA_NAME] (example: media/animalking), no file extension.
  • $arrivalVideo - Same as $departureVideo, but for the arrival elevator room.
  • $departureSizeHeight - How many panels, height wise, you want your video to display on in the departure elevator room. Default is 1. Valve maps use 2.
  • $departureSizeWidth - How many panels, width wise, you want your video to display on in the departure elevator room. Default is 1. Valve maps use 23 (since there are 23 video panels on one row).
  • $arrivalSizeHeight - Same as $departureSizeHeight, but for the arrival elevator room.
  • $arrivalSizeWidth - Same as $departureSizeWidth, but for the arrival elevator room.
  • $setscaletype - Tells the elevator videos how to scale to the elevator screens. Default is 0. Change to -1, 1, or 3-14 to display videos. Examples of each value shown in the next section.
  • $isDestructedElevator - Dictates whether the elevator video screens should be messed up or not. If $setscaletype = -1, it will randomly set the setscaletype between options 1 and 5. If $setscaletype is not specified, will set it between options 6 and 7.
  • $randomDestructionChance - This dictates the chance (in x to 1) that a screen will be randomly broken and unable to display a video. For example, if set to 100, there is a 1 in 101 chance the screen will be broken. If set to 1, there is a 1 in 2 chance that a screen will be broken (so about half). Setting this value to -1 will break no screens. Default value is -1. Greater values = less chance for a screen to be broken, and higher chance for a screen to remain intact. Lower values = less chance for a screen to remain intact, and higher chance for a screen to be broken.
  • $doesWantPortalGun - A Boolean value of 0 or 1. Setting this to 1 will automatically give you a Dual Portal Device without PotatOS. Setting to 0 allows you to use custom portal gun settings, as explained in the previous section, or not have any portal gun at all. Default is 0.
  • $doesWantConvarSetup - This is a funny one; it's a carryover from Revolution. Stefan Heinz wrote part of this original script, and Trico heavily modified it to be what it is now. Default value is 0. It sets the following convars:
    • sv_player_collide_with_laser 0
    • portalgun_held_button_fire_fire_delay 0.2
    • portalgun_fire_delay 0.1
      [*[ cl_portal_projectile_delay_sp 0.2
    • player_held_object_collide_with_player 1
Elevator Video Scale Type
I will be showing image examples of each type of elevator scale type, using the Animal King elevator video (animalking.bik) to show each example.

Type -1 = Full Elevator


Type 1 = Stretch


Type 2 = Mirror


Type 3 = Ouroboros


Type 4 = Upside Down


Type 5 = Tiled=


Type 6 = Tiled Really Big


Type 7 = Tiled Big=


Type 8 = Tiled Single


Type 9 = Tiled Double


Type 10 = Two by Two


Type 11 = Tiled Off One


Type 12 = Tiled 2x4


Type 13 = Tiled Double w/ Two Blanks


Type 14 = Tiled w/ Two Blanks (dependent on video size)
2 Comments
Hazel Rose  [author] 14 Nov, 2023 @ 7:12pm 
youll have to pack the script. HammerAddons will automatically pack it for you if you have it, but using VIDE or whatever other BSP packer out there for Source will work as well
karl-police2025[GER] 13 Nov, 2023 @ 1:41pm 
No need of packing the vscript with bspsrc or something?