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
Jump scare script problem
liamthespy Offline
Junior Member

Posts: 26
Threads: 10
Joined: Jun 2012
Reputation: 0
#1
Jump scare script problem

this is the relevant part of the script


AddEntityCollideCallback("Player", "firstscare", "closetcorpse", true, 1);
}

void closetcorpse(string &in item)
{
SetEntityActive("closetcorpse", true);
PlaySoundAtEntity("", "guardian_activated.snt", "closetcorpse", 0, false);
}

the player walks into the firstscare scriptarea and the closetcorpse activates, or at least that's what is supposed to happen. I have everything punctuated right, what is wrong?
07-16-2012, 03:05 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#2
RE: Jump scare script problem

void closetcorpse(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("closetcorpse", true);
PlaySoundAtEntity("", "guardian_activated.snt", "closetcorpse", 0, false);
}

It should be like this

[Image: 18694.png]
(This post was last modified: 07-16-2012, 03:12 AM by Ongka.)
07-16-2012, 03:12 AM
Find
liamthespy Offline
Junior Member

Posts: 26
Threads: 10
Joined: Jun 2012
Reputation: 0
#3
RE: Jump scare script problem

oh, I see! thanks mate! one more question if you please,

SetEntityPlayerInteractCallback("firstkey", "keyfunc", true);




void keyfunc(string &in asItem, string &in asEntity)
{
SetSwingDoorClosed("prison_1", 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);
}

this doesn't seem to work, either.
07-16-2012, 03:24 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#4
RE: Jump scare script problem

You want a key to unlock a door, right?
void OnStart()
{
AddUseItemCallback("UnlockDoor", "firstkey", "prison_1","UseKeyOnDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, false);
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);
}
This way you can use the key on the door and it will open.

[Image: 18694.png]
(This post was last modified: 07-16-2012, 03:31 AM by Ongka.)
07-16-2012, 03:30 AM
Find
liamthespy Offline
Junior Member

Posts: 26
Threads: 10
Joined: Jun 2012
Reputation: 0
#5
RE: Jump scare script problem

nope, I want a door to slam when the key is picked up. the key is for a different door than the one mentioned in the code.
07-16-2012, 03:31 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#6
RE: Jump scare script problem

void OnStart()
{
SetEntityCallbackFunc("firstkey", "keyfunc");
}

void keyfunc(string &in asEntity, string &in type)
{
SetSwingDoorClosed("prison_1", 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);
}
This should do the job.
I'm not sure if you can close the door with this function, tell me if it's not working.

[Image: 18694.png]
07-16-2012, 03:36 AM
Find
liamthespy Offline
Junior Member

Posts: 26
Threads: 10
Joined: Jun 2012
Reputation: 0
#7
RE: Jump scare script problem

yeah that worked Big Grin thanks a ton man!

one final question, for the original script, how could I get the corpse to disappear after just a second or two?
(This post was last modified: 07-16-2012, 03:40 AM by liamthespy.)
07-16-2012, 03:40 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#8
RE: Jump scare script problem

Here you go!
void closetcorpse(string &in item)
{
SetEntityActive("closetcorpse", true);
PlaySoundAtEntity("", "guardian_activated.snt", "closetcorpse", 0, false);
AddTimer("DisableCorpse", 2.5f, "TimerDisableCorpse");    //2.5f defines how long it takes to disappear
}

void TimerDisableCorpse(string &in asTimer)
{    
    SetEntityActive("closetcorpse", false);
}
Have fun Big Grin

[Image: 18694.png]
(This post was last modified: 07-16-2012, 03:49 AM by Ongka.)
07-16-2012, 03:49 AM
Find
liamthespy Offline
Junior Member

Posts: 26
Threads: 10
Joined: Jun 2012
Reputation: 0
#9
RE: Jump scare script problem

thanks a ton mate! you've done me a great deal of good here
07-16-2012, 04:03 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#10
RE: Jump scare script problem

No problem!
If you still have some questions feel free to ask Wink

[Image: 18694.png]
07-16-2012, 04:20 AM
Find




Users browsing this thread: 1 Guest(s)