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
Making a scream play when player enters a room?
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#31
RE: Making a scream play when player enters a room?

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?
(This post was last modified: 03-23-2011, 04:15 PM by Austums.)
03-23-2011, 04:08 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#32
RE: Making a scream play when player enters a room?

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.
03-23-2011, 04:12 PM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#33
RE: Making a scream play when player enters a room?

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

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

and nothing happened. Huh
(This post was last modified: 03-23-2011, 04:23 PM by Austums.)
03-23-2011, 04:18 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#34
RE: Making a scream play when player enters a room?

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.
03-23-2011, 04:30 PM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#35
RE: Making a scream play when player enters a room?

Ahh, I thought for sure I had it! But still, nothing happened. Here's what I wrote.
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!
(This post was last modified: 03-23-2011, 05:15 PM by Austums.)
03-23-2011, 05:01 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#36
RE: Making a scream play when player enters a room?

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:
void OnStart()
{
   AddTimer("FadeIntro", 0, "FadeIntro");
}

void FadeIntro(string &in asTimer)
{
   FadeOut(0);
   FadeIn(3);
}
03-23-2011, 05:19 PM
Find
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#37
RE: Making a scream play when player enters a room?

Ahh, adding the FadeOut fixed it. Now it's working just fine. Thank you! d(~_^)
03-23-2011, 05:27 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#38
RE: Making a scream play when player enters a room?

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.
(This post was last modified: 03-23-2011, 06:27 PM by MrBigzy.)
03-23-2011, 05:33 PM
Find




Users browsing this thread: 1 Guest(s)