The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spoiler How to make the Wind Open's a Door!
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#1
Tongue  How to make the Wind Open's a Door!

Well i made a script i think its pretty nice.
When you walk in an Area a door will open and you hear the wind.
Then a timer will start and you will react scare and you get sanity damageSmile

Here is the Script
Spoiler below!

onStart();
{
AddEntityCollideCallback("Player", "area1", "Open_Door", true, 1); // When player collides with Area 1 the script is gonna happen.
}

void Open_Door(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", false, true);
SetSwingDoorDisableAutoClose("door1", true); // Disable autoclose means its not gonna close by it self.
AddTimer("", 0.5, "Door_Effect"); // Leading to functions in Door_Effect script.
}

void Door_Effect (string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_dust_whirl", "AreaOpenEffect", false); // Makes a patricle system at the scriptbox AreaOpenEffect.
PlaySoundAtEntity("AreaOpenEffect", "scare_wind.snt", "Player", 1, true); // Plays a sound at the scriptbox named AreaOpenEffect.
AddPropForce("door1", 1500, 1500, 1500, "world"); // Gives the door a push so it goes open.
AddTimer("", 0.5, "Door_Scare"); // For adding more effect like Sound/Sanity Damage.
}

void Door_Scare(string &in asTimer)
{
PlaySoundAtEntity("scare", "react_scare.snt", "Player", 1, true); // For better scare effect.
GiveSanityDamage(5, true); // Your screen goes a bit forward to scare you more.
}



Make sure you named the Area where the functions triggers 'area1' or change it in anything you want but make sure you change it in the script to.

Also the door name in this script is Door1 'you can change it in anything you want but also make sure the change it in script and level editor'

Also in Level Editor make an script area behind the door named 'AreaOpenEffect' this is where the particle 'effect' is gonna show up!


I hope its useful for anyone.

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 04-16-2013, 02:51 PM by VeNoMzTeamHysterical.)
03-20-2013, 01:39 PM
Website Find


Messages In This Thread
How to make the Wind Open's a Door! - by VeNoMzTeamHysterical - 03-20-2013, 01:39 PM



Users browsing this thread: 1 Guest(s)