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
#1
need a little with a script

Hey, in my story i have this little puzzle at the start and once you complete it you find a lever, and i want this lever to open a "safety_large_vert" but i can't seem to make it work.



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;
}
}

This is what i have, i have used this script to open a "castlebase_secret_door"
and it worked.
so if anyone can help me out, i'll i give you a High Five Big Grin
12-06-2011, 02:16 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: need a little with a script

(12-06-2011, 02:16 PM)christopher231 Wrote: Hey, in my story i have this little puzzle at the start and once you complete it you find a lever, and i want this lever to open a "safety_large_vert" but i can't seem to make it work.



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;
}
}

This is what i have, i have used this script to open a "castlebase_secret_door"
and it worked.
so if anyone can help me out, i'll i give you a High Five Big Grin
Are you sure you can move that object? I'm asking because I don't know either :3


12-06-2011, 02:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: need a little with a script

Do you mind showing the rest of the script? I want to make sure where and how the connection state change callback is being set.

Tutorials: From Noob to Pro
(This post was last modified: 12-06-2011, 05:37 PM by Your Computer.)
12-06-2011, 05:37 PM
Website Find
christopher231 Offline
Junior Member

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

(12-06-2011, 02:25 PM)flamez3 Wrote:
(12-06-2011, 02:16 PM)christopher231 Wrote: Hey, in my story i have this little puzzle at the start and once you complete it you find a lever, and i want this lever to open a "safety_large_vert" but i can't seem to make it work.



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;
}
}

This is what i have, i have used this script to open a "castlebase_secret_door"
and it worked.
so if anyone can help me out, i'll i give you a High Five Big Grin
Are you sure you can move that object? I'm asking because I don't know either :3
i don't know if you can, because you can't go up to it and move it.



(12-06-2011, 05:37 PM)Your Computer Wrote: Do you mind showing the rest of the script? I want to make sure where and how the connection state change callback is being set.
so do you mean the whole .hps file?

(This post was last modified: 12-08-2011, 03:06 AM by christopher231.)
12-08-2011, 03:02 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: need a little with a script

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

Yeah.

Tutorials: From Noob to Pro
12-08-2011, 03:06 AM
Website Find
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




Users browsing this thread: 1 Guest(s)