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
Help.. Again :)
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#11
RE: Help.. Again :)

le try this:

void OnStart()

{
AddEntityCollideCallback("Player", "script_slam_1", "func_slam_shut", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_1", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_2", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_3", "func_slam", true, 1);
}

void func_slam_shut(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("prison1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door_smash_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPropHealth("door_smash_2", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPropHealth("door_smash_3", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
I'm not quite sure it's this you want but this is what I can make out of your explaination.
also I higlighted some stuff which name I changed baceause you can't use spaces alos make area's with the name I put in the code.

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
08-31-2012, 08:19 AM
Find
Fanstetic Offline
Junior Member

Posts: 8
Threads: 2
Joined: Aug 2012
Reputation: 0
#12
RE: Help.. Again :)

(08-31-2012, 08:19 AM)Steve Wrote: le try this:

void OnStart()

{
AddEntityCollideCallback("Player", "script_slam_1", "func_slam_shut", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_1", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_2", "func_slam", true, 1);
AddEntityCollideCallback("Player", "door_smash_area_3", "func_slam", true, 1);
}

void func_slam_shut(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("prison1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door_smash_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPropHealth("door_smash_2", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPropHealth("door_smash_3", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
I'm not quite sure it's this you want but this is what I can make out of your explaination.
also I higlighted some stuff which name I changed baceause you can't use spaces alos make area's with the name I put in the code.
Now nothing happens when i walk passed the doors... :/
08-31-2012, 08:49 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#13
RE: Help.. Again :)

Check names again. Also there is no reason in calling the function 3 times with 3 different scriptareas. Just make one:

void OnStart()
{
AddEntityCollideCallback("Player", "door_smash_area", "func_slam", true, 1)
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPropHealth("door_smash_1", 0.0f);
SetPropHealth("door_smash_2", 0.0f);
SetPropHealth("door_smash_3", 0.0f);
GiveSanityDamage(5.0f, true);
}

Trying is the first step to success.
(This post was last modified: 08-31-2012, 10:59 AM by FlawlessHappiness.)
08-31-2012, 10:59 AM
Find




Users browsing this thread: 1 Guest(s)