Frictional Games Forum (read-only)

Full Version: Making a scream play when player enters a room?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Okey dokey, I tried adding a FadeIn to my script, but it gave me an error. Am I supposed to edit this at all, or just leave it as is?

void FadeIn(float afTime);


I was guessing that since it's void it doesn't go in onStart or anything, it just goes by itself. Also, why is this "void"? I thought this would be triggered by a script area

void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

and what exactly am I supposed to erase from that script and add my own? Do I keep af(for afVolume) and replace Volume with a number, or do I erase the whole thing?
The void at the start just means it won't return any value, don't worry about that, just leave it out like the other functions. So put something like FadeIn(3); for 3 second fadein.
OH, and one last thing, my servant grunt is always starting backwards. I put him at the end of a hallway, but no matter which way I face him in the level editor, he always ends up backwards and not looking at the player! Tongue
Hmm, I put my FadeIn inside this

Code:
void OnStart()
{
FadeIn(3);
AddEntityCollideCallback("Player", "Scream_1", "Scream_1", true, 1);
AddEntityCollideCallback("Player", "Monster_1", "MonsterFunc1", true, 1);
}

and nothing happened. Huh
FadeIn won't work on OnStart, you'd have to put a timer, and then put it in that function. Or put it in OnEnter. I had the same problem, and I just put a timer with 0 seconds to another function. There's still a few millisecond delay though...I'll tell you when I figure it out.

As for the grunts, also had the same problem. When they get activated, they automatically face a default direction, no matter how you oriented it in the editor. I fixed it by making him follow a node close to him right when he activates, that way he'll look whatever way you want him to.
Ahh, I thought for sure I had it! But still, nothing happened. Here's what I wrote.
Code:
void OnEnter()
{
AddTimer("FadeIntro", 0.0f, "FadeIntro");
}

void FadeIntro(string &in asTimer)
{
FadeIn(3);
}

Oh, and I got my monster patrolling and facing the correct direction! Woot!
Nah, leave the timer in there, except its missing the function name for the 3rd parameter, the FadeIntro you have it just a random name or something. Then, in that new function, you would put in FadeIn(3).

I would put a FadeOut(0) in that function too, so it starts off black. That's what I did for now, anyway. So like:
Code:
void OnStart()
{
   AddTimer("FadeIntro", 0, "FadeIntro");
}

void FadeIntro(string &in asTimer)
{
   FadeOut(0);
   FadeIn(3);
}
Ahh, adding the FadeOut fixed it. Now it's working just fine. Thank you! d(~_^)
Anytime. :3
Austums, you have PM's disabled D:

To reply to your question, you put the next map's start position. If there's only one, you can leave it blank and it'll use the only one there. Same for the custom config; I saw you put in the start position, you don't have to if there's only one of them.
Pages: 1 2 3 4