Portal 2

Portal 2

Mad Test Room 2 (Single-Player)
Anachronistic ALLOS  [developer] 1 Mar, 2019 @ 1:00am
How to put Wheatley in a Portal 2 Map; A Comprehensive Guide With No Pictures
Hello, there! If you’re seeing this, that means you just asked me how to put Wheatley in a Portal 2 map! The existence of this very post means that I have been annoyed to no end by people always asking me this question; therefore, I am here to give you a fully-detailed answer so that you never have to ask me anything else about it! …okay, go!

1) Obviously, you must have the Portal 2 Authoring Tools. Download tutorial is here; https://developer.valvesoftware.com/wiki/Level_Design_Introduction_(Portal_2)/Getting_Started

2) If you do not know the ins and outs of basic level creation, please follow the tutorial that the Valve Developer Wiki, found in that link, to learn how!

3) Once you have your level all built and ready to contain things, you are now ready to put Wheatley in your Portal 2 map! But, the question remains; do you want Personality Core Wheatley, or do you want Central AI Wheatley? Your answer will state where you go next! If you want option A, follow the A chain of steps, and if you want option B, follow the B chain of steps!

{== A: CORE WHEATLEY ==}

4A) So, you want little ‘ol core Wheatley, huh? Well alright! Here’s what you do; use the entity creation tool to create an npc_personality_core entity, and in the keyvalues, set the entity name to “@sphere” without the quotation marks, and if you want Wheatley to not look all broken-up and dirty, set the Use Alternate Skins value to Yes.

5A) Now that you have a Wheatley, what to do with him? If you compile the map now, he’ll just be rolling about on the floor; let’s fix that. Create a 16x16x16 unit brush entity, place it on Wheatley’s back, and convert it into a func_tank brush entity. Click into that entity if necessary, and change the following kevalues; [Name = wheatley_tank] [Parent = wheatley_train] [Yaw rate = 300] [Yaw range = 360] [Pitch rate = 120] [Pitch range = 360] and in the Flags tab of the properties window, check Active. After that entity is created, go back into Wheatley’s properties and set the Parent keyvalue to wheatley_tank. Now you have Wheatley floating in the air, not really moving yet though. That’s where the next step comes in!

6A) You want to mount Wheatley to his management rail now; but first, you have to create it! Create a prop_static entity and use the following models to create Wheatley’s railed path to Android Heaven;

models\props_bts\rail_bracket_01.mdl

models\props_bts\ rain_horizontal_angle_32.mdl

models\props_bts\ rail_horizontal_corner_16.mdl

models\props_bts\ rail_horizontal_corner_32.mdl

models\props_bts\ rail_horizontal_ curve_left.mdl

models\props_bts\ rail_horizontal_ curve_right.mdl

models\props_bts\ rail_horizontal_ straight_128.mdl

models\props_bts\ rail_horizontal_ straight_32.mdl

models\props_bts\ rail_horizontal_ straight_64.mdl


7A) Once you have Wheatley’s railpath built, move Wheatley and the func_tracktrain you created under the rail, and now we’re going to attach him to it; create a prop_dynamic, put it in the same position as the func_tracktrain, and set the model to models/npcs/personality_sphere/management_rail_ball.mdl. Angle the model so that the surface that curves inwards faces into Wheatley’s back, and set the model’s parent to wheatley_train. After that, clone the func_tank upwards about 24 units and make it into a func_tracktrain with the following properties; [First Stop Target = wheatley_path_1] [Move Sound = npc/sphere/sphere_rail_travel_lp_01.wav] [Start Sound = npc/sphere/sphere_rail_start_01.wav] [Stop Sound = npc/sphere/sphere_rail_stop_01.wav] and after that is set, clone the ball model attached to Wheatley’s back into the same place, and set the model as models/npcs/personality_sphere/management_rail_stick.mdl. Set that model’s Parent value to wheatley_train. Now you’ve got Wheatley’s management rail rig set up! But, it won’t move just yet.

8A) Before anything else, make sure that the Pitch Yaw Roll (Y Z X) value on Wheatley is set to 0 270 0; if he is not facing the correct direction when the map is compiled, then any attempt to make him look at anything will result in him being at either a 90-degree or 180-degree angle from it. If he is not angled correctly, rotate his whole rig so that he is.

9A) Now, to make Wheatley’s chosen path; along the bottom side of the management rail you set down earlier, place path_track entities, named wheatley_path_1 and so on for however many path entities you need. Set one path to link to the next chronologically with the keyvalue property Next Stop Target. With all the path_tracks set, Wheatley now has a path on the management rail to move along! But, how to make him do that?

10A) To make him move along the set path on his rail, fire an Output from somewhere (whether a button or a logic_relay of some kind, or maybe a trigger) to the func_tracktrain, named “wheatley_train” if you remember, and have the input to the entity be “StartForward” to make him start moving. If there’s a specific point on the rail you want him to make a stop at, be sure to have an intermediate path_track there and when you output to the train, set the input as “MoveToPathNode” with the Parameter being the name of the path_track you want him to move to.

11A) Next, you probably want him to talk as well, yes? Well, here’s how; create a logic_choreographed_scene entity in the map. Put in a place you won’t forget where it is. Set the name of the entity to be something like “wheatley_line_#”, where the # represents the number of the line in however many you set down, and then also set the Target 1 keyvalue to @sphere. Then, browse the Portal 2 wiki to find the lines you want;

http://theportalwiki.com/wiki/Wheatley_voice_lines

You’re going to want to right-click each line to open them in a new tab to preview them before deciding which ones you want. To find the corresponding voice lines in the Sound Resource Browser after clicking into the Scene file keyvalue of the logic_choreographed scene, copy the end of the sound page’s URL between the character’s name and the .wav at the end (AKA, between Wheatley_ and .wav) and paste it into the Filter bar in the sound resource browser. Wheatley’s lines are categorized in the directory “npc\sphere03\” because Valve did not differentiate his lines from the Fact Core’s lines. Once you’ve found the line you want in the browser, click it in the menu and click OK to set it, and then click Apply in the properties window to save the change. Now, just fire an output to the logic_choreographed_scene from anything with an input of “Start” to make him talk! If you want him to say more at a time, it involves chaining multiple logic_choreographed_scene entities with each one having an “OnCompletion” output that starts up the next entity in the sequence.

12A) If you want him to look at anything while on his rail, set an info_target entity on top of the desired look target, give it a specific name, then fire an output into the func_tank with the input being “SetTargetEntity” with the parameter being the name you gave the target. Do that and he’ll look at that thing you wanted him to; to make him look back at the player, do the same action but set the parameter to “!player” without the quotation marks.

13A) Lastly for core Wheatley, making him disengage from his management rail; rather simple, fire an output to @sphere with an input of “ClearParent” and he’ll come flying off of that rail!

{== CENTRAL AI WHEATLEY ==}

4B) Central AI Wheatley is quite a bit tougher. It’s advised that you read through the Core Wheatley section above so I don’t need to repeat things. But here’s the breakdown; first of all, this’ll be tougher for you to manage, as if you’re not putting a Wheatley monitor down or engineering him in a boss fight, you actually have to create a prop_dynamic with models/npcs/glados/glados_wheatley_boss.mdl set as the model, and you have to manually animate him to anything you have him do, from either speaking or reacting to things. You have to go into the model browser, browse through his animations on the right side of the panel, and find which ones you want to use, and following that you have to send inputs to him under “SetAnimation” and “SetDefaultAnimation” with the very-specific-and-caps-sensitive animation names as the parameters, otherwise he’ll just hang there completely still with his eye closed. That’s something for you to figure out yourself, as it would take too long to explain.

5B) If you’re putting him on a monitor, thankfully it is easier as Valve created premade instances for this purpose. Having a Wheatley monitor involves use of two instances via func_instance entities; “instances/monitors/wheatley_bigscreen.vmf” for the monitor, which must be slotted into your existing chamber walls, and “instances/monitors/wheatley_studio.vmf” for the actual Wheatley seen on screen, which must be placed in some location outside the map. After those two things are set, for every instance of Wheatley’s monitor you must give it a Fix Up Name as defined in the property keyvalues, and then when you want the monitor to open, you must fire an Output to it from anything, and as for the Inputs available there are a specific set of them for how you want the monitor to open; from deploying straight out to deploying at an angle. For each monitor, it can only open once, cannot be closed, and each monitor must have a different Fix Up Name or else Hammer will get confused, and it will provide … interesting results in-game. This monitor entity will automatically animate to any Wheatley voice line you start up.

6B) As for the Wheatley boss? Hardest one to make; the easy part is that the Wheatley boss has an NPC entity, so you do not need to worry about animating him manually; the entity is “npc_wheatley_boss” and can be attached to just a func_tank like core Wheatley. (No func_tracktrain, though; unless you’re trying to pull an NYS-05, Central AI Wheatley won’t be moving around his chamber.) You still name the entity @sphere as usual, with the parent being the tank and the model being models/npcs/glados/glados_wheatley_boss.mdl like back in Step 4B. But, as for making him react to damage? Oho. That’s something else entirely.

7B) If you attack him with anything as he is, whether it be a cube, laser, energy pellet, or rocket, he won’t respond. Making a Wheatley boss is complex; part of it involves making a very specifically-shaped hitbox trigger around him that is attached to him, which for my fights with him I borrowed it from Portal 2′s final boss. You have to set the hitbox trigger to trigger when whatever you want to damage him comes into impact with him; at most, this applies to launching physical objects at him, like cubes, rockets, and perhaps the energy pellet. Most basically this involves use of setting a filter_activator_model entity with the Filter Model keyvalue being set to the name of the model of the chosen ammunition. After that, it’s setting an output from the hitbox trigger after it has been triggered; having Wheatley being stunned from a hit is still its own story here.

8B) Valve uses scripted sequences for Wheatley’s boss fight, which means that if you want to make a fight with him that’s any different from the main campaign’s fight, you have to do everything manually; that includes stunning Wheatley. Personally, I set up a system to where when the hitbox trigger is triggered, a prop_dynamic clone of Wheatley swaps place with him via point_teleport entities and plays a stunned animation, and when his stunned sequence is over the real Wheatley is teleported back into place. You might want to find your own method, but then, if this is all too complicated for you, then maybe you shouldn’t have asked how to put Wheatley in a Hammer map.

{=====}

And that’s it! That’s my Comprehensive Guide With No Pictures. If you didn’t get any of that, then you shouldn’t have asked me about how to put Wheatley in a map in the first place. Just, stick to playing maps if that was the case.

Anyways. This is ALLOS signing off. Please never ask me how I put Wheatley in a Portal 2 map again, because this is the most detailed answer I’ll give you. For any further queries please just consult the Valve Developer Wiki.
Last edited by Anachronistic ALLOS; 1 Mar, 2019 @ 1:01am