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
Switch issues [Solved]
ProyectV Offline
Junior Member

Posts: 19
Threads: 6
Joined: Apr 2014
Reputation: 0
#7
RE: Switch issues

Well... this is my whole script so far...

Spoiler below!
void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "wooden_boards_block_1", "Break_Free", true);
AddEntityCollideCallback("Player", "ScriptDamage01", "Hurt01", true, 1);
AddUseItemCallback("", "string_pile_1", "ScriptArea_2", "Rope_Ladder", true);
AddEntityCollideCallback("bed_simple_movable_10", "ScriptArea_3", "Scare01", true, 1);
SetEntityPlayerInteractCallback("string_pile_1", "Scare02", true);
AddEntityCollideCallback("servant_grunt_1", "PathNodeArea_3", "Hallucination01", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "Save01", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_7", "Memento1", true, 1);
AddEntityCollideCallback("fluttersuitor_NPC_1", "PathNodeArea_5", "EndIntroPart1", true, 1);
AddEntityCollideCallback("servant_grunt_1", "PathNodeArea_4", "EndIntroPart2", true, 1);
AddLocalVarInt("Death", 0);
AddQuest("Castel", "Castel");
AddLocalVarInt("Hole01", 0);
AddLocalVarInt("Memento01", 0);
bool IntroEscene = true;
IntroSetUp(IntroEscene);
}

void OnEnter()
{
}

void OnLeave()
{
PreloadSound("door_level_cistern_open");
}

void IntroSetUp(bool IntroEscene)
{

if(IntroEscene){
for(int i=0;i<10;++i) {
AddTimer("IntroMapa", 2.0f, "IntroMapa");
}
FadeOut(0.0f);
SetPlayerRunSpeedMul(0.0f);
SetPlayerMoveSpeedMul(0.0f);
SetPlayerLookSpeedMul(0.03f);
SetPlayerCrouching(true);
SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
SetInventoryDisabled(true);
MovePlayerHeadPos(0.5f, -0.3f, 0.0f, 1.0f, 0.1f);
}
}

void IntroMapa(string &in asTimer) ///////revisar más tarde....
{
bool bPauseAtStep = false;
string sIntro = asTimer;
float fEventSpeed = 1.0f;
AddLocalVarInt(sIntro, 0);
for(int i=sIntro;i<10;++i) {

}

switch(GetLocalVarInt(sIntro))
{
case 1:
FadeIn(4.0f);
PlayGuiSound("justine_wake2.ogg", 1.0f);
SetPlayerLookSpeedMul(0.06f);
SetRadialBlurStartDist(0.3f);
FadeRadialBlurTo(0.1f, 0.1f);
StartPlayerLookAt("IntroArea", 2.0f, 2.0f, "");
fEventSpeed = 2.0f;
break;

case 2:
StartPlayerLookAt("IntroArea_1", 2.0f, 2.0f, "");
break;

case 3:
StartPlayerLookAt("IntroArea_2", 2.0f, 2.0f, "");
FadeOut(3.0f);
break;

case 4:
FadeIn(1.0f);
StartPlayerLookAt("IntroArea_3", 2.0f, 2.0f, "");
fEventSpeed = 6.0f;
break;

case 5:
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("fluttersuitor_NPC_1", "PathNodeArea_5", 0, "");
fEventSpeed = 10.0f;
break;

case 6:
FadeOut(2.0f);
PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, false);
TeleportPlayer("StartArea");
break;

case 7:
FadeIn(1.0f);
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
SetPlayerMoveSpeedMul(0.4f);
SetPlayerLookSpeedMul(0.5f);
MovePlayerHeadPos(0.5, -0.3f, 0.0f, 1.0f, 0.1f);
fEventSpeed = 3.0f;
break;

case 8:
SetPlayerCrouching(false);
PlaySoundAtEntity("", "player_stand.snt", "Player", 0, false);
MovePlayerHeadPos(0, 0, 0.0f, 0.5f, 0.1f);
SetPlayerMoveSpeedMul(0.6f);
SetPlayerLookSpeedMul(0.8f);
fEventSpeed = 1.0f;
break;

case 9:
SetPlayerCrouching(true);
PlaySoundAtEntity("", "step_walk_rock.snt", "Player", 0, false);
MovePlayerHeadPos(0.5, -0.3f, 0.0f, 1.0f, 0.1f);
SetRadialBlurStartDist(0.3f);
FadeRadialBlurTo(0.1f, 0.1f);
fEventSpeed = 1.0f;
break;

case 10:
MovePlayerHeadPos(0, 0, 0.0f, 0.0f, 0.0f);
SetPlayerMoveSpeedMul(0.8f);
SetPlayerLookSpeedMul(1.0f);
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
SetInventoryDisabled(false);
StopPlayerLookAt();
break;

default:
bPauseAtStep = true;
break;
}

if(!bPauseAtStep)
AddTimer("", 5.0f, "StartBreakFree");


}

void EndIntroPart1(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("fluttersuitor_NPC_1", false);
}

void EndIntroPart2(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_2", false);
}

void Break_Free(string &in asItem, string &in asEntity)
{
SetPropHealth("wooden_boards_block_1", 0.0f);
SetEntityActive("wooden_boards_block_broken_1", true);
RemoveItem(asItem);
SetEntityActive("wooden_boards_block_1", false);
PlaySoundAtEntity("", "break_wood.snt", "ScriptArea_1", 0, false);
}

void Hurt01(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("Death")==0)
{
GivePlayerDamage(100.0f, "(BloodSplat", true, true);
}
}

void Rope_Ladder(string &in asItem, string &in asEntity)
{
SetEntityActive("LadderArea_2", true);
RemoveItem(asItem);
SetLocalVarInt("Death", 1);

}

void Scare01(string &in asParent, string &in asChild, int alState)
{
FadeSepiaColorTo(0.0f, 2.0f);
FadeRadialBlurTo(0.0f, 2.0f);
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "ui_insanity_touch.snt", "ScriptArea_4", 0, false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);

}

void Scare02(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
StartPlayerLookAt("ScriptArea_5", 2.0f, 2.0f, "");
AddTimer("", 3.0f, "Stoplook01");
CompleteQuest("blockedway02" ,"blockedway02");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");

}

void Hallucination01(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

void Stoplook01(string &in asTimer)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
StopPlayerLookAt();
}

void Save01(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("", "ScriptArea_6", "", "Hints", "FallDeath01");
StartPlayerLookAt("ScriptArea_8", 1.0f, 1.0f, "");
AddTimer("", 1.0f, "StopLook02");

if(GetLocalVarInt("Hole01")==0)
{
SetLocalVarInt("Memento01", 1);
SetMessage("FluttershyThougs/Talks", "DarkHole01", 0.0f);
}

else if(GetLocalVarInt("Hole01")==1)
{
SetMessage("FluttershyThougs/Talks", "DarkHole02", 0.0f);
AddQuest("blockedway02", "blockedway02");
CompleteQuest("blockedway01" ,"blockedway01");
}
}

void StartBreakFree(string &in asTimer)
{
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
SetEntityActive("stone_hammer_1", true);
AddTimer("", 2.0f, "EndBreakFree");
}

void EndBreakFree(string &in asTimer)
{
PlaySoundAtEntity("", "lock_door.snt", "Player", 0, false);
}

void Memento1(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("Memento01")==0)
{
AddQuest("blockedway01", "blockedway01");
SetLocalVarInt("Hole01", 1);
}

else if(GetLocalVarInt("Memento01")==1)
{
AddQuest("blockedway02", "blockedway02");
}
}

void StopLook02(string &in asTimer)
{
StopPlayerLookAt();
}
(This post was last modified: 04-22-2014, 08:18 PM by ProyectV.)
04-22-2014, 07:20 PM
Find


Messages In This Thread
Switch issues [Solved] - by ProyectV - 04-20-2014, 11:01 PM
RE: Switch issues - by Mudbill - 04-20-2014, 11:50 PM
RE: Switch issues - by ProyectV - 04-22-2014, 12:10 AM
RE: Switch issues - by Daemian - 04-22-2014, 02:26 AM
RE: Switch issues - by PutraenusAlivius - 04-22-2014, 08:25 AM
RE: Switch issues - by Mudbill - 04-22-2014, 09:33 AM
RE: Switch issues - by ProyectV - 04-22-2014, 07:20 PM
RE: Switch issues - by Daemian - 04-23-2014, 04:44 AM
RE: Switch issues - by ProyectV - 04-23-2014, 11:08 PM



Users browsing this thread: 1 Guest(s)