The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
New To Scripting
ohheylookitsmax Offline
Junior Member

Posts: 13
Threads: 1
Joined: May 2013
Reputation: 0
#1
New To Scripting

Hi everyone. I'm really new to scripting and creating custom stories. I keep trying to test out my map so far, but each time, I get an error notice as follows: FATAL ERROR: Could not load script file(my directories for my .hps)! main (10,1) : ERR : Unexpected token '{'
I assume it has something to do with the way I set up the script file. Here is my .hps file.

void OnStart()
{
AddUseItemCallback("", "FrontDoorKey", "Front_door", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "pick_key", "FrontDoorKey", 0, false);
}
{
SetSwingDoorLocked("Front_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Front_door", 0, false);
RemoveItem("FrontDoorKey");
}

Any help would be greatly appreciated. I'm not sure where I can go online to learn about scripting, so if anyone knows where I might find that, it would also be a LARGE help. Thank you. Also, here while I'm doing this, I'm going to put my extra_english.lang script file down below as well to see if anyone can correct it, if needed.

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Willam Thomas has always lived a simple, quiet life. This is all about to change on one spring morning in Wales, Ireland, in 1934.</Entry>
</CATEGORY>

</CATEGORY Name ="Inventory">
<Entry Name="ItemDesc_FrontDoorKey"> "Key to the front door."</Entry>
<Entry Name="ItemName_FrontDoorKey">Front Door Key</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_ToDoList_Name">To Do List</Entry>
<Entry Name="Note_ToDoList_Text">Today is the big day. I've finally written down everything I need to do today. I've rang the taxi. I must meet them out side of town on the main road. Next, I must carry my belongings out to the road with me. I also shouldn't forget the taxi fare and, of course, my favorite little paperweight. I think I put it in a chest in the back somewhere...</Entry>
</CATEGORY>
</LANGUAGE>

To be clear, I read the important thread but I just don't get it. I tried following the instructions and it ended up creating more file problems.
Here's my file now:

void OnStart()
{
AddUseItemCallback("", "FrontDoorKey", "Front_door", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "pick_key", "FrontDoorKey", 0, false);
}

{
SetSwingDoorLocked("Front_door", false, true);
PlaySoundAtEntity("", "unlock_door", "Front_door", 0, false);
RemoveItem("FrontDoorKey");
}
the error report i get now is for lines 12 13 and 14 about needing expected identifiers. Basically they keep pointing out the parenthesis that I've marked in bold. I really don't know what to do. Please help.
(This post was last modified: 05-26-2013, 04:57 AM by ohheylookitsmax.)
05-24-2013, 08:16 PM
Find


Messages In This Thread
New To Scripting - by ohheylookitsmax - 05-24-2013, 08:16 PM
RE: New To Scripting - by The chaser - 05-24-2013, 08:52 PM
RE: New To Scripting - by ohheylookitsmax - 05-24-2013, 09:12 PM
RE: New To Scripting - by FlawlessHappiness - 05-24-2013, 09:40 PM
RE: New To Scripting - by ohheylookitsmax - 05-24-2013, 11:24 PM
RE: New To Scripting - by FlawlessHappiness - 05-25-2013, 12:33 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 01:26 AM
RE: New To Scripting - by PutraenusAlivius - 05-25-2013, 02:03 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 02:10 AM
RE: New To Scripting - by PutraenusAlivius - 05-25-2013, 02:15 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 02:22 AM
RE: New To Scripting - by PutraenusAlivius - 05-25-2013, 02:54 AM
RE: New To Scripting - by Daemian - 05-25-2013, 02:56 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 03:19 AM
RE: New To Scripting - by Tomato Cat - 05-25-2013, 03:26 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 03:33 AM
RE: New To Scripting - by Romulator - 05-25-2013, 04:03 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 04:26 AM
RE: New To Scripting - by Romulator - 05-25-2013, 04:56 AM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 03:15 PM
RE: New To Scripting - by Romulator - 05-25-2013, 04:01 PM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 04:14 PM
RE: New To Scripting - by PutraenusAlivius - 05-25-2013, 03:51 PM
RE: New To Scripting - by Romulator - 05-25-2013, 04:17 PM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 04:28 PM
RE: New To Scripting - by Your Computer - 05-25-2013, 04:50 PM
RE: New To Scripting - by ohheylookitsmax - 05-25-2013, 05:28 PM
RE: New To Scripting - by Romulator - 05-25-2013, 04:42 PM



Users browsing this thread: 1 Guest(s)