Creating An Auto Portal: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(This guide will show you how to make an auto portal, fairly simple process.)
No edit summary
Line 8: Line 8:
=== The Frame ===
=== The Frame ===
Make a prop_static entity and change it's world model to "models/props/autoportal_frame/autoportal_frame.mdl"
Make a prop_static entity and change it's world model to "models/props/autoportal_frame/autoportal_frame.mdl"
        Image:Autoportal_frame.PNG|What the frame should look like
[[Image:Autoportal_frame.PNG|thumb|right|300px|What the auto Portal Frame should look like.]]


=== The Portal ===
=== The Portal ===
Make a prop_portal entity and name it "portal".
Make a prop_portal entity and name it "portal".
Set the Property "Start Activated" to Inactive.
Set the Property "Start Activated" to Inactive.
Set the "Portal Number" property to which portal you are using.
Set the "Portal Number" property to which portal you are using.
Note: Portal 1 is the Blue Portal and Portal 2 is the Orange/Red Portal.
Note: Portal 1 is the Blue Portal and Portal 2 is the Orange/Red Portal.


Position the prop_portal 2 units above the bottom of the portal frame (prop_static entity).
Position the prop_portal 2 units above the bottom of the portal frame (prop_static entity).
[[Image:Autoportal_align1.PNG|thumb|right|300px|What the positioning of the portal should look like]]


=== Portal Spawn Sound ===
=== Portal Spawn Sound ===
Make an ambient_generic entity and name it to "sound_portal_spawn".
Make an ambient_generic entity and name it to "sound_portal_spawn".
Set the "Sound Name" value depending on what type of portal you have. Portal.open_blue is the Blue Portal and Portal.open_red is the Orange Portal.
Set the "Sound Name" value depending on what type of portal you have. Portal.open_blue is the Blue Portal and Portal.open_red is the Orange Portal.
Set "Max Audible Distance" to "333".
Set "Max Audible Distance" to "333".
Set "Source Entity Name" to "portal".
Set "Source Entity Name" to "portal".


Go to flags and make sure these are set...
Go to flags have only "Is NOT Looped" checked
 
[] Play Everywhere
[] Start Silent
[^/] is NOT Looped


=== Portal Spawn Shake ===
=== Portal Spawn Shake ===
Make an env_shake entity and name it to "shake_portal_spawn".
Make an env_shake entity and name it to "shake_portal_spawn".
        Put this entity fairly close to where the player triggers it if the player is near by the portal.
Put this entity fairly close to where the player triggers it if the player is near by the portal.


=== Optional (Recommended) ===
=== Optional (Recommended) ===
If you want to make this a prefab, I suggest following these steps to make things easier...
If you want to make this a prefab, I suggest following these steps to make things easier...
Make a logic_relay and name it to relay_portal_spawn
Make a logic_relay and name it to relay_portal_spawn
Add the outputs:
Add the outputs:


OnTrigger portal SetActivatedState 1
OnTrigger portal SetActivatedState 1
OnTrigger shake_portal_spawn StartShake
OnTrigger shake_portal_spawn StartShake
OnTrigger sound_portal_spawn PlaySound
OnTrigger sound_portal_spawn PlaySound


== Auto Portal for ceilings, floors, Portals for Flinging: ==
== Auto Portal for ceilings, floors, Portals for Flinging: ==
Line 58: Line 55:
=== Rotating ===
=== Rotating ===


Simply rotate the entire portal and make further corrections afterwards.
Simply rotate the entire portal and make further corrections afterwards.
Note: Rotating the prop_portal will make the portal look like it is in the same position in the hammer editor, you will have to rely on which direction the origin (yellow line in 2d view) is facing.
 
Note: Rotating the prop_portal will make the portal look like it is in the same position in the hammer editor, you will have to rely on which direction the origin (yellow line in 2d view) is facing.




Line 65: Line 63:
=== Make the Portal spawn ===
=== Make the Portal spawn ===
Make some entity trigger the relay_portal_spawn logic_relay
Make some entity trigger the relay_portal_spawn logic_relay
        For example with:trigger_once:
For example with:trigger_once:
OnTrigger relay_portal_spawn Trigger
OnTrigger relay_portal_spawn Trigger


=== Make the Portal close ===
=== Make the Portal close ===
To make the portal close, give prop_portal entity an input of
To make the portal close, give prop_portal entity an input of


SetActivatedState 0
SetActivatedState 0

Revision as of 23:05, 29 April 2019

This guide is Work in Progress

Introduction

This guide will show you how to make an auto portal, this is a very simple process and should be done in no time.

Auto Portal on the wall to walk through

The Frame

Make a prop_static entity and change it's world model to "models/props/autoportal_frame/autoportal_frame.mdl"

What the auto Portal Frame should look like.


The Portal

Make a prop_portal entity and name it "portal". Set the Property "Start Activated" to Inactive. Set the "Portal Number" property to which portal you are using. Note: Portal 1 is the Blue Portal and Portal 2 is the Orange/Red Portal.

Position the prop_portal 2 units above the bottom of the portal frame (prop_static entity).

What the positioning of the portal should look like


Portal Spawn Sound

Make an ambient_generic entity and name it to "sound_portal_spawn". Set the "Sound Name" value depending on what type of portal you have. Portal.open_blue is the Blue Portal and Portal.open_red is the Orange Portal. Set "Max Audible Distance" to "333". Set "Source Entity Name" to "portal".

Go to flags have only "Is NOT Looped" checked


Portal Spawn Shake

Make an env_shake entity and name it to "shake_portal_spawn". Put this entity fairly close to where the player triggers it if the player is near by the portal.

Optional (Recommended)

If you want to make this a prefab, I suggest following these steps to make things easier... Make a logic_relay and name it to relay_portal_spawn Add the outputs:

OnTrigger portal SetActivatedState 1 OnTrigger shake_portal_spawn StartShake OnTrigger sound_portal_spawn PlaySound

Auto Portal for ceilings, floors, Portals for Flinging:

I highly suggest you read "Auto Portal on the wall to step through" before you enter this part.


Aligning the portal

Do your best to perfectly center the portal with the auto-portal frame.


Rotating

Simply rotate the entire portal and make further corrections afterwards.

Note: Rotating the prop_portal will make the portal look like it is in the same position in the hammer editor, you will have to rely on which direction the origin (yellow line in 2d view) is facing.


Implementation

Make the Portal spawn

Make some entity trigger the relay_portal_spawn logic_relay For example with:trigger_once: OnTrigger relay_portal_spawn Trigger


Make the Portal close

To make the portal close, give prop_portal entity an input of

SetActivatedState 0