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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another need for help in scripting
OccultedNinJa Offline
Junior Member

Posts: 25
Threads: 7
Joined: Sep 2011
Reputation: 1
#1
Another need for help in scripting

I'm pretty new at scripting, and I have a lot of questions. I've read the tutorials, and I know where to find the scripts in the wiki. I mostly need help with proper placement of the scripts, and how to get them to work properly. I have some that work really well thanks to previous threads, but there are some more specific needs for the custom story I'm creating that I still need help with. So I was wondering if there's anyone who is kind enough to lend an ear and a helping hand to a scripting nublet, starting with how to get the doors to a cupboard to fly open when entering the script area. Here's the code that I have for the script already.

void Scare(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("deathcloset", false, true);
GiveSanityDamage(80, true);
PlayGuiSound("react_scare.snt", 0.5f);
PlayGuiSound("insanity_whisper.snt", 0.5f);
PlayMusic("01_amb_darkness.ogg", false, 10, 0.5f, 0, false);
}

I saw somewhere about using the SetSwingDoorClosed script to cause doors to fly open or closed. Have I done this correctly or does it need tweaking?


09-15-2011, 04:17 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Another need for help in scripting

I think SetSwingDoorClosed does not work for closets. Just use PropForce instead.

09-15-2011, 07:36 AM
Find
OccultedNinJa Offline
Junior Member

Posts: 25
Threads: 7
Joined: Sep 2011
Reputation: 1
#3
RE: Another need for help in scripting

EDIT: I figured it out. It's the AddPropImpulse code, not the force one. Regardless it definitely got me pointed in the right direction. Big Grin
(This post was last modified: 09-15-2011, 04:55 PM by OccultedNinJa.)
09-15-2011, 04:31 PM
Find




Users browsing this thread: 1 Guest(s)