liamthespy
Junior Member
Posts: 26
Threads: 10
Joined: Jun 2012
Reputation:
0
|
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 |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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
(This post was last modified: 07-16-2012, 03:12 AM by Ongka.)
|
|
07-16-2012, 03:12 AM |
|
liamthespy
Junior Member
Posts: 26
Threads: 10
Joined: Jun 2012
Reputation:
0
|
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 |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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.
(This post was last modified: 07-16-2012, 03:31 AM by Ongka.)
|
|
07-16-2012, 03:30 AM |
|
liamthespy
Junior Member
Posts: 26
Threads: 10
Joined: Jun 2012
Reputation:
0
|
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 |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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.
|
|
07-16-2012, 03:36 AM |
|
liamthespy
Junior Member
Posts: 26
Threads: 10
Joined: Jun 2012
Reputation:
0
|
RE: Jump scare script problem
yeah that worked 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 |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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
(This post was last modified: 07-16-2012, 03:49 AM by Ongka.)
|
|
07-16-2012, 03:49 AM |
|
liamthespy
Junior Member
Posts: 26
Threads: 10
Joined: Jun 2012
Reputation:
0
|
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 |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
RE: Jump scare script problem
No problem!
If you still have some questions feel free to ask
|
|
07-16-2012, 04:20 AM |
|
|