Scripting issues
Ok so i got this script for this scene in a room, whats its supposed to do is when you walk to a script area the screen goes black and sound plays but while its doing that it teleports you to another room and then the screen goes to normal. But here is the problem the only thing that works atm is teleporting the player, the sound wont play and the fadein and fadeout is not working. Below is what i have right now, ive been working with it for a bit and i tried putting them all together instead of in different sections like it is now but that causes a error with the fades. Not to sure what to do.
void OnStart()
{
}
void OnEnter()
{
AddEntityCollideCallback("Player", "Teleport", "Nightmare", true, 1);
AddEntityCollideCallback("Player", "Grr", "Rawr", true, 1);
}
void OnLeave()
{
}
void Nightmare(string &inasParent, string &in asChild, int alState)
{
AddTimer("", 0, "Rawr");
AddTimer("", 0, "Fadeout");
TeleportPlayer("PlayerStartArea_2");
AddTimer("", 4.0, "Fadein");
}
void Fadein(float afTime)
{
Fadein(2);
}
void Fadeout(float afTime)
{
Fadeout(0);
}
void Rawr(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound)
{
PlaySoundAtEntity("insanity_monster_roar01", "insanity_monster_roar01.ogg", "player", 0, false);
}
(This post was last modified: 12-23-2011, 03:33 AM by Nomad923.)
|