Fr/Creating a button and door: Difference between revisions

From Valve Developer Community
< Fr
Jump to navigation Jump to search
(trad en cours)
 
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.)
 
(12 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar|Creating a button and door}}
| ru = Creating_a_button_and_door:ru
{{Back|:Category:Portal level design/fr}}
| fr = Creating_a_button_and_door:fr
{{translate}}
| en = Creating_a_button_and_door}}


{{Back|Portal Level Creation:fr}}


== Introduction ==
== Introduction ==
Ce guide vous permettra de comprendre comment créer un super bouton ouvrant une porte spécifique.
Ce guide vous permettra de comprendre comment créer un bouton ouvrant une porte spécifique.


== Les paramètres de la porte ==
== Les paramètres de la porte ==
Line 13: Line 11:


=== Choisir la porte ===
=== Choisir la porte ===
Créer un [[prop_static]] dans votre couloir. Allez dans ''World Model'' et choisissez "<code>models/props/door_01_frame_reference.mdl</code>" ou "<code>models/props/door_01_frame_wide_reference.mdl</code>" (les deux fonctionnent).
On va poser le cadre de la porte: créer une entité {{L|prop_static}} dans votre couloir. Allez dans ''World Model'' et choisissez le ''model'' "<code>models/props/door_01_frame_reference.mdl</code>" ou "<code>models/props/door_01_frame_wide_reference.mdl</code>" (les deux fonctionnent).


=== Les portes ===
=== Les portes ===
[[Image:Buttonanddoor1.jpg|right|thumb|How to align the <code>func_door</code>.]]
[[File:Buttonanddoor1.jpg|right|thumb|How to align the <code>func_door</code>.]]
1. Créer un [[prop_dynamic]] avec les paramètres suivants:
A l'intérieur, on va placer la partie mouvante. Elle est composée de deux parties : la partie gauche et la droite. On commence par la partie gauche :
 
1. Créer une entité {{L|prop_dynamic}} avec les paramètres suivants:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 25: Line 25:
| Name || door_left_model
| Name || door_left_model
|}
|}
L'aligner sur la gauche, dans la ''frame'' de la porte.
L'aligner sur la gauche, dans la ''frame'' de la porte statique.


2. Créer un ''block brush'' de <code>56Lx8Wx104H</code> avec la  texture [[nodraw]] centré et dans le ''model'' de la porte. Tie it to a [[func_door]] entity by selecting the object and using the menu option "Tie to Entity". The func_door entity should have the following settings:
2. Créer un ''block brush'' de <code>56Lx8Wx104H</code> avec la  texture {{L|nodraw}}.  Appliquez-y (''Option>Tie to entity'') la class {{L|func_door}}. Les paramètres de l'entité ''func_door'' doivent être réglés ainsi :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 41: Line 41:
| Lip || 12
| Lip || 12
|-
|-
| Move Direction || (This will be different for which way your door is facing)
| Move Direction || (selon de quel côté on se trouve, ca ressemblera à 0 90 0 ou 0 -90 0)
|}
|}
Also make sure that you un-check ''Touch opens'' under ''Flags''.
Aussi, s'assurer que dans l'onglet ''Flags'', la fonction ''Touch opens'' soit décochée.


The best way to ensure you have the correct Move Direction is to first mark the direction on the circular indicator, then round to the nearest 90 degrees (so long as your doors are intended to be square with the Hammer coordinate system).  You can click the "Point At" button by the circular indicator and then click on the 3d view.  The angle from the entity to the place you clicked will then be listed as "angles" in the property list.
Centrez ce bloc dans celui de '''door_left_model'''.
{{note|You can also put a blocking damage if you don't want the player to get stuck inside it. Also, you can turn on Forced Closed for it to close even if the player tried to jam it open with a camera or cube.}}
 
[[Image:Buttonanddoor2.jpg|right|thumb|Final door.]]
 
3. Repeat steps 1-3 but change the following:
[[File:Buttonanddoor2.jpg|right|thumb|La porte finie.]]
For the <code>prop_dynamic</code>:
3. Répéter les étapes 1 à 3, mais en changeant ces paramètres :
Sur le <code>prop_dynamic</code>:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 63: Line 64:
| Name || door_right
| Name || door_right
|-
|-
| Move Direction || (The opposite of the move direction for the left door)
| Move Direction || (Soit 0 -90 0, soit 0 90 0)
|}
|}


4. Set the parent of <code>door_left_model</code> (the <code>prop_dynamic</code>) to "door_left". Also set the parent of <code>door_right_model</code> to "door_right".
4. Rajoutez dans l'entité dynamique '''door_left_model''' qu'elle doit être parent de ''door_left'' (Parent : door_left). Et l'entité '''door_right_model''' doit être parent de ''door_right'' (Parent : door_right).


== The button ==
== Le bouton ==
=== Models ===
=== Models ===
[[Image:Buttonanddoor3.jpg|right|thumb|How to align the button models.]]
[[File:Buttonanddoor3.jpg|right|thumb|How to align the button models.]]
1. Create a <code>prop_static</code> with a ''World Model'' of "<code>models/props/button_base_reference.mdl</code>".
On va placer maintenant les éléments du bouton :


2. Create a <code>prop_dynamic</code> aligned on top of the <code>prop_static</code> with the following settings:
1. La base du bouton : créer une entité ''prop_static'' en choisissant dans ''World Model'' le model '''models/props/button_base_reference.mdl'''.
 
2. Le dessus du bouton (le 'couvercle rouge') : créer une entité ''prop_dynamic'' avec les paramètres suivants :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 82: Line 85:
|}
|}


=== Movement ===
=== Mouvement ===
1. Next create a <code>58Wx58Lx9H</code> cylinder brush with 8 sides and textured with [[Tool textures|nodraw]]. Move this brush right underneath your <code>prop_dynamic</code>. Tie the cylinder to a [[func_door]] with the following settings:
Pour rendre le bouton 'vivant', il nous faut un peu de script :
 
1. Créer un cylindre de <code>58Wx58Lx9H</code> avec une ''brush'' à 8 côtés (''8 sides'') et avec la texture {{L|Tool textures|nodraw}}. Placez cette ''brush'' dans votre support de bouton statique, et sous le bouton rouge. Appliquez la fonction {{L|func_door}} sur ce cylindre (''option > tie to entity'') avec les paramètres suivants :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_top_door
| Name || button_01_door
|-
|-
| Speed || 25
| Speed || 25
Line 93: Line 98:
| Delay before Reset || -1
| Delay before Reset || -1
|-
|-
| Move Direction || 90 0 0 (or Down)
| Move Direction || 90 0 0 (ou ''Down'')
|}
|}
Also make sure nothing is checked under ''Flags''.
Assurez-vous que rien n'est coché dans l'onglet ''Flags''.


2. Set the Parent of <code>button_top_model</code> to be "button_top_door".
2. Sélectionnez '''button_top_model''' et ajouter le paramètre Parent : '''button_01_model'''.


=== Triggers ===
=== Triggers ===
[[Image:Buttonanddoor4.jpg|right|thumb|The larger trigger_multiple.]]
[[File:Buttonanddoor4.jpg|right|thumb|The larger trigger_multiple.]]
1. Create a <code>48Wx48Lx1H</code> block brush with [[Tool textures|trigger texture]] applied. Place it right on top of the <code>button_top_model</code>. Tie this brush to a [[trigger_multiple]] with the following settings:
Cette partie va nous permettre de définir qu'est-ce qui pourra appuyer sur le bouton. Ici, ça sera le joueur et les boites.
 
1. Créer un ''block'' de <code>48Wx48Lx1H</code> avec la texture {{L|Tool textures|trigger texture}}. Placez-le au-dessus du bouton rouge '''button_top_model'''. Appliquez la fonction {{L|trigger_multiple}} sur ce block (''option > tie to entity'') avec les paramètres suivants :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_trigger_player
| Name || button_01_player_trigger
|}
|}
We will set up the Output later. Also make sure to only have the flag: ''Client'' set.
On appliquera plus tard les paramètres ''Output''. Dans l'onglet ''flag'', assurez-vous de cocher ''Client''.
[[Image:Buttonanddoor5.jpg|right|thumb|The smaller trigger_multiple.]]
[[File:Buttonanddoor5.jpg|right|thumb|Le petit ''trigger_multiple''.]]
2. Next create a <code>7Wx7Lx1H</code> cylinder brush with 8 sides and textured with trigger texture applied. Put this brush directly on top and in the center of the <code>button_top_model</code> and tie it to a <code>trigger_multiple</code> with the following settings:
 
2. Ensuite, créer un cylindre de <code>7Wx7Lx1H</code> avec une ''brush'' à 8 côtés (''8 sides'') et une texture ''Trigger''. Posez cette ''brush'' centrée et au-dessus du '''button_top_model''' et appliquez la fonction '''trigger_multiple''' (''option > tie to entity'') avec les paramètres suivants :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_trigger_box
| Name || button_01_box_trigger
|}
|}
And only the following Flags are checked:
Et dans 'Flags'', cochez uniquement '''Everythings'''


* Physics Objects
On appliquera plus tard les paramètres ''Output''


We will set up the Output later.
3. Créer une entité {{L|filter_activator_name}} à côté de votre bouton avec les paramètres suivants :
 
3. Create a [[filter_activator_name]] nearby your button with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_filter_boxes
| Name || filter_boxes
|-
|-
| Filter Name || (The name your box entity has)
| Filter Name || Box
|}
|}


4. Select your <code>button_trigger_box</code> trigger and set the Filter Name to "button_filter_boxes".
4. Allez dans les paramètres de '''button_01_box_trigger''' et choisir pour ''Filter Name'' le paramètre "filter_boxes".


5. Create two [[ambient_generic]] entities and give one the following settings:
5. Créer deux entités {{L|ambient_generic}} avec les paramètres suivants :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_down
| Name || button_01_down
|-
|-
| Sound Name || Portal.button_down
| Sound Name || Portal.button_down
|-
|-
| Source Entity Name || button_top_model
| Source Entity Name || button_01_door
|}
|}
and the other with
Et l'autre avec :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || button_up
| Name || button_01_up
|-
|-
| Sound Name || Portal.button_up
| Sound Name || Portal.button_up
|-
|-
| Source Entity Name || button_top_model
| Source Entity Name || button_01_door
|}
|}


6. Now go back and select the cylinder <code>func_door</code> brush under the button, "button_top_door" and setup the Outputs as below:
6. Maintenant, sélectionnez le cylindre "button_01_door" (sous le bouton rouge) et réglez l'onglet ''Outputs'' comme ceci:
::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnClose || door_left || Close || <none> || 0.00 || No
| [[File:Io11.png]] || OnClose || door_left || Close || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnClose || door_right || Close || <none> || 0.00 || No
| [[File:Io11.png]] || OnClose || door_right || Close || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnClose || button_up || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnClose || button_01_up || PlaySound || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnOpen || door_left || Open || <none> || 0.00 || No
| [[File:Io11.png]] || OnOpen || door_left || Open || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnOpen || door_right || Open || <none> || 0.00 || No
| [[File:Io11.png]] || OnOpen || door_right || Open || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnOpen || button_down || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnOpen || button_01_down || PlaySound || <none> || 0.00 || No
|}
|}


7. Select the larger <code>trigger_multiple</code>, "button_trigger_player" and setup the Output as below:
7. Sélectionnez le plus gros Trigger '''button_trigger_player''' et réglez l'onglet ''Outputs'' comme ceci:
::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || button_trigger_box || Enable || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchAll || button_01_box_trigger || Enable || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || button_top_door || Open || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchAll || button_01_door || Close || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouch || button_trigger_box || Disable || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouch || button_01_box_trigger || Disable || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouch || button_top_door || Close || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouch || button_01_door || Open || <none> || 0.00 || No
|}
|}
8. Select the smaller, cylinder <code>trigger_multiple</code>, "button_trigger_box" and setup the Output as below:
8. Sélectionnez le plus petit Trigger '''button_trigger_box''' et réglez l'onglet ''Outputs'' comme ceci:
::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || button_trigger_player || Enable || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchAll || button_01_player_trigger || Enable || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || button_top_door || Open || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchAll || button_01_door || Close || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouch || button_trigger_player || Disable || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouch || button_01_player_trigger || Disable || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouch || button_top_door || Close || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouch || button_01_door || Open || <none> || 0.00 || No
|}
|}
[[Image:Buttonanddoor6.jpg|right|thumb|The final product.]]
[[File:Buttonanddoor6.jpg|right|thumb|The final product.]]
Please do not edit the table above because it has mislead many users. Thank you.


9. Finally, create a [[light]] entity underneath the top of the button but still inside the base. Give it the following properties:
9. Enfin, créer une entité {{L|light}} que vous allez placer dans le bouton (sous le couvercle rouge et centrée). Réglez l'entité comme ceci :
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 205: Line 210:
| BrightnessHDR || 251 159 57 20
| BrightnessHDR || 251 159 57 20
|}
|}
{{Note|The light should be '''2''' Units above the original base ground that the main base Button model is on, in order to cast correctly.}}


You have now created a button which will open a door by a player standing on the button or a box weighing it down. Only those two things will work on it.
10. Créez un cube en choisissant un {{L|prop_physics}} avec le ''model'' '''models/props/metal_box.mdl'''. Dans les propriétés, nommez-le '''Box''' (Name : box)
 
Voila, vous avez un bouton qui ouvre une porte, quand le joueur, ou un cube, est dessus.
 
{{clr}}
{{clr}}


Line 215: Line 222:
===Clipping the hole===
===Clipping the hole===


Do not [[carve]] the hole for the door. Always use the [[clipping tool]].
Do not {{L|carve}} the hole for the door. Always use the {{L|clipping tool}}.
Make a 128 by 128 block around the door.
Make a 128 by 128 block around the door.


Line 222: Line 229:


Once you have cut around the door frame, delete the part that is blocking the door.
Once you have cut around the door frame, delete the part that is blocking the door.
Select the rest of the brush left behind, and click the "to entity" button to turn it into a [[func_detail]].
Select the rest of the brush left behind, and click the "to entity" button to turn it into a {{L|func_detail}}.


You now have a hole that the door can fit into, and can be easily placed into any map.
You now have a hole that the door can fit into, and can be easily placed into any map.


== The theory ==
== The theory ==
This is the most basic button and door setup. You can also have the triggers turn off or on other things in the map, have them trigger a [[logic_choreographed_scene]] or just about anything. For the Portal feel you can have them trigger [[Creating indicator lights|Indicator Lights]] based on the button up or down status.
This is the most basic button and door setup. You can also have the triggers turn off or on other things in the map, have them trigger a {{L|logic_choreographed_scene}} or just about anything. For the Portal feel you can have them trigger {{L|Creating indicator lights|Indicator Lights}} based on the button up or down status.


If you do decide to use [[Creating indicator lights|Indicator Lights]], then make sure to have the [[func_door]] (The Nodraw cylinder) Set Outputs when it closes, and opens. When it opens, set the texture Index to 1, and when it closes, set the texture index to 0, via a [[env_texturetoggle]] that controls the lights.
If you do decide to use {{L|Creating indicator lights|Indicator Lights}}, then make sure to have the {{L|func_door}} (The Nodraw cylinder) Set Outputs when it closes, and opens. When it opens, set the texture Index to 1, and when it closes, set the texture index to 0, via a {{L|env_texturetoggle}} that controls the lights.


== See also ==
== See also ==
* [[Portal Level Creation:fr]]
* {{LCategory|Portal level design}}




Line 238: Line 245:


[[Category:French]]
[[Category:French]]
[[Category:Level Design:fr]]
{{ACategory|Level Design}}
[[Category:Tutorials:fr]]
{{ACategory|Tutorials}}
[[Category:Level Design Tutorials]]
{{ACategory|Portal}}
[[Category:Portal]]

Latest revision as of 17:52, 18 July 2025

English (en)Français (fr)Русский (ru)Translate (Translate)
[[::Category:Portal level design/fr | ← :Category:Portal level design/fr ]]
Info content.png
This page needs to be translated.
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)


Introduction

Ce guide vous permettra de comprendre comment créer un bouton ouvrant une porte spécifique.

Les paramètres de la porte

La première chose à faire est de créer la porte qui s'ouvrira quand on activera le bouton.

Choisir la porte

On va poser le cadre de la porte: créer une entité prop_static(en) dans votre couloir. Allez dans World Model et choisissez le model "models/props/door_01_frame_reference.mdl" ou "models/props/door_01_frame_wide_reference.mdl" (les deux fonctionnent).

Les portes

How to align the func_door.

A l'intérieur, on va placer la partie mouvante. Elle est composée de deux parties : la partie gauche et la droite. On commence par la partie gauche :

1. Créer une entité prop_dynamic(en) avec les paramètres suivants:

Property Name Value
World Model models/props/door_01_lftdoor_reference.mdl
Name door_left_model

L'aligner sur la gauche, dans la frame de la porte statique.

2. Créer un block brush de 56Lx8Wx104H avec la texture nodraw(en). Appliquez-y (Option>Tie to entity) la class func_door(en). Les paramètres de l'entité func_door doivent être réglés ainsi :

Property Name Value
Name door_left
Speed 250
Stop Sound Doors.FullClose8
Delay before Reset -1
Lip 12
Move Direction (selon de quel côté on se trouve, ca ressemblera à 0 90 0 ou 0 -90 0)

Aussi, s'assurer que dans l'onglet Flags, la fonction Touch opens soit décochée.

Centrez ce bloc dans celui de door_left_model.


La porte finie.

3. Répéter les étapes 1 à 3, mais en changeant ces paramètres : Sur le prop_dynamic:

Property Name Value
World Model models/props/door_01_rtdoor_reference.mdl
Name door_right_model

And for the func_door:

Property Name Value
Name door_right
Move Direction (Soit 0 -90 0, soit 0 90 0)

4. Rajoutez dans l'entité dynamique door_left_model qu'elle doit être parent de door_left (Parent : door_left). Et l'entité door_right_model doit être parent de door_right (Parent : door_right).

Le bouton

Models

How to align the button models.

On va placer maintenant les éléments du bouton :

1. La base du bouton : créer une entité prop_static en choisissant dans World Model le model models/props/button_base_reference.mdl.

2. Le dessus du bouton (le 'couvercle rouge') : créer une entité prop_dynamic avec les paramètres suivants :

Property Name Value
World Model models/props/button_top_reference.mdl
Name button_top_model

Mouvement

Pour rendre le bouton 'vivant', il nous faut un peu de script :

1. Créer un cylindre de 58Wx58Lx9H avec une brush à 8 côtés (8 sides) et avec la texture nodraw(en). Placez cette brush dans votre support de bouton statique, et sous le bouton rouge. Appliquez la fonction func_door(en) sur ce cylindre (option > tie to entity) avec les paramètres suivants :

Property Name Value
Name button_01_door
Speed 25
Delay before Reset -1
Move Direction 90 0 0 (ou Down)

Assurez-vous que rien n'est coché dans l'onglet Flags.

2. Sélectionnez button_top_model et ajouter le paramètre Parent : button_01_model.

Triggers

The larger trigger_multiple.

Cette partie va nous permettre de définir qu'est-ce qui pourra appuyer sur le bouton. Ici, ça sera le joueur et les boites.

1. Créer un block de 48Wx48Lx1H avec la texture trigger texture(en). Placez-le au-dessus du bouton rouge button_top_model. Appliquez la fonction trigger_multiple(en) sur ce block (option > tie to entity) avec les paramètres suivants :

Property Name Value
Name button_01_player_trigger

On appliquera plus tard les paramètres Output. Dans l'onglet flag, assurez-vous de cocher Client.

Le petit trigger_multiple.

2. Ensuite, créer un cylindre de 7Wx7Lx1H avec une brush à 8 côtés (8 sides) et une texture Trigger. Posez cette brush centrée et au-dessus du button_top_model et appliquez la fonction trigger_multiple (option > tie to entity) avec les paramètres suivants :

Property Name Value
Name button_01_box_trigger

Et dans 'Flags, cochez uniquement Everythings

On appliquera plus tard les paramètres Output

3. Créer une entité filter_activator_name(en) à côté de votre bouton avec les paramètres suivants :

Property Name Value
Name filter_boxes
Filter Name Box

4. Allez dans les paramètres de button_01_box_trigger et choisir pour Filter Name le paramètre "filter_boxes".

5. Créer deux entités ambient_generic(en) avec les paramètres suivants :

Property Name Value
Name button_01_down
Sound Name Portal.button_down
Source Entity Name button_01_door

Et l'autre avec :

Property Name Value
Name button_01_up
Sound Name Portal.button_up
Source Entity Name button_01_door

6. Maintenant, sélectionnez le cylindre "button_01_door" (sous le bouton rouge) et réglez l'onglet Outputs comme ceci:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnClose door_left Close <none> 0.00 No
Io11.png OnClose door_right Close <none> 0.00 No
Io11.png OnClose button_01_up PlaySound <none> 0.00 No
Io11.png OnOpen door_left Open <none> 0.00 No
Io11.png OnOpen door_right Open <none> 0.00 No
Io11.png OnOpen button_01_down PlaySound <none> 0.00 No

7. Sélectionnez le plus gros Trigger button_trigger_player et réglez l'onglet Outputs comme ceci:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndTouchAll button_01_box_trigger Enable <none> 0.00 No
Io11.png OnEndTouchAll button_01_door Close <none> 0.00 No
Io11.png OnStartTouch button_01_box_trigger Disable <none> 0.00 No
Io11.png OnStartTouch button_01_door Open <none> 0.00 No

8. Sélectionnez le plus petit Trigger button_trigger_box et réglez l'onglet Outputs comme ceci:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndTouchAll button_01_player_trigger Enable <none> 0.00 No
Io11.png OnEndTouchAll button_01_door Close <none> 0.00 No
Io11.png OnStartTouch button_01_player_trigger Disable <none> 0.00 No
Io11.png OnStartTouch button_01_door Open <none> 0.00 No
The final product.

9. Enfin, créer une entité light(en) que vous allez placer dans le bouton (sous le couvercle rouge et centrée). Réglez l'entité comme ceci :

Property Name Value
Brightness 251 159 57 30
BrightnessHDR 251 159 57 20

10. Créez un cube en choisissant un prop_physics(en) avec le model models/props/metal_box.mdl. Dans les propriétés, nommez-le Box (Name : box)

Voila, vous avez un bouton qui ouvre une porte, quand le joueur, ou un cube, est dessus.

Making a hole in the wall

While this step is optional, and your door may be fully functional without it, your map will look especially awkward if you just have a door in the middle of a space, and even more so if you have walls around it to block the player before opening the door. This step is simple enough, so it is recommended that you try it out.

Clipping the hole

Do not carve(en) the hole for the door. Always use the clipping tool(en). Make a 128 by 128 block around the door.

Using the clip tool, trace the outline of the door frame. Make sure not to leave gaps that aren't covered up by the door frame.

Once you have cut around the door frame, delete the part that is blocking the door. Select the rest of the brush left behind, and click the "to entity" button to turn it into a func_detail(en).

You now have a hole that the door can fit into, and can be easily placed into any map.

The theory

This is the most basic button and door setup. You can also have the triggers turn off or on other things in the map, have them trigger a logic_choreographed_scene(en) or just about anything. For the Portal feel you can have them trigger Indicator Lights(en) based on the button up or down status.

If you do decide to use Indicator Lights(en), then make sure to have the func_door(en) (The Nodraw cylinder) Set Outputs when it closes, and opens. When it opens, set the texture Index to 1, and when it closes, set the texture index to 0, via a env_texturetoggle(en) that controls the lights.

See also


|}