Giant Fan (Portal 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(more info, will add the arch primitive instructions later)
(finished rewriting the page)
Line 1: Line 1:
{{Orphan|date=January 2024}}
{{Orphan|date=May 2025}}


The Giant Fan is a [[Behind the Scenes (Portal 2)|Behind the Scenes]] decoration used in the co-op campaign. The fan is meant to be purely decorative and is used to "push a lot of air". {{portalrev|4}} turns it into a gameplay element.
The Giant Fan is a [[Behind the Scenes (Portal 2)|Behind the Scenes]] decoration used in the co-op campaign. The fan is meant to be purely decorative and is used to "push a lot of air". {{portalrev|4}} uses it as a gameplay element.


== Creating a Giant Fan ==
== Creating a Giant Fan ==


1. Select the brush tool, and in the object bar, change <code>block</code> to <code>arch</code> with the drop down menu. Then in the properties
1. Select the brush tool, and in the object bar, change <code>block</code> to <code>arch</code> with the drop down menu.
:[[File:Hammer-Howto2.png|thumb|left|Step 1]]{{clr}}
:[[File:GiantFan-HowTo1.png|thumb|left|How the object bar should look like]]{{clr}}


2. Next draw a 1056 x 1056 cylinder, make it at least 220 units thick.
2. Next draw a 1280 x 1280 brush and make it at least 96 units thick. Replicate the properties from the screenshot. Remember to tie it to a <code>[[func_detail]]</code>.
:{{tip|If the fan is supposed to be vertical, you can temporarly check "Reorient primitives on creation in the active 2D view" in the 2D view options.}}


:[[File:Cylinser22.png|thumb|left|Step 2]]{{clr}}
:[[File:GiantFan-HowTo2.png|thumb|left|The arch properties]]{{clr}}


3. Push it into the wall that you want to put a fan in, the top should be slightly protruding with the wall. Right click and press carve.
3. Place down a <code>[[prop_dynamic]]</code> at the center, set its "World model" to <code>"models/props_bts/huge_fan.mdl"</code> and set "Disable shadows" to <code>Yes</code> ("Disable Producing Cheap Shadows" in {{TeamSpen|4}}). In the same position, create a <code>[[prop_static]]</code> and set its model to <code>models/props_bts/huge_fan_rim.mdl</code>.
:{{tip|You can use the shift key and the arrow keys keys together to place two point entities at the exact same position.}}


:{{warning|The carve tool creates unstable and "messy" geometry when used with complex objects.}}
4. You can now place the supports, simply place one or multiple <code>[[prop_static]]</code>(s) with the <code>models/props_bts/huge_fan_rod.mdl</code> model, and make them come from the center of the fan model. You can then place other props with the <code>models/props_bts/huge_fan_support.mdl</code> model, make their "T-Junction part" come in the rod props.
::{{workaround|Use the arch primitve instead, remember to tie it to a <code>[[func_detail]]</code>.}}
:{{tip|You can use {{hpp|4}}'s pivot point feature to rotate these props around the rod easily.}}
:{{note|You can additionaly extend the arch and add props with the <code>models/props_bts/huge_fan_inner_rim.mdl</code> model throughout.}}


4. Place down three props; Three [[prop_static|static]], one [[prop_dynamic|dynamic]]. The dynamic prop will be the fan itself, in the "World model" property, set the model to <code>"models/props_bts/huge_fan.mdl"</code>. The other two parts will be the fan rims, and its supports. Position these in a way that you see fit. Make sure to set "Disable shadows" ("Disable Producing Cheap Shadows" in {{TeamSpen|4}}) to "Yes".
5. In order for the fan to spin, create a small brush at the center of fan prop with the <code>[[Nodraw|tools/toolsodraw]]</code> texture. Tie the brush to <code>[[func_rotating]]</code>. In the flags tab, check <code>"Start ON"</code> (if the fan must start enabled), <code>"Acc/Dcc"</code> and the axis corresponding to the fan's direction (only check <code>"X axis"</code> or <code>"Y axis"</code> if the fan is vertical, if it's horizontal, don't check any axis flag). Set the maximum rotation speed to 400, the friction to 18 and the blocking damage to 1000. At last, name this entity in a way preferably indicating that it is used to make other entities rotate (for instance : <code>"fan_rotator"</code>).
:{{note|You can add a <code>[[trigger_hurt]]</code> spanning across the entire fan to be certified players cannot pass through the fan.}}


5. In order for the fan to spin, create a small brush near the fan with the <code>[[Nodraw|tools/toolsodraw]]</code> texture. Select the brush and press Ctrl+T to tie the brush to an entity. Make it a <code>[[func_rotating]]</code>, in the flags tab, check "Start ON" (if the fan must start enabled), "Fan Pain" and the axis box that corresponds to your fan direction ( "X Axis" -> horizontal and "Y Axis" -> vertical ). Set the maximum rotation speed to 400 and the friction to 1. At last, name this entity in a way preferably indicating it is used to make other entities rotate (for instance : <code>"fan_rotator"</code>).
6. In order for the blades to spin, parent them to the <code>[[func_rotating]]</code>. Simply specify the name of the <code>[[func_rotating]]</code> in the <code>[[prop_dynamic]]</code>'s parent field.
 
:{{warning|<code>[[func_rotating]]</code> will not rotate forever. You can use the [[Vscript]] snippet given in its dedicated page to circumvent this bug.}}
:{{note|You can add a <code>[[trigger_hurt]]</code> spanning across the entire fan to stop players from passing through the fan.}}
 
6. In order for the blades to spin, they have to be parented to the <code>[[func_rotating]]</code>. Specify the name of the fan's rotator in the <code>[[prop_dynamic]]</code>'s parent field.


:{{warning|<code>[[func_rotating]]</code> will not rotate forever. You can use the [[Vscript]] snippet given in its dedicated page to circumvent this bug.}}
7. Add an <code>[[ambient_generic]]</code> with <code>World.LargeFanLoop</code> as its sound name, and set the sound range to something hearable from far away (for instance, <code>mp_coop_fan</code> uses 2348 units). Make sure to place it near the fan.
:{{tip|An <code>[[env_projectedtexture]]</code> can be placed behind the fan to create a pretty lighting effect.}}


7. The last step is to add a sound. In the <code>[[func_rotating]]</code>'s properties, add <code>World.LargeFanLoop</code> to the "Sound when moving" field ("Rotating sound WAV" in {{TeamSpen|4}}).
== Making the Giant Fan start/stop ==
{{todo|todo, it should be as simple as deactivating/activating the <code>func_rotating</code>, disabling the loop sound's <code>ambient_generic</code> and playing the start/stop sounds.}}


[[Category:Portal 2]]
[[Category:Portal 2]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]

Revision as of 08:11, 10 May 2025

The Giant Fan is a Behind the Scenes decoration used in the co-op campaign. The fan is meant to be purely decorative and is used to "push a lot of air". Portal: Revolution Portal: Revolution uses it as a gameplay element.

Creating a Giant Fan

1. Select the brush tool, and in the object bar, change block to arch with the drop down menu.

How the object bar should look like

2. Next draw a 1280 x 1280 brush and make it at least 96 units thick. Replicate the properties from the screenshot. Remember to tie it to a func_detail.

Tip.pngTip:If the fan is supposed to be vertical, you can temporarly check "Reorient primitives on creation in the active 2D view" in the 2D view options.
The arch properties

3. Place down a prop_dynamic at the center, set its "World model" to "models/props_bts/huge_fan.mdl" and set "Disable shadows" to Yes ("Disable Producing Cheap Shadows" in TeamSpen's Hammer Addons TeamSpen's Hammer Addons). In the same position, create a prop_static and set its model to models/props_bts/huge_fan_rim.mdl.

Tip.pngTip:You can use the shift key and the arrow keys keys together to place two point entities at the exact same position.

4. You can now place the supports, simply place one or multiple prop_static(s) with the models/props_bts/huge_fan_rod.mdl model, and make them come from the center of the fan model. You can then place other props with the models/props_bts/huge_fan_support.mdl model, make their "T-Junction part" come in the rod props.

Tip.pngTip:You can use Hammer++ Hammer++'s pivot point feature to rotate these props around the rod easily.
Note.pngNote:You can additionaly extend the arch and add props with the models/props_bts/huge_fan_inner_rim.mdl model throughout.

5. In order for the fan to spin, create a small brush at the center of fan prop with the tools/toolsodraw texture. Tie the brush to func_rotating. In the flags tab, check "Start ON" (if the fan must start enabled), "Acc/Dcc" and the axis corresponding to the fan's direction (only check "X axis" or "Y axis" if the fan is vertical, if it's horizontal, don't check any axis flag). Set the maximum rotation speed to 400, the friction to 18 and the blocking damage to 1000. At last, name this entity in a way preferably indicating that it is used to make other entities rotate (for instance : "fan_rotator").

Note.pngNote:You can add a trigger_hurt spanning across the entire fan to be certified players cannot pass through the fan.

6. In order for the blades to spin, parent them to the func_rotating. Simply specify the name of the func_rotating in the prop_dynamic's parent field.

Warning.pngWarning:func_rotating will not rotate forever. You can use the Vscript snippet given in its dedicated page to circumvent this bug.

7. Add an ambient_generic with World.LargeFanLoop as its sound name, and set the sound range to something hearable from far away (for instance, mp_coop_fan uses 2348 units). Make sure to place it near the fan.

Tip.pngTip:An env_projectedtexture can be placed behind the fan to create a pretty lighting effect.

Making the Giant Fan start/stop

Todo: todo, it should be as simple as deactivating/activating the func_rotating, disabling the loop sound's ambient_generic and playing the start/stop sounds.