WiseElec: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Electrified obstacles: Fixed link to env_physexplosion)
(Cleaned up the article a little bit. You can see a lot is missing, which I may add to withing 24 hours.)
Line 1: Line 1:
== Electrified obstacles ==
{{Template:Morescreenshots}}
== Electrified Obstacles ==


[[image:wiseElec01.jpg|thumb|150px|right|insert caption]]
[[image:wiseElec01.jpg|thumb|150px|right|Typical electrified obstacle.]]


For this tutorial I could have used just about anything for our electrified obstacle but picked this small railing because the player can jump over it once the electricity is turned off.
In this tutorial, we will create an obstacle in which it is electrified and can be toggled by a [[trigger]]. You can any [[model]] for this, but for the tutorial we will use a railing from ''Half Life 2'' (see right).  
Of course we could apply this same method to a ladder, door/gate or even water/ground.


In this example the railing is initially electrified but can be disabled by standing on the small Red carpet. Standing on the small Green carpet will re-enable the electricity. (The carpets are not shown here)
{{note|Remember the player has to get around the obstacle.}}


When a player "touches" the fence while it is electrified there will be sparks, smoke and sounds plus the player will get blown back a few feet.
{{note|You could apply this concept to a ladder, door/gate or even water/ground.}}


The [[trigger_hurt]] used in this tutorial starts off a series of events when the player touches it.
* Load the example file to see each of the entities mentioned here.


Once the player touches the [[trigger_hurt]] these entities are excited to get going via outputs:
For the purpose of this tutorial the rail obstacle is initially electrified, however, it can be disabled by standing on a small red carpet and re-enabled by standing on a small green carpet (the carpets are not shown in screenshots).
One [[env_physexplosion]], eight [[env_spark]]’s, one [[trigger_push]] and one [[logic_timer]], to lend some logic.


For the On and Off switch, if one would be needed, I’ve used two [[trigger_multiple]]’s and placed them over the red and green carpets. You could easily create a switch for this, another kind of "secret" trigger or the lever like Valve used in [[Ravenholm]].
When a player "touches" the fence while it is electrified there will be sparks, and the player will get blown back a few feet.


[[image:wiseElec02.jpg|thumb|150px|right|insert caption]]


I’ve used a [[prop_static]] for the railing/electrified object but you could just as easily use motion enabled entity types. Imagine a gate that would swing open once the electricity was turned off, or even a loose cable trapped under a vehicle.
{{tip|To create a realistic effect, you may want to add sounds and possibly smoke.}}


I don’t think you need a step by step on creating this.
 
[[trigger_hurt]] is used to start off the series of events when the player touches it. Additionally, it outputs to entities to create the "blow back" of the player and sparks. These are:
one (1) [[env_physexplosion]], eight (8) [[env_spark]]s, one (1) [[trigger_push]] and one (1) [[logic_timer]] to lend some logic.
 
 
{{note|Load the example map file at the bottom to see each of the entities mentioned here.}}
 
{{idea|You could easily create a switch for this, another kind of "secret" trigger or the lever like Valve used in [[Ravenholm]].}}
 
For the On/Off switch use two [[trigger_multiple]]s and place them over the red and green carpets.
 
 
[[image:wiseElec02.jpg|thumb|150px|right|Hammer design view.]]
In the tutorial, the [[prop_static]] entity is for the railing/electrified object but you could just as easily use motion enabled entity types.
 
 
{{idea|This concept could be extended to a gate that would swing open once the electricity was turned off, or even a loose cable trapped under a vehicle.}}


== Wrap up ==
== Wrap up ==

Revision as of 13:04, 6 July 2011

Electrified Obstacles

Typical electrified obstacle.

In this tutorial, we will create an obstacle in which it is electrified and can be toggled by a trigger. You can any model for this, but for the tutorial we will use a railing from Half Life 2 (see right).

Note.pngNote:Remember the player has to get around the obstacle.
Note.pngNote:You could apply this concept to a ladder, door/gate or even water/ground.


For the purpose of this tutorial the rail obstacle is initially electrified, however, it can be disabled by standing on a small red carpet and re-enabled by standing on a small green carpet (the carpets are not shown in screenshots).

When a player "touches" the fence while it is electrified there will be sparks, and the player will get blown back a few feet.


Tip.pngTip:To create a realistic effect, you may want to add sounds and possibly smoke.


trigger_hurt is used to start off the series of events when the player touches it. Additionally, it outputs to entities to create the "blow back" of the player and sparks. These are: one (1) env_physexplosion, eight (8) env_sparks, one (1) trigger_push and one (1) logic_timer to lend some logic.


Note.pngNote:Load the example map file at the bottom to see each of the entities mentioned here.
Tip.pngIdea:You could easily create a switch for this, another kind of "secret" trigger or the lever like Valve used in Ravenholm.

For the On/Off switch use two trigger_multiples and place them over the red and green carpets.


Hammer design view.

In the tutorial, the prop_static entity is for the railing/electrified object but you could just as easily use motion enabled entity types.


Tip.pngIdea:This concept could be extended to a gate that would swing open once the electricity was turned off, or even a loose cable trapped under a vehicle.

Wrap up

There’s a lot more you can do, hopefully this article have stimulated your imagination.

Credits

The tutorial was originally created by wisemx, and ported from sdknuts.net/wiseElec to the VDC by Peter [AGHL] 05:55, 9 Feb 2008 (PST)