Frictional Games Forum (read-only)
[SCRIPT] Script help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Script help (/thread-14582.html)



Script help - jessehmusic - 04-07-2012

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()
{

}


RE: Script help - SilentStriker - 04-07-2012

Can you write the whole error message please?



RE: Script help - jessehmusic - 04-07-2012

(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


RE: Script help - Cranky Old Man - 04-07-2012

Typo: "Loocked_door_3"