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
Problems with coding / scripting for my custom story
flakeguy Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2011
Reputation: 0
#1
Problems with coding / scripting for my custom story

Hi! I've been inspired by PewDiePies adventures in various custom maps to create my own one and I have this perfect story I want to deliver! I was very proud of my first area in my custom map when I wanted to make a door, which required a key. The scripting went fine at first (note: this is my first attempt at coding, ever) untill some horrible error sign showed up, which I can't get rid of. Angry

Im sure something somewhere went wrong in my coding but I can't find it!

The error message is: "FATAL ERROR; could not load script customstories/Haunted/maps/Haunted.hps ERR: Expected '('

And I dont understand the .lang and .hps files. I have my extra_english.lang in customstories/haunted and TWO .hps files in customstories/haunted/maps

Please help me! Big Grin


This is what my Haunted.hps looks like:

My Haunted.hps looks like this:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "firstkey_1", "firstdoor_1", "Usedfirstkey_1", true);
}
void Usedfirstkey_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("firstdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor_1", 0, false);
RemoveItem("firstkey_1");
AddDebugMessage("Wrong", false);
}

void OnEnter()
{
}

void OnLeave
{
}

My Haunted.hps looks like this:

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "firstkey_1", "firstdoor_1", "Usedfirstkey_1", true);
}
void Usedfirstkey_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("firstdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor_1", 0, false);
RemoveItem("firstkey_1");
AddDebugMessage("Wrong", false);
}

void OnEnter()
{
}

void OnLeave
{
}

[/quote]My extra_english.lang:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You've just woken up and you don't know who you are, or where you are.[br]A note has been left, containing the very last few words of a mans life. Who was he?[br]It all starts from there. Good luck.</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_letterone_Name">Greg, 1922</Entry>
<Entry Name="Note_letterone_Text">I can't stand this. Can't stand none of it.[br]Im sick and tired of all the flaws in this life.[br]I feel dirty. I still hear their screams and I still can't wash of the blood on my hands.[br]Farewell</Entry>
</CATEGORY>

<CATEGORY Name ="Inventory">
<Entry Name="ItemName_firstkey">Simple Key</Entry>
<Entry Name="ItemDesc_firstkey">A normal simple key, probably unlocks a wooden door.</Entry>
</CATEGORY>

</LANGUAGE>
And my second .hps file:

<CATEGORY Name="Journal">

<Entry Name="Note_Name_Name">Title</Entry>

<Entry Name="Note_Name_Text">Text</Entry>

</CATEGORY>

<CATEGORY Name ="Inventory">
<Entry Name="ItemName_name">Name</Entry>
<Entry Name="ItemDesc_name">Name</Entry>
</CATEGORY>

(This post was last modified: 10-17-2011, 06:05 PM by flakeguy.)
10-17-2011, 06:03 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#2
RE: Problems with coding / scripting for my custom story

This is true:

////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "firstkey_1", "firstdoor_1", "Usedfirstkey_1", true);
}
void Usedfirstkey_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("firstdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor_1", 0, false);
RemoveItem("firstkey_1");
AddDebugMessage("Wrong", false);
}

void OnEnter()
{
}

void OnLeave()
{
}
10-17-2011, 06:07 PM
Find
flakeguy Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2011
Reputation: 0
#3
RE: Problems with coding / scripting for my custom story

Wow, that was fast! Thanks. Unfortunately another FATAL ERROR appeared. "Could not load script file etc ERR: A Function with the same name and parameters already exists"
10-17-2011, 06:11 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#4
RE: Problems with coding / scripting for my custom story

Try this:

void OnStart()
{
AddUseItemCallback("", "firstkey_1", "firstdoor_1", "Usedfirstkey_1", true);
}
void Usedfirstkey_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("firstdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor_1", 0, false);
RemoveItem("firstkey_1");
AddDebugMessage("Wrong", false);
}
10-17-2011, 06:13 PM
Find
flakeguy Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2011
Reputation: 0
#5
RE: Problems with coding / scripting for my custom story

That actually worked! I'm so glad! Thank you very much, I've been trying to fix this for a really long time, you're awesome Darion
10-17-2011, 06:19 PM
Find




Users browsing this thread: 1 Guest(s)