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
Coding Problem
hananh129 Offline
Junior Member

Posts: 6
Threads: 1
Joined: Oct 2015
Reputation: 0
#1
Coding Problem

Hi everyone!

I'm super new to this so this might be something really simple that I'm encountering...

**I use a Macbook if this changes anything...I'm using the textedit app to code.**

So, I've set up my custom story - I've made 2 maps (01_start.map and 02_hallway.map), the extra_english.lang file, the custom_story_settings file and I'm just starting on the coding for map 1. The problem I'm having is I'm trying to make a level door that is locked, and a key to unlock it. I've got the door locked, and it makes the locked sound, but it doesn't display the message I've asked it to. Also, I've tried to rename the key and it's description but that isn't working either, nor does it actually unlock the door. Here are all my files.

extra_english.lang:

<LANGUAGE>
<RESOURCES>
</RESOURCES>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">blah blah.</Entry>
</CATEGORY>

<CATEGORY Name=“Messages”>
<Entry Name=“doorlock1”>It’s locked. I must’ve left my key in my room somewhere.</Entry>
</CATEGORY>


<CATEGORY Name=“Inventory”>
<Entry Name=“ItemDesc_key_study_1”>This is the key for the door downstairs.</Entry>
<Entry Name=“ItemName_key_study_the 1”>Hallway Key</Entry>
</CATEGORY>

</LANGUAGE>


custom_story_settings.cfg

<Main
ImgFile = "customstory.png"
Name = "1942"
Author = "Hannah129"

MapsFolder = "maps/"
StartMap = "01_start.map"
StartPos = "PlayerStartArea_1"
/>

level 1 coding (this is saved in the same place as *maps* with the same name as my first map in my custom story, and it's saved as 01.start.hps.rtf)


void OnStart ()
{
AddUseItemCallback (“”, “key_study_1”, “level_wood_1”, “FUNCTION”, true);
}

void OnEnter ()
{

}

void OnLeave ()
{

}

void FUNCTION (string &in item, string &in door)
{

SetLevelDoorLocked (“level_wood_1”, false);
PlayGuiSound (“unlock_door.snt”, 100);
RemoveItem (“key_study_1”);

}

I've checked over and over and over again and I can't seem to find anything wrong! Is this a really simple error I've made, am I going crazy? I literally just started yesterday so I'm really new to this, I don't do coding so...
HuhSad

Thanks anyone in advance! Big Grin
10-02-2015, 04:00 AM
Find


Messages In This Thread
Coding Problem - by hananh129 - 10-02-2015, 04:00 AM
RE: Coding Problem - by Romulator - 10-02-2015, 04:50 AM
RE: Coding Problem - by hananh129 - 10-02-2015, 05:09 AM
RE: Coding Problem - by Romulator - 10-02-2015, 05:19 AM
RE: Coding Problem - by hananh129 - 10-02-2015, 05:27 AM
RE: Coding Problem - by Romulator - 10-02-2015, 05:45 AM
RE: Coding Problem - by hananh129 - 10-02-2015, 05:48 AM
RE: Coding Problem - by Romulator - 10-02-2015, 06:15 AM
RE: Coding Problem - by hananh129 - 10-02-2015, 06:22 AM
RE: Coding Problem - by Romulator - 10-02-2015, 06:36 AM
RE: Coding Problem - by hananh129 - 10-02-2015, 06:42 AM
RE: Coding Problem - by Romulator - 10-02-2015, 06:51 AM
RE: Coding Problem - by Mudbill - 10-02-2015, 10:19 AM



Users browsing this thread: 1 Guest(s)