ArcherKiller
Junior Member
Posts: 6
Threads: 1
Joined: Mar 2012
Reputation:
0
|
Scare Event Help
Hello guys. I'm new to this forum and new to scripting. Can anyone help me with my script?
So here is idea. When Player picks up the lantern an event occurs: the scratch sound is played on door and Player forced to look at this door for 2 seconds. Scared breath is activated on Player.
Here how I tried to script it. I now there is huge mistake, but could you explain my mistake and maybe tell me how it is should be done?
void DoorScratch1(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);
StartPlayerLookAt("private_room", -1, 1, "SetLanternActive");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
StopPlayerLookAt();
}
|
|
03-09-2012, 09:31 AM |
|
Shives
Member
Posts: 154
Threads: 41
Joined: Jan 2012
Reputation:
1
|
RE: Scare Event Help
I hope this works
void DoorScratch1(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
StartPlayerLookAt("private_room", 2, 4, "StopPlayerLookAt");
}
|
|
03-09-2012, 03:57 PM |
|
Stepper321
Senior Member
Posts: 263
Threads: 26
Joined: Nov 2011
Reputation:
8
|
RE: Scare Event Help
Quote:void DoorScratch1(string &in Entity) // I assume you have on Pickup Callback on the Lantans properties.
{
PlaySoundAtEntity("", "scare_scratch_intense", "private_room", 0, false);
StartPlayerLookAt("private_room", 20, 20, ""); //Adjust your own speed, -1 or 0 is not possible
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2"); }
void DoorStratch2(string &in asTimer) { StopPlayerLookAt(); }
Signature to awesome to be displayed.
(This post was last modified: 03-09-2012, 04:04 PM by Stepper321.)
|
|
03-09-2012, 04:02 PM |
|
ArcherKiller
Junior Member
Posts: 6
Threads: 1
Joined: Mar 2012
Reputation:
0
|
RE: Scare Event Help
Thank you for the answers. So here is the thing. The sound of scratching doesn't stop. Here is script.
SetEntityPlayerInteractCallback("lantern_1", "DoorScratch1", true);
}
void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}
void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
}
Oh and if possible can you tell me how can I add a lantern lighted while player is looking and to add text. Sorry for making requests, but I learn better from examples.
(This post was last modified: 03-09-2012, 05:32 PM by ArcherKiller.)
|
|
03-09-2012, 05:28 PM |
|
Datguy5
Senior Member
Posts: 629
Threads: 25
Joined: Dec 2011
Reputation:
12
|
RE: Scare Event Help
What do you mean with add text?
|
|
03-09-2012, 10:40 PM |
|
ArcherKiller
Junior Member
Posts: 6
Threads: 1
Joined: Mar 2012
Reputation:
0
|
RE: Scare Event Help
well when a message comes in on the screen
|
|
03-09-2012, 11:49 PM |
|
Datguy5
Senior Member
Posts: 629
Threads: 25
Joined: Dec 2011
Reputation:
12
|
|
03-10-2012, 10:08 AM |
|
Asphex
Junior Member
Posts: 26
Threads: 2
Joined: Feb 2012
Reputation:
2
|
RE: Scare Event Help
SetEntityPlayerInteractCallback("lantern_1", "DoorScratch1", true);
}
void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}
void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
StopSound("scare_scratch", 0);
}
Try if that works. And about the text.. did you mean that you want the text to appear on pickup?
|
|
03-10-2012, 01:56 PM |
|
ArcherKiller
Junior Member
Posts: 6
Threads: 1
Joined: Mar 2012
Reputation:
0
|
RE: Scare Event Help
void DoorScratch1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_scratch", "private_room", 0, false);
SetMessage("Messages", "Popup2", 3);
StartPlayerLookAt("private_room", 10, 10, "");
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
AddTimer("", 2, "DoorScratch2");
}
void DoorScratch2(string &in asTimer)
{
StopPlayerLookAt();
StopSound("scare_scratch", 0);
}
This still didn't help. The sound won't stop. Btw I found out that some sounds in level editor are combined sounds from sound folder. For example. In sound folder there are 4 types of animal squeal sounds, but in level editor there is only 1 and each time it plays a random one from those 4... is there a way around it?
|
|
03-10-2012, 03:35 PM |
|
Nevicar
Junior Member
Posts: 37
Threads: 4
Joined: Mar 2012
Reputation:
0
|
RE: Scare Event Help
Don't you need .snt at the end of the sound file in the string, as well? Or can this be overlooked sometimes?
i.e: PlaySoundAtEntity("", "scare_scratch.snt", "private_room", 0, false);
and
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
(This post was last modified: 03-10-2012, 04:48 PM by Nevicar.)
|
|
03-10-2012, 04:47 PM |
|
|