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 Error
UnknownUser Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2013
Reputation: 0
#1
Script Error

I have a problem with my CS

Starting my custom story the game crashes and send me a Fatal Error:

FATAL ERROR: Could not load script file 'custom_stories/.......'!
main 9,1):ERR :Expected ',' or ';'

My script file:

void OnStart()
{
PlaySoundAtEntity("", "21_scream8.snt", "ScriptScream_1", 0, false);
AddUseItemCallback("", "foolkey1", "foollevel_wood_1", "open1", true);
AddEntityCollideCallback("vase02_ghost_1", "AreafoolGhost1", "ghostscare1", true, -1);
}

void open1(string &in asItem, string &in asEntity)
void ghostscare1(string &in asParent, string &in asChild, int alState)
{
SetPropHealth(asParent, 0);
PlaySoundAtEntity("ghost_released", "03_in_a_bottle", "Player", 0, false);
GiveSanityDamage(10, true);
SetLevelDoorLocked("foollevel_wood_1", false);
PlaySoundAtEntity("", "Unlock_Door", "foollevel_wood_1", 0, false);
RemoveItem("foolkey1");
}



void OnLeave()

{

}




void OnEnter()
{

}


Help please.
(This post was last modified: 12-06-2013, 08:46 PM by UnknownUser.)
12-06-2013, 08:45 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Script Error

First off, WELCOME to the forums! Big Grin

Secondly, you have posted this in the wrong section of the forums. In future, please place it in the Development Support forum.

Now onto your code:

You have declared a routine for opening the door with the key, but you have not given it anything to perform, and regardless have not set the routine correctly. I have also taken the contents which should probably be within the open1() routine from the ghostscare1().

Try this Smile
PHP Code: (Select All)
void OnStart()
{
PlaySoundAtEntity("""21_scream8.snt""ScriptScream_1"0false);
AddUseItemCallback("""foolkey1""foollevel_wood_1""open1"true);
AddEntityCollideCallback("vase02_ghost_1""AreafoolGhost1""ghostscare1"true, -1);
}

void open1(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("foollevel_wood_1"false);
PlaySoundAtEntity("""Unlock_Door""foollevel_wood_1"0false);
RemoveItem("foolkey1");
}

void ghostscare1(string &in asParentstring &in asChildint alState)
{
SetPropHealth(asParent0);
PlaySoundAtEntity("ghost_released""03_in_a_bottle""Player"0false);
GiveSanityDamage(10true);
}

void OnLeave()

{

}

void OnEnter()
{



Discord: Romulator#0001
[Image: 3f6f01a904.png]
12-06-2013, 09:56 PM
Find
UnknownUser Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2013
Reputation: 0
#3
RE: Script Error

(12-06-2013, 09:56 PM)Romulator Wrote: First off, WELCOME to the forums! Big Grin

Secondly, you have posted this in the wrong section of the forums. In future, please place it in the Development Support forum.

Now onto your code:

You have declared a routine for opening the door with the key, but you have not given it anything to perform, and regardless have not set the routine correctly. I have also taken the contents which should probably be within the open1() routine from the ghostscare1().

Try this Smile
PHP Code: (Select All)
void OnStart()
{
PlaySoundAtEntity("""21_scream8.snt""ScriptScream_1"0false);
AddUseItemCallback("""foolkey1""foollevel_wood_1""open1"true);
AddEntityCollideCallback("vase02_ghost_1""AreafoolGhost1""ghostscare1"true, -1);
}

void open1(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("foollevel_wood_1"false);
PlaySoundAtEntity("""Unlock_Door""foollevel_wood_1"0false);
RemoveItem("foolkey1");
}

void ghostscare1(string &in asParentstring &in asChildint alState)
{
SetPropHealth(asParent0);
PlaySoundAtEntity("ghost_released""03_in_a_bottle""Player"0false);
GiveSanityDamage(10true);
}

void OnLeave()

{

}

void OnEnter()
{



Thanks man, it worked!
12-07-2013, 10:51 PM
Find




Users browsing this thread: 1 Guest(s)