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
Script Help
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#3
RE: Script Help

(07-30-2012, 10:17 PM)ZereboO Wrote: Since you have done this before, i guess that i can just post this example, in belive, that you will work out from it
void OnStart();
{

SetPlayerActive(false);
FadeOut(0);
FadePlayerRollTo(65, 20, 20);
MovePlayerHeadPos(-1, -0.45, -1.1, 20, 1);
AddTimer("activate_player", 3, "FadeIn");
SetLightVisible("BoxLight_1", false);
FadeImageTrailTo(3, 1);
FadeRadialBlurTo(0.4, 1);
}


void FadeIn(string &in timer_name)
{
FadeIn(2);
AddTimer("Start", 2, "WakeUp");
}

void WakeUp(string &in timer_name)
{
if (timer_name == "Start")
{
SetLightVisible("BoxLight_1", true);
AddTimer("MoveHead", 1, "WakeUp");
}

else if (timer_name == "MoveHead")
{
FadeImageTrailTo(0, 1);
FadeRadialBlurTo(0, 1);
MovePlayerHeadPos(-0.5, -0.2, -1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
}

else if (timer_name == "ActivatePlayer")
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true);
}
}

PS. This example runs with two PlayerStartPositions
Yes, but where am I supposed to put this script?
This is my script as it is

PHP Code: (Select All)
void OnStart(){SetEntityPlayerInteractCallback("TouchArea_1""Grunt_Gone"true);AddEntityCollideCallback("Player""Door_Close""CloseDoor"true1);AddEntityCollideCallback("Player""Walk""WalkArea"true1);AddEntityCollideCallback("Player""ScriptArea_1""bedtime"true1);SetPlayerActive(false);FadeOut(0);FadePlayerRollTo(652020);MovePlayerHeadPos(-1, -0.45, -1.1201);AddTimer("activate_player"3"FadeIn");FadeImageTrailTo(31);FadeRadialBlurTo(0.41);}
void WalkArea(string &in asParentstring &in asChildint alState){MovePlayerForward(50.0f);AddTimer("walktime"0.1f"timerdone");PlaySoundAtEntity("""react_sigh.snt""Player"0false);SetPlayerActive(false);}
void timerdone(string &in asTimer){AddTimer("restarter"0"atwalkto");}
void CloseDoor(string &in asParentstring &in asChildint alState){SetSwingDoorClosed("mansion_1"truetrue);}
void bedtime(string &in asParentstring &in asChildint alState){FadeOut(1.2f);StartPlayerLookAt("bed_nice_1"1.0f1.0f"");AddTimer("WakeUp"5.0f"itstime");}
void itstime(string &in asTimer){RemoveTimer("WakeUp");TeleportPlayer("PlayerStartArea_2");StopPlayerLookAt();}void FadeIn(string &in timer_name){FadeIn(2);AddTimer("Start"2"WakeUp"); }
void WakeUp(string &in timer_name){if (timer_name == "Start"){SetLightVisible("BoxLight_1"true);AddTimer("MoveHead"1"WakeUp");}
else if (
timer_name == "MoveHead"){FadeImageTrailTo(01);FadeRadialBlurTo(01);MovePlayerHeadPos(-0.5, -0.2, -1.122);FadePlayerRollTo(01.7500);AddTimer("ActivatePlayer"2"WakeUp");}
else if (
timer_name == "ActivatePlayer"){MovePlayerHeadPos(00022);SetPlayerActive(true);}} 


I want the player to be moved to the bed and when you get close to it you fall asleep and wake up in that state, how am I supposed to set it up then?

Please respond Rolleyes

void OnStart()
{
SetEntityPlayerInteractCallback("TouchArea_1", "Grunt_Gone", true);
AddEntityCollideCallback("Player", "Door_Close", "CloseDoor", true, 1);
AddEntityCollideCallback("Player", "Walk", "WalkArea", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "bedtime", true, 1);
SetPlayerActive(false);
FadeOut(0);
FadePlayerRollTo(65, 20, 20);
MovePlayerHeadPos(-1, -0.45, -1.1, 20, 1);
AddTimer("activate_player", 3, "FadeIn");
FadeImageTrailTo(3, 1);
FadeRadialBlurTo(0.4, 1);
}

void WalkArea(string &in asParent, string &in asChild, int alState)
{
MovePlayerForward(50.0f);
AddTimer("walktime", 0.1f, "timerdone");
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
SetPlayerActive(false);
}

void timerdone(string &in asTimer)
{
AddTimer("restarter", 0, "atwalkto");
}

void CloseDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
}

void bedtime(string &in asParent, string &in asChild, int alState)
{
FadeOut(1.2f);
StartPlayerLookAt("bed_nice_1", 1.0f, 1.0f, "");
AddTimer("WakeUp", 5.0f, "itstime");
}

void itstime(string &in asTimer)
{
RemoveTimer("WakeUp");
TeleportPlayer("PlayerStartArea_2");
StopPlayerLookAt();
}
void FadeIn(string &in timer_name)
{
FadeIn(2);
AddTimer("Start", 2, "WakeUp");
}

void WakeUp(string &in timer_name)
{
if (timer_name == "Start")
{
SetLightVisible("BoxLight_1", true);
AddTimer("MoveHead", 1, "WakeUp");
}

else if (timer_name == "MoveHead")
{
FadeImageTrailTo(0, 1);
FadeRadialBlurTo(0, 1);
MovePlayerHeadPos(-0.5, -0.2, -1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
}

else if (timer_name == "ActivatePlayer")
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true);
}
}

(This post was last modified: 07-31-2012, 12:52 PM by Dizturbed.)
07-31-2012, 12:52 PM
Find


Messages In This Thread
Script Help - by Dizturbed - 07-30-2012, 09:00 PM
RE: Script Help - by Lizard - 07-30-2012, 10:17 PM
RE: Script Help - by Dizturbed - 07-31-2012, 12:52 PM
RE: Script Help - by Lizard - 07-31-2012, 01:05 PM
RE: Script Help - by Dizturbed - 07-31-2012, 01:08 PM
RE: Script Help - by Lizard - 07-31-2012, 01:38 PM
RE: Script Help - by Dizturbed - 07-31-2012, 01:43 PM
RE: Script Help - by Lizard - 07-31-2012, 01:44 PM
RE: Script Help - by Dizturbed - 07-31-2012, 02:20 PM



Users browsing this thread: 1 Guest(s)