(07-17-2011, 07:38 PM)palistov Wrote: I'm not sure if there was a question in your reply haha. OK well to stop the player from moving use SetPlayerActive(false);
Make sure you use SetPlayerActive(true); later so the player can move again
The switch function isn't too hard to understand once you get the hang of it. Think of it like a music playlist. The first song (case 1) plays first, then the timer calls the function again and this time it plays the second song (case 2), and it keeps going until there are no more songs (no more cases!).
You need to use those functions I posted above in a switch function to efficiently make a faint/wake up sequence. Just practice.
Oh now i have it thanks. But i have this script but why player is still 90 degrees.. all the time no stops after that teleport.
Whole script just in case:
void OnStart()
{
// AddEntityCollideBacks
AddEntityCollideCallback("Player", "Felldown", "Teleport1", true, 1);
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}
void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadeSepiaColorTo(0.5f, 0.5f);
FadeRadialBlurTo(0.7f, 0.5f);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
SetPlayerMoveSpeedMul(0.2);
PlayMusic("29_amb_end_daniel", false, 3, 3, 10, true);
}
void OnEnter()
{
}
// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(80.0f, 80.0f, 100.0f);
FadeOut(0.45f);
GiveSanityDamage(100, true);
AddTimer("tele", 3, "Teleport");
}
void Teleport(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
AddTimer("trig1", 8.0f, "beginStory2");
}
void beginStory2(string &in asTimer){
FadeIn(3);
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
PlayMusic("16_amb", false, 3, 3, 10, true);
}
void OnLeave()
{
}
EDIT: Nothing I solved it ! Thanks for your help!