Creating An Auto Portal: Difference between revisions
Line 18: | Line 18: | ||
Position the prop_portal 2 units above the bottom of the portal frame (prop_static entity). Now center it based off the "bars" of the portal frame using the "top (x/y) view". | Position the <code> prop_portal </code> 2 units above the bottom of the portal frame (prop_static entity). Now center it based off the "bars" of the portal frame using the "top (x/y) view". | ||
{{warning|If placed improperly, the portal will be inside the wall making the portal useless although the edges of the effects show.}} | {{warning|If placed improperly, the portal will be inside the wall making the portal useless although the edges of the effects show.}} |
Revision as of 02:34, 13 June 2019
This guide will show you how to create 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"
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.

Position the prop_portal
2 units above the bottom of the portal frame (prop_static entity). Now center it based off the "bars" of the portal frame using the "top (x/y) view".

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:
Auto Portal for ceilings, floors, or Flinging
I highly suggest you read "Auto Portal on the wall to walk 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.

Implementation
Make the Portal spawn
Make some entity trigger the relay_portal_spawn
logic_relay
For example with trigger_once:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
![]() |
OnTrigger | relay_portal_spawn | Trigger | 0.00 | No |
Make the Portal close
To make the portal close, you set the active state to 0,
here's in example with trigger_once:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
![]() |
OnTrigger | portal | SetActivatedState | 0 | 0.00 | No |