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 Script help
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
Script help

whats wrong i get error at row 3 :S


void OnStart()
{
AddUseItemCallback("", "hollow_needle_1", "Locked_door", "NeedleOnDoor", true);
AddUseItemCallback("", "Key_1", "Loocked_door_3", "KeyOnDoor1", true);
AddUseItemCallback("", "Key_2", "door5", "KeyOnDoor2", true);
AddUseItemCallback("", "Key", "locked_door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "Horror_Barrel", "HorrorBarrel", true, 1);
AddEntityCollideCallback("Player", "MusicStart_1", "Music1", true, 1);
AddEntityCollideCallback("Player", "Event_1", "Horror_Event1", true, 0);
AddEntityCollideCallback("Player", "grunt_spawn", "MonsterFunction", true, 1);
AddEntityCollideCallback("grunt", "remove_grunt", "RemoveMonster", true, 1);
AddEntityCollideCallback("Player", "door_slam", "DoorSlam", true, 1);
SetEntityPlayerInteractCallback("PuzzleOne", "PuzzleOnInteract", true);
SetEntityPlayerInteractCallback("Note_Scream2", "HeadLess", true);
SetEntityPlayerInteractCallback("Note_Scream", "Sound1", true);
SetEntityPlayerInteractCallback("Note_Lost2", "Sound2", true);
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("button_simple_1", "func1", true);
SetEntityPlayerInteractCallback("button_simple_2", "func2", true);
SetEntityPlayerInteractCallback("button_simple_3", "func3", true);
SetEntityPlayerInteractCallback("button_simple_4", "func4", true);
SetEntityPlayerInteractCallback("candlestick01_1", "Lighter", true);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door5", false, true);
PlaySoundAtEntity("", "unlock_door", "door5", 0, false);
RemoveItem("Key_2");
}
void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Loocked_door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Loocked_door_3", 0, false);
RemoveItem("Key_1");
}
void Sound2(string &in asEntity)
{
PlaySoundAtEntity("", "Get the fuck our or you will die!.snt", "Player", 0.0f, false);
AddTimer("T2", 4, "Timer2");
}
void Timer2(string &in asTimer)
{
SetMessage("Message", "Wtf", 0);
}
void Lighter(string &in asEntity)
{
SetEntityActive("PointLight_1", true);
}


void RemoveMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_6", 0, "");

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

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}
void func1(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func2(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func3(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func4(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func5()
{
if(GetLocalVarInt("Var1") == 4)
{
/////add what ever you want to happen after you press all 4 buttons here.
SetLevelDoorLocked("door1", false);
PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.5f, false);
}
}

void HeadLess(string &in asEntity)
{
SetEntityActive("headless", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0, false);
}

void Sound1(string &in asEntity)
{

PlaySoundAtEntity("", "15_prisoner_scream.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "scare_breath.snt", "Player", 0.0f, false);
}

void PuzzleOnInteract(string &in asEntity)
{
AddTimer("T1", 4, "Timer1");
}
void Timer1(string &in asTimer)
{
SetMessage("Message", "PuzzleMessage", 0);
}
void NeedleOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Locked_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Locked_door", 0, false);
RemoveItem("hollow_needle_1");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "locked_door_1", 0, false);
RemoveItem("Key");
}
void HorrorBarrel(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("HorrorBarrel", true);
PlaySoundAtEntity("HorrorBarrel", "24_iron_maiden.snt", "Player", 0, false);
AddPropForce("HorrorBarrel", 20000, 0, 0, "world");
}

void Music1(string &in asParent, string &in asChild, int alState)

{
PlayMusic("ambience_voice.ogg", true, 0.8f, 1, 0, true);
}

void Horror_Event1(string &in asParent, string &in asChild, int alState)

{
SetEntityActive("box", true);
AddPropImpulse("box", 0, 0, 200, "world");
PlaySoundAtEntity("", "03_wind.snt", "Player", 0.0f, false);
}
void OnLeave()
{

}

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-07-2012, 12:55 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Script help

Can you write the whole error message please?

04-07-2012, 12:59 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: Script help

(04-07-2012, 12:59 PM)SilentStriker Wrote: Can you write the whole error message please?
oh nvm the error was on other hps Tongue
(04-07-2012, 12:59 PM)SilentStriker Wrote: Can you write the whole error message please?
but i got another issue i want the door to open with
AddPropForce

but nothing happend :S

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 04-07-2012, 01:10 PM by jessehmusic.)
04-07-2012, 01:03 PM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: Script help

Typo: "Loocked_door_3"


Noob scripting tutorial: From Noob to Pro

04-07-2012, 01:33 PM
Find




Users browsing this thread: 1 Guest(s)