User Tools

Site Tools


hpl2:tutorials:scripting:scaresbyjenniferorange

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:scripting:scaresbyjenniferorange [2012/04/14 16:11]
jenniferorange [Scare 5 - Kill The Lights]
hpl2:tutorials:scripting:scaresbyjenniferorange [2012/04/19 01:25] (current)
jenniferorange [Scare 5 - Kill The Lights]
Line 66: Line 66:
  
  
-===== Scare 2 - Flying Jesus ===== 
  
 +===== Scare 2 - Exploding Pots =====
  
-Requested by Datguy5! Check out his profile on FG! [[http://​www.frictionalgames.com/​forum/​user-18514.html|http://​www.frictionalgames.com/​forum/​user-18514.html]] ​ 
  
- +This scare is an unexpected one. I warn anyone who wants to use this scare to NOT over-use it. It's great to use when there is peaceful music and everything seems so perfect.. and then a pot explodes, dramatically changing the music to that of a nervous feeling. I won't be showing you guys how to get the music, only how to make the pot explode. The rest is up to you.<​nowiki>​%%</​nowiki>​</​nowiki>​%%*%%%%</​nowiki>​WARNING:​ THIS SCARE AS ONLY BEEN TESTED WITH VASE_01 AND VASE_02 FOUND IN ENTITIES>​CONTAINER<​nowiki>​*</​nowiki>​
-For the famous and most crap-your-pants scare called "​Flying Jesus",​ you'll need an area and a male corpse. +
- +
- +
-    - Pick yourself a nice location for the script area. One of the best spots is in a long corridor. Keep in mind the script area is for, when the player hits it, the "​Jesus"​ will fly down the corridor. So don't think he'll spawn there for something. Make sure you extend that sucker out to each end of the wall. There are some scared Players that try and sneak past the script areas. Re-name your Script Area. For this example, I'll name mine **FlyingJesus_1**. No pun intended. Don't forget to hit ENTER! +
-    - Now the best way to do this, and get it right, is to have the corpse spawn and then add a prop force. If the corpse is already active, he'll be lying on the ground in a heap and when the prop force is added he might just slide on the floor. However if you think that's scary you can try that one too. Place your flying Jesus man a decent ways down the corridor, from the Script Area. The length of about 2 or 3 walls is good. Aim his face toward the direction the Player will come. Set him unactive and re-name him! I'll rename mine **Jesus_1**. (Don't forget, when you place him, to make him floating somewhat in the air to be sure he'll hit the player. See [[http://​www.mediafire.com/​i/?​49ps9q6p6j096dg|Picture 1]].) +
-    - Now we can script. Open your maps' .hps. +
- +
- +
-<code actionscript>​void OnStart() +
-+
-AddEntityCollideCallback("​Player",​ "​FlyingJesus_1",​ "​HolyJesus",​ true, 1); +
-AddEntityCollideCallback("​Jesus_1",​ "​FlyingJesus_1",​ "​Sound",​ true, 1); +
-+
-  +
-  +
-void HolyJesus(string &in asParent, string &in asChild, int alState) +
-+
-SetEntityActive("​Jesus_1",​ true); +
-AddPropForce("​Jesus_1",​ 0, 0, 30000, "​World"​);​ +
-+
-  +
-  +
-void Sound(string &in asParent, string &in asChild, int alState) +
-+
-PlaySoundAtEntity("",​ "​24_iron_maiden.snt",​ "​FlyingJesus_1",​ 0, false); +
-+
-</​code>​ +
- +
- +
-I added the scary Iron Maiden sound to play when the corpse hit the Script Area. It adds a scarier jump effect, but it's optional of course. For the AddPropForce,​ you may have to tweak it. For me, 30000 was perfect, and whether it goes in X, Y, or Z depends on your map. For me it was Z. Here's one way to find out: Select a wall or object in the room. Click the + or - button under Position for X, Y, and Z and note which way the object goes. If it goes in the direction of the Script Area, (let's say it's X) then you put the 30000 under X. +
- +
- +
-Enjoy making your players freak out and pee their pants. :] +
- +
- +
-More pictures! +
- +
- +
-[[http://​www.mediafire.com/​i/?​540yogtl38ldkdz|2]] [[http://​www.mediafire.com/​i/?​zj6c63dee6tvy58|3]]  +
- +
- +
-===== Scare 3 - Exploding Pots ===== +
- +
- +
-This scare is an unexpected one. I warn anyone who wants to use this scare to NOT over-use it. It's great to use when there is peaceful music and everything seems so perfect.. and then a pot explodes, dramatically changing the music to that of a nervous feeling. I won't be showing you guys how to get the music, only how to make the pot explode. The rest is up to you.<​nowiki>​%% </​nowiki>​%%*%%%%%%</​nowiki>​WARNING:​ THIS SCARE AS ONLY BEEN TESTED WITH VASE_01 AND VASE_02 FOUND IN ENTITIES>​CONTAINER<​nowiki>​*</​nowiki>​+
  
  
Line 123: Line 77:
  
 Next, make a script area. It shouldn'​t be too far away from the exploding pot. Make sure it's big/tall enough so the player will collide with it! Re-name it as well. I named mine **explode_scare**. Now it's already time to script! Next, make a script area. It shouldn'​t be too far away from the exploding pot. Make sure it's big/tall enough so the player will collide with it! Re-name it as well. I named mine **explode_scare**. Now it's already time to script!
- 
- 
 <code actionscript>​void OnStart() <code actionscript>​void OnStart()
 { {
Line 160: Line 112:
 Good luck Good luck
  
- +===== Scare - Falling Objects =====
-===== Scare - Falling Objects =====+
  
  
Line 171: Line 122:
  
 Place your box ontop of the shelf. The very very top is the preferred place, but if you use smaller objects like pots, it can go on any shelf. Just be sure it fits right. Because the shelf I chose has a back, the box had to be placed slightly hanging off the edge of the shelf. This is perfectly fine to do, just make sure the box doesn'​t slide off before we add a prop force. Last thing we need is a script area. Because I want the Player to notice the box, I've placed my script area about a foot away from the actual shelf. If you place the script area right below the box, the box may not fall in time and scare the player, but confuse them. However you can place the script area wherever you'd like. I've re-named mine **box_fall**. Time for scripting! Place your box ontop of the shelf. The very very top is the preferred place, but if you use smaller objects like pots, it can go on any shelf. Just be sure it fits right. Because the shelf I chose has a back, the box had to be placed slightly hanging off the edge of the shelf. This is perfectly fine to do, just make sure the box doesn'​t slide off before we add a prop force. Last thing we need is a script area. Because I want the Player to notice the box, I've placed my script area about a foot away from the actual shelf. If you place the script area right below the box, the box may not fall in time and scare the player, but confuse them. However you can place the script area wherever you'd like. I've re-named mine **box_fall**. Time for scripting!
- 
- 
 <code actionscript>​void OnStart() <code actionscript>​void OnStart()
 { {
Line 201: Line 150:
 The script here is rather self-explanatory. The Player collides with the script area, it triggers the prop force, the box falls. Super easy! I also didn't add pictures for this one as I figured it wouldn'​t be too difficult to figure out. Though if you need a picture reference I will add some. The script here is rather self-explanatory. The Player collides with the script area, it triggers the prop force, the box falls. Super easy! I also didn't add pictures for this one as I figured it wouldn'​t be too difficult to figure out. Though if you need a picture reference I will add some.
  
- +===== Scare - Kill The Lights =====
-===== Scare - Kill The Lights =====+
  
  
Line 208: Line 156:
  
  
-BrooksyFC was inspired by the ending of Penumbra: Overture and asked me to re-create this scare. All of the lights in a long corridor go out, one by one. Today I'll be showing you using **wall candles**, but feel free to use more or less; even a different lamp will do.+BrooksyFC was inspired by the ending of Penumbra: Overture and asked me to re-create this scare. All of the lights in a long corridor go out, one by one. Today I'll be showing you using **6** **wall candles**, but feel free to use more or less; even a different lamp will do.
  
  
Line 226: Line 174:
 { {
 SetLampLit("​lamp_1",​ false, true); SetLampLit("​lamp_1",​ false, true);
-AddTimer("", ​3, "​Out2"​);​+AddTimer("", ​2, "​Out2"​);​
 } }
    
Line 233: Line 181:
 { {
 SetLampLit("​lamp_2",​ false, true); SetLampLit("​lamp_2",​ false, true);
-AddTimer("", ​3, "​Out3"​);​+AddTimer("", ​2, "​Out3"​);​
 } }
    
Line 240: Line 188:
 { {
 SetLampLit("​lamp_3",​ false, true); SetLampLit("​lamp_3",​ false, true);
-AddTimer("", ​3, "​Out4"​);​+AddTimer("", ​2, "​Out4"​);​
 } }
    
Line 247: Line 195:
 { {
 SetLampLit("​lamp_4",​ false, true); SetLampLit("​lamp_4",​ false, true);
-AddTimer("", ​3, "​Out5"​);​+AddTimer("", ​2, "​Out5"​);​
 } }
    
Line 254: Line 202:
 { {
 SetLampLit("​lamp_5",​ false, true); SetLampLit("​lamp_5",​ false, true);
-AddTimer("", ​3, "​Out6"​);​+AddTimer("", ​2, "​Out6"​);​
 } }
    
hpl2/tutorials/scripting/scaresbyjenniferorange.1334419860.txt.gz · Last modified: 2012/04/14 16:11 by jenniferorange