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
need a little with a script
christopher231 Offline
Junior Member

Posts: 26
Threads: 4
Joined: Jul 2011
Reputation: 0
#6
RE: need a little with a script

(12-08-2011, 03:06 AM)Your Computer Wrote:
(12-08-2011, 03:02 AM)christopher231 Wrote: so do you mean the whole .hps file?

Yeah.

void OnStart()
{
SetPlayerActive(false);
SetPlayerCrouching(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
PreloadSound("24_pipe.snt");
AddEntityCollideCallback("Player", "ScriptArea_2", "Func_monster_1", true, 1);
AddEntityCollideCallback("Player", "Crying", "PlayerLook", true, 1);
AddUseItemCallback("", "key_tower_1", "prison_1", "FUNCTION", true);
AddUseItemCallback("", "key_tomb_rusty_1", "wrongcabinet1", "FUNCTION_wrong1", true);
AddUseItemCallback("", "key_tomb_rusty_1", "wrongcabinet2", "FUNCTION_wrong2", true);
AddUseItemCallback("", "key_tomb_rusty_1", "rightcabinet", "FUNCTION_right", true);
AddUseItemCallback("", "Puzzlekey", "puzzlecabinet", "FUNCTION_puzzle1", true);
SetEntityConnectionStateChangeCallback("levertodoor1", "Func_shelf");
}

void Func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("safety_large_vert_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

void FUNCTION_wrong1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("wrongcabinet1", false, true);
PlaySoundAtEntity("", "unlock_door", "wrongcabinet1", 0, false);
RemoveItem("key_tomb_rusty_1");
SetEntityActive("servant_brute_1", true);
}

void FUNCTION_wrong2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("wrongcabinet2", false, true);
PlaySoundAtEntity("", "unlock_door", "wrongcabinet2", 0, false);
RemoveItem("key_tomb_rusty_1");
SetEntityActive("servant_brute_1", true);
}

void FUNCTION_right(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("rightcabinet", false, true);
PlaySoundAtEntity("", "unlock_door", "rightcabinet", 0, false);
RemoveItem("key_tomb_rusty_1");
}

void FUNCTION_puzzle1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puzzlecabinet", false, true);
PlaySoundAtEntity("", "unlock_door", "puzzlecabinet", 0, false);
RemoveItem("Puzzlekey");
}


void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_1", 0, false);
RemoveItem("key_tower_1");
}

void Func_monster_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "15_man02_whimp.snt", "ScriptArea_3", 0, false);
SetMessage("screendisplay", "Note_someonecrying_Name", 5);
}

void PlayerLook(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("ScriptArea_3", 3.0f, 3.6f, "ScreenShake");
AddTimer("look01", 4.0f, "Timer_1");
StartScreenShake (0.2f, 0.2f, 1.0f, 1.0f);
PlaySoundAtEntity("", "ui_insanity_touch.snt", "Player", 0, false);
SetMessage("screendisplay", "Note_whatisthat_Name", 5);
}

void Timer_1(string &in asTimer)
{
StopPlayerLookAt();
}
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
SetMessage("screendisplay", "Note_whereami_Name", 5);
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
SetMessage("screendisplay", "Note_anote_Name", 5);
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
}
}

void OnEnter()
{
}

void OnLeave()
{
}

here's the whole file everything else works
Don't worry i got it to work, i had to use a crank... thanks anyway
(This post was last modified: 12-08-2011, 03:42 AM by christopher231.)
12-08-2011, 03:10 AM
Find Reply


Messages In This Thread
need a little with a script - by christopher231 - 12-06-2011, 02:16 PM
RE: need a little with a script - by flamez3 - 12-06-2011, 02:25 PM
RE: need a little with a script - by christopher231 - 12-08-2011, 03:10 AM



Users browsing this thread: 1 Guest(s)