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 Error 2.0
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#1
Exclamation  Script Error 2.0

Something is wrong with this script, can anyone tell me what?


[Image: WpXsE.png]

I'm sorry, I don't know how to make spoilers...

____________________________________________________________________________________

void OnStart()
{
//EDITOR
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i< 10;i++) GiveItemFromFile("potion_sanity_"+i, "potion_sanity.ent");

SetupLoadScreen("LoadingScreens", "LoadingScreen_1", 0.0f, "Darkness.jpg");
SetPlayerCrouching(true);
GiveSanityDamage(99, false);
//
//MUSIC, SOUNDS

PlayMusic("04_amb.ogg", true, 10, 2, 1, true);


//
//INTRO
/*
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
//FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
//FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 3.3f, "beginStory");
//
*/
//ITEMS
AddUseItemCallback("", "KeyDoor1", "PrisonSection2Door", "UnlockPrisonSection2", true);
AddUseItemCallback("", "KeyDoor2", "MorgueDoor", "MorgueDoorFunc", true);

//

//SCARE

SetEntityPlayerInteractCallback("ScareDoor", "ScareDoorFunc", true);

//

//MISC

AddTimer("Memento1", 5, "Memento1");


SetEntityPlayerInteractCallback("AreaTouch1", "AreaTouchItFunc", false);
SetEntityPlayerInteractCallback("AreaTouch2", "AreaTouchItFunc", false);
SetEntityPlayerInteractCallback("AreaTouch3", "AreaTouchItFunc", false);
SetEntityPlayerInteractCallback("AreaTouch4", "AreaTouchItFunc", false);
//

//MONSTER
AddEntityCollideCallback("Player", "ActivatePlayerCollide2", "ActivatePlayerCollide2Func", true, 1);
SetEntityPlayerInteractCallback("KeyDoor1", "Grunt1ActivateFunc", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction1", true, 1);
AddEntityCollideCallback("Grunt1", "Grunt1Remove", "Grunt1RemoveFunc", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide2", "MonsterFunction2", true, 1);
SetEntityPlayerInteractCallback("BruteDoor", "BruteDoorFunc", true);
AddEntityCollideCallback("Brute1", "Brute1Remove", "Brute1RemoveFunc", true, 1);

AddEntityCollideCallback("Player", "ActivateGrunt1.1", "Grunt11Func", true, 1);
AddEntityCollideCallback("Player", "ActivateGrunt1.2", "Grunt12Func", true, 1);

AddEntityCollideCallback("Player", "ActivateBruteH", "BruteHFunc", true, 1);
//

//DOOR
SetEntityPlayerInteractCallback("PrisonSection2Door", "PrisonSection2DoorFunc", false);
SetEntityPlayerInteractCallback("SpawnCellDoor", "SpawnCellDoorFunc", false);
SetEntityPlayerInteractCallback("DoorLocked1", "DoorLocked1Func", false);
SetEntityPlayerInteractCallback("SpawnCellDoor2", "SpawnCellDoor2Func", false);
SetEntityPlayerInteractCallback("DoorLocked02", "DoorLocked02Func", false);
//

//QUESTS

//AddEntityCollideCallback("Player", "GetQuest01", "GetQuest01", true, 1);
AddEntityCollideCallback("Player", "CompleteQuest01", "FinishQuest01", true, 1);
AddEntityCollideCallback("Player", "GetQuest02", "GetQuest02", true, 1);
AddEntityCollideCallback("Player", "CompleteQuest02", "FinishQuest02", true, 1);
}

//INRO

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
//FadeRadialBlurTo(0.0, 1);
//FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0, 1);
}

//
//ITEMS
void UnlockPrisonSection2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("PrisonSection2Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "PrisonSection2Door", 0, false);
RemoveItem("KeyDoor1");
AddDebugMessage("PrisonSection2Door Unlocked", false);
AddDebugMessage("PrisonSectionDoorArea Removed", false);
SetEntityActive("PrisonSection2Door", false);
}


void MorgueDoorFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("MorgueDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "MorgueDoor", 0, false);
RemoveItem("KeyDoor2");
AddDebugMessage("MorgueDoor Unlocked", false);
}

//

//----------BAJS!! Big Grin----------//

//DOOR

void PrisonSection2DoorFunc(string &in asEntity)
{
SetMessage("Messages", "Locked1", 0);
PlaySoundAtEntity("", "door_gate_bar_locked.ogg", "PrisonSection2Door", 0, false);
}

void SpawnCellDoorFunc(string &in asEntity)
{
SetMessage("Messages", "Locked2", 0);
}

void DoorLocked1Func(string &in asEntity)
{
SetMessage("Messages", "Locked3", 0);
}

void DoorLocked02Func(string &in asEntity)
{
SetMessage("Messages", "Locked3", 0);
}

void SpawnCellDoor2Func(string &in asEntity)
{
SetMessage("Messages", "Locked3", 0);
PlaySoundAtEntity("", "door_prison_locked.ogg", "SpawnCellDoor2", 0, false);
}

//

//SCARE

void ScareDoorFunc(string &in asEntity)
{
PlaySoundAtEntity("", "grunt/notice_long.snt", "ScareDoor", 0, false);
}

//


//SOUND

//

//BRUTE
void BruteDoorFunc(string &in asEntity)
{
AddDebugMessage("Checkpoint Saved", false);
CheckPoint ("Checkpoint3", "CH3", "CH3Func", "DeathHint", "CH3E");
SetEntityActive("Brute1", true);
GiveSanityDamage(10, true);
PlayGuiSound("react_pant.snt", 20.0f);
AddDebugMessage("Brute1 Enabled", false);
AddTimer("Brute1T", 55, Brute1TFunc);
//PATH
AddEnemyPatrolNode("Brute1", "PathNodeBrute1", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute2", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute3", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute4", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute5", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute6", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute7", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute8", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute9", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute10", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute11", 0, "");
AddEnemyPatrolNode("Brute1", "PathNodeBrute12", 0, "");
//PATH
}


void Brute1TFunc(string &in asTimer)
{
SetEntityActive("Brute1" ,false);
}


void Brute1RemoveFunc(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Brute1" ,false);
}
//

//GRUNT

void ActivatePlayerCollide2Func(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("PlayerCollide2", true);
AddDebugMessage("PlayerCollide2 Activated", false);
}




void Grunt1ActivateFunc(string &in asEntity)
{
SetEntityActive("PlayerCollide", true);
}

void Grunt1RemoveFunc(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Grunt1 Disabled", false);
}

void MonsterFunction1(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Checkpoint Saved", false);
CheckPoint ("Checkpoint1", "CH1", "CH1Func", "DeathHint", "CH1E");
PlaySoundAtEntity("", "break_wood.snt", "ScareDoor", 0, false);
SetEntityActive("DoorFloor", true);
SetEntityActive("ScareDoor", false);
AddDebugMessage("Grunt1 Enabled", false);
SetMessage("Messages", "Hint1", 0);
SetEntityActive("Grunt1", true);
//PlayMusic("10_event_coming.ogg", false, 1, 0.1, 10, false);
AddEnemyPatrolNode("Grunt1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_45", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_46", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_47", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_48", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_49", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_50", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_51", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_52", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_53", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_54", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_55", 0, "");
AddEnemyPatrolNode("Grunt1", "PathNodeArea_56", 0, "");
}

void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Checkpoint Saved", false);
CheckPoint ("Checkpoint2", "CH2", "CH2Func", "DeathHint", "CH2E");
AddTimer("Monster2T", 100.0f, "Monster2TFunc");
SetEntityActive("Grunt2", true);
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.1", 4.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.2", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.3", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.4", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.5", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.6", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.7", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.8", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.9", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.10", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.11", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.12", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.13", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.14", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.15", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.16", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.17", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.18", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.19", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.20", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.21", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.22", 0.0f, "");
AddEnemyPatrolNode("Grunt2", "PathNodeArea_1.23", 0.0f, "");
}

void Monster2TFunc(string &in asTimer)
{
SetEntityActive("Grunt2", false);
}

void Grunt11Func(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt1.1", true);
SetEntityActive("ActivateGrunt1.2", false);
}

void Grunt12Func(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt1.2", true);
SetEntityActive("ActivateGrunt1.1", false);
}

void BruteHFunc(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("BruteH", true);
ShowEnemyPlayerPosition("BruteH");
SetEnemyIsHallucination("BruteH", true);
//StartPlayerLookAt("BruteH", 0, true, "BruteHTFunc");
SetPlayerMoveSpeedMul(0.5);
SetPlayerRunSpeedMul(0.5);
AddTimer("BruteHT", 4, "BruteHTFunc");

}

void BruteHTFunc(string &in asTimer)
{
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
}

//
//TEST


//

//MISC

void Memento1(string &in asTimer)
{
AddQuest("quest01", "Quest01");
}

void AreaTouchItFunc(string &in asEntity)
{
PlayGuiSound("impact_organic_low2.ogg", 0.5f);
SetEntityActive("AreaTouch1", false);
SetEntityActive("AreaTouch2", false);
SetEntityActive("AreaTouch3", false);
SetEntityActive("AreaTouch4", false);
AddTimer(asEntity, 1.0f, "TimerTouchIt");
}

void TimerTouchIt(string &in asTimer)
{
SetEntityActive("AreaTouch1", true);
SetEntityActive("AreaTouch2", true);
SetEntityActive("AreaTouch3", true);
SetEntityActive("AreaTouch4", true);
}
//

//JOURNAL



//


//QUEST
void GetQuest01(string &in asParent, string &in asChild, int alState)
{
AddQuest("quest01", "Quest01");
}

void FinishQuest01(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("quest01", "Quest01");
}

void GetQuest02(string &in asParent, string &in asChild, int alState)
{
AddQuest("quest02", "Quest02");
}

void FinishQuest02(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("quest02", "Quest02");
GiveSanityBoostSmall();
}
//

void OnEnter()
{
PlayMusic("04_amb.ogg", true, 10, 2, 1, true);
}


void OnLeave()
{
StopMusic(1, 1);
SetupLoadScreen("LoadingScreens", "LoadingScreen_1", 1, "game_loading_strappado.jpg");
}
____________________________________________________________________________________


Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
(This post was last modified: 02-19-2012, 01:00 PM by GoranGaming.)
02-19-2012, 01:00 PM
Website Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Script Error 2.0

It tells you that your AddTimer line is wrong. You don't have quotation marks around the final parameter.

02-19-2012, 01:21 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#3
RE: Script Error 2.0

Thanks Smile

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
02-19-2012, 01:49 PM
Website Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Script Error 2.0

This could also be an issue:
void Brute1TFunc(string &in asTimer)
{
SetEntityActive("Brute1" ,false);
}


void Brute1RemoveFunc(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Brute1" ,false);
}



Move the commas in "SetEntityActive" back. It should be SetEntityActive("Brute1", false);
02-19-2012, 04:27 PM
Find




Users browsing this thread: 4 Guest(s)