Gel
Gel or Paint is a puzzle element of Portal 2. It flows in blobs, or in packets of blobs as bombs, and covers most surfaces or objects it touches, changing the physical properties and coloring it. The exceptions to this are glass and grating: glass cannot be painted, and gel travels through grating. Gel streams can be redirected with portals and excursion funnels.
Note: Gel placement functions through the use of generated paintmaps, the scale of which on any particular surface is based on its respective lightmap scale. This means that a map must have lighting (and not just running VRAD) to render gel splats, and the lightmap scale directly affects the scale of gel on surfaces. Gel seems to work best with the scale set to 16. Lower numbers may cause lag spikes, and higher can result in odd behavior.
Note: To use gel, the map needs to have Paint in Map set to True in worldspawn
. Maps that do not use gel can save significant resources by avoiding touching gel textures and code.
Types of Gel[edit | edit source]
There are six gel types:
- Repulsion gel: Blue, causes things to bounce around.
- Propulsion gel: Orange, reduces friction, making objects slippery and players move quickly.
- Conversion gel: White, allows portals to be placed on any surface to which it is applied.
- Cleansing gel: Clear, erases effects of other gels.
- Reflection gel: Unused (but mostly functional) gel that reflects lasers. Blob texture and particle systems are missing. Does not properly apply to physics objects, except to negate the effects of sliding on propulsion gel.
- Note: To fix the reflection gel texture, create a VMT and VTF named "blob_surface_stick". You can copy and adapt the information from one of the other texture files in
materials\paintblobs\
. - Note: Reflection gel also has the capability to reflect turret lasers, as well as redirect some projectiles, such as rockets from rocket turrets.
- Adhesion gel: Unused gel that allows players and objects to stick to surfaces. This is non-functional, except for negating the effects of propulsion gel if applied to cubes. The code for this used to exist in Portal 2, prior to the DLC1 update replacing it completely with reflection gel. There have been recreations of this gel with VScript.
Creating a Gel Dropper[edit | edit source]
Using an instance[edit | edit source]
Place a func_instance
entity with the following properties:
Property Name | Value |
---|---|
Fix up Name | gel_dropper |
VMF Filename | instances/gameplay/paint_dropper.vmf |
$paint_sprayer | gel_sprayer |
$trigger_to_start | start |
$trigger_to_stop | stop |
$paint_type | 0 = Bounce, 1 = Reflection , 2 = Speed, 3 = Conversion, 4 = Cleansing |
If the dropper doesn't show up, try restarting Hammer.
Create the entity you want to activate the gel dropper, such as a trigger_once
at the entrance to the room, and give it the following output:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once |
---|---|---|---|---|---|
OnStartTouch | gel_dropper-start | Trigger | 0.00 | No |
Note: Hammer may warn you that this is invalid. The game will recognize what it is though.
From scratch[edit | edit source]
- Place a dropper prop, including any visible pipes.
- Place an
info_paint_sprayer
inside the dropper, and tune it to your liking. - If there is anything that enables or disables the gel dropper, send Start and/or Stop inputs to the
info_paint_sprayer
. - Depending on your model, you may want to change skins or play animations when enabled or disabled.
If you want to create paint bombs, follow these steps in place of an info_paint_sprayer
:
- Place a
prop_paint_bomb
, and give it a name likepaint_bomb
. - Place a
point_template
. Give it a name likepaint_bomb_temp
and set Template 01 topaint_bomb
. - Put this output in your
prop_paint_bomb
:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once |
---|---|---|---|---|---|
OnExploded | paint_bomb_temp | ForceSpawn | 0.00 | No |
Alternatively, you can use a logic_timer
instead using the output above, just change OnExploded to OnTimer. This alternative method will allow multiple paint bombs to be used at once which could collide with each other in midair and probably be a nuisance.
If your input device can be activated rapidly, consider having a logic_relay
do the spawning inputs so that you can temporarily disallow the point_template
from spawning more paint bombs after your device is activated.
Conversion Gel Color[edit | edit source]
There is some evidence saying that conversion gel was originally pure white, and that the current gray color was an accident by Valve, made while developing the 6th coop campaign (Art Therapy).
How Valve could have missed this is not very clear, because at least one Art Therapy map used conversion gel, so they must have noticed. It could have been an intentional change, possibly to make it blend in better with darker areas, or so it's more visible on white surfaces.
Whatever the case, you can change it to pure white with this console command: portal_paint_color 255 255 255 255
(Requires a new map to be loaded or the current map to be saved and reloaded before taking effect.).
Controlling gel[edit | edit source]
When designing a puzzle, be very mindful of possible exploits that may arise! It is generally very easy to exploit, and it should therefore be handled somewhat restrictively. When gel ends up in unplanned spots, puzzles can break. To keep your maps from having gel issues, there are multiple solutions:
- Careful level design -- force the player to abandon gel, reduce portalable and paintable surfaces, use grating on floors, etc.
trigger_paint_cleanser
erases gel. Also consider using cleansing gel.%nopaint
makes a texture unpaintable.- Displacements cannot be painted. However, displacements are typically reserved for more organically shaped surfaces such as cave walls.
Take care to not diminish the realism in your map. Anything unpaintable should have an in-game justification.
Other notes:
- Conversion gel is usually the easiest gel to exploit because it opens up more places for portals to reach, creating a cycle of expanding capabilities. It does however need at least the space of a portal to be used.
- Repulsion gel is also very easy to get out of hand because of its launching power. Even a tiny splat smaller than a portal can be used, and at any angle.
- Propulsion gel is the hardest gel to abuse. It's only useful on walkable surfaces, and needs a fairly large area to gain significant speed.
- Paint can reach unexpected areas with angled flings or double flings.
- Paint bombs will not explode if they hit a surface with an unusually small amount of force. Worst case scenario, players can roll a bomb around and make it explode at any spot on the ground or use it to slightly boost their height.
- Paint bombs explode prematurely by touching the player.
- Paint bombs can nudge or be nudged by players and cubes.
- Paint bombs can reach out further when portal funneling is enabled or disabled, depending on the situation.
- Paint will slowly lose kinetic energy when continually moving between two portals on a floor. Don't count on gel to always travel a certain speed.
- Walls painted with repulsion gel combined with a painted floor allows the player to climb to the highest painted spot on a wall. This is because jumping height is always preserved when bouncing on floors, and bouncing on walls will move the player upward slightly.
- When loading from a save, any midair gel streams being flung from a portal may exhibit strange behavior, such as lost or gained momentum.
Related Entities[edit | edit source]
info_paint_sprayer
paint_sphere
prop_paint_bomb
prop_physics_paintable
trigger_paint_cleanser
item_paint_power_pickup
weapon_paintgun
paint_stream