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 More scripting help!
mrlego611 Offline
Junior Member

Posts: 13
Threads: 3
Joined: Nov 2012
Reputation: 0
#1
More scripting help!

So im back with another scripting problem. So I wanted to add a memento script. After adding it, I test the map and this error appears!


FATAL ERROR: Could not load script file 'custom_stories/TheCellar/maps//Applications/Amnesia.app/Contents/Resources/custom_stories/TheCellar/maps/01_cellar.hps'!
ExecuteString (1, 1) : ERR : No matching signatures to 'OnLeave()'
main (23, 1) : ERR : Unexpected token '{'

Always happens when I add a new script. -.- Here's the whole script. It's quite long:

void OnStart(){    AddUseItemCallback("", "valvekey", "valvedoor", "UsedKeyOnDoor", true);    AddEntityCollideCallback("Player", "Tp_Script1", "tp_male1", true, 1);    AddEntityCollideCallback("Player", "key_quest_area", "GetKeyQuest", true, 1);    AddEntityCollideCallback("Player", "key_complete_area", "FinishKeyQuest", true, 1);}
void UsedKeyOnDoor(string &in asItem, string &in asEntity){    SetSwingDoorLocked("valvedoor", false, true);    PlaySoundAtEntity("", "unlock_door", "valvedoor", 0, false);    RemoveItem("valvekey");}
void tp_male1 (string &in asParent, string &in asChild, int alState){    SetEntityActive("tp_male1", true);    AddPropForce("tp_male1", 0, 0, -10000,"World");    PlaySoundAtEntity("", "24_iron_maiden.snt", "tp_male1", 0, false);}
{    AddUseItemCallback("", "waterkey_1", "level_water", "UsedKeyOnDoor", true);}
void UsedKeyOnDoor(string &in asItem, string &in asEntity){    SetSwingDoorLocked("level_water", false, true);    PlaySoundAtEntity("", "unlock_door", "level_water", 0, false);    RemoveItem("waterkey_1");}
void GetKeyQuest(string &in asParent, string &in asChild, int alState){    AddQuest("keyquest", "KeyQuest");}
void FinishKeyQuest(string &in asParent, string &in asChild, int alState){    CompleteQuest("keyquest", "KeyQuest");}
11-02-2012, 11:19 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: More scripting help!

Please, put the script well. It seems a lot of text with some commas and brackets.
I can't help you if you have it that way.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-02-2012, 11:40 AM
Find
ZodiaC Offline
Member

Posts: 120
Threads: 8
Joined: Oct 2012
Reputation: 2
#3
RE: More scripting help!

(11-02-2012, 11:19 AM)mrlego611 Wrote: So im back with another scripting problem. So I wanted to add a memento script. After adding it, I test the map and this error appears!


FATAL ERROR: Could not load script file 'custom_stories/TheCellar/maps//Applications/Amnesia.app/Contents/Resources/custom_stories/TheCellar/maps/01_cellar.hps'!
ExecuteString (1, 1) : ERR : No matching signatures to 'OnLeave()'
main (23, 1) : ERR : Unexpected token '{'

Always happens when I add a new script. -.- Here's the whole script. It's quite long:

void OnStart(){    AddUseItemCallback("", "valvekey", "valvedoor", "UsedKeyOnDoor", true);    AddEntityCollideCallback("Player", "Tp_Script1", "tp_male1", true, 1);    AddEntityCollideCallback("Player", "key_quest_area", "GetKeyQuest", true, 1);    AddEntityCollideCallback("Player", "key_complete_area", "FinishKeyQuest", true, 1);}
void UsedKeyOnDoor(string &in asItem, string &in asEntity){    SetSwingDoorLocked("valvedoor", false, true);    PlaySoundAtEntity("", "unlock_door", "valvedoor", 0, false);    RemoveItem("valvekey");}
void tp_male1 (string &in asParent, string &in asChild, int alState){    SetEntityActive("tp_male1", true);    AddPropForce("tp_male1", 0, 0, -10000,"World");    PlaySoundAtEntity("", "24_iron_maiden.snt", "tp_male1", 0, false);}
{    AddUseItemCallback("", "waterkey_1", "level_water", "UsedKeyOnDoor", true);}
void UsedKeyOnDoor(string &in asItem, string &in asEntity){    SetSwingDoorLocked("level_water", false, true);    PlaySoundAtEntity("", "unlock_door", "level_water", 0, false);    RemoveItem("waterkey_1");}
void GetKeyQuest(string &in asParent, string &in asChild, int alState){    AddQuest("keyquest", "KeyQuest");}
void FinishKeyQuest(string &in asParent, string &in asChild, int alState){    CompleteQuest("keyquest", "KeyQuest");}
Jesus Christ!
Try this one :

void OnStart()
{  
AddUseItemCallback("", "valvekey", "valvedoor", "UsedKeyOnDoor", true);  
AddEntityCollideCallback("Player", "Tp_Script1", "tp_male1", true, 1);  
AddEntityCollideCallback("Player", "key_quest_area", "GetKeyQuest", true, 1);  
AddEntityCollideCallback("Player", "key_complete_area", "FinishKeyQuest", true, 1);

}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{    
SetSwingDoorLocked("valvedoor", false, true);    
PlaySoundAtEntity("", "unlock_door", "valvedoor", 0, false);
RemoveItem("valvekey");
  
   }
  
void tp_male1 (string &in asParent, string &in asChild, int alState)
{  
SetEntityActive("tp_male1", true);  
AddPropForce("tp_male1", 0, 0, -10000,"World");
PlaySoundAtEntity("", "24_iron_maiden.snt", "tp_male1", 0, false);
  AddUseItemCallback("", "waterkey_1", "level_water", "UsedKeyOnDoor", true);
  
}

void GetKeyQuest(string &in asParent, string &in asChild, int alState)
{    
AddQuest("keyquest", "KeyQuest");

}

void FinishKeyQuest(string &in asParent, string &in asChild, int alState)
{    
CompleteQuest("keyquest", "KeyQuest");
}

And try to keep all you algorithms like this because you won't be able to find your errors...
By the way you had too many "}" and a func used twice. I'm not sure if the "AddUseItemCallback("", "waterkey_1", "level_water", "UsedKeyOnDoor", true);" on start or on tp_male1 anyway i think you will find it.

[Image: 2H1Mc.jpg]
11-02-2012, 12:07 PM
Find




Users browsing this thread: 1 Guest(s)