Both sides previous revision Previous revision Next revision | Previous revision | ||
hpl2:tutorials:script:events [2011/07/14 13:46] xtron |
hpl2:tutorials:script:events [2011/07/14 13:48] (current) xtron |
||
---|---|---|---|
Line 94: | Line 94: | ||
- | <code cpp> | + | <code cpp>void OnStart() |
- | + | ||
- | void OnStart() | + | |
{ | { | ||
Line 103: | Line 101: | ||
void func_slam(string &in asParent, string &in asChild, int alState) | void func_slam(string &in asParent, string &in asChild, int alState) | ||
- | |||
{ | { | ||
SetSwingDoorClosed("door2", true, true); | SetSwingDoorClosed("door2", true, true); | ||
- | + | ||
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); | PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); | ||
+ | |||
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); | PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); | ||
- | + | ||
GiveSanityDamage(5.0f, true); | GiveSanityDamage(5.0f, true); | ||
} | } | ||
Line 124: | Line 120: | ||
It's almost like the slaming door but with a few modifications. | It's almost like the slaming door but with a few modifications. | ||
+ | |||
+ | |||
+ | ==== The Door ==== | ||
Line 130: | Line 129: | ||
Click on the door > Entity > Change OpenAmount to 0. So it's closed. | Click on the door > Entity > Change OpenAmount to 0. So it's closed. | ||
+ | |||
+ | |||
+ | ==== The Script ==== | ||