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 Please
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#1
Script Help Please

Please help I cannot find what is wrong with my script here-

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
AddEntityCollideCallback("Player", "AreaDoorSlam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DoorSlam", false, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityDamage(5.0f, true);
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate");
GiveSanityBoostSmall();
}
03-28-2012, 03:20 AM
Find
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#2
RE: Script Help Please

void func_slam(string &in asParent, string &in asChild, int alState)
}

Nothing comes after this? And notice that your brackets are messed up there. Try this:

void func_slam(string &in asParent, string &in asChild, int alState)
{
}


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

Whats up here? You should press the return button in between the PlaySounds, so it's like this.

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

Other then that everything looks good. No missing semi-colons or quotes.



Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
(This post was last modified: 03-28-2012, 05:13 AM by DaAinGame.)
03-28-2012, 05:11 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#3
RE: Script Help Please

For future reference, the error message that appears when loading the map contains a reference to the line where the problem originates. There are 2 numbers in brackets e.g. (27, 10). The first number (in this example '27') is the line number where the problem is occuring. This helps to track down the issue
03-28-2012, 02:27 PM
Find




Users browsing this thread: 1 Guest(s)