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
Multiple Issues Help Level not updating past first room
LiVam Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2012
Reputation: 0
#1
Level not updating past first room

I recently started learning to use the HPL editor, and I've run in to some serious issues when attempting scripting.

First off, here are my script files:

Quote: <LANGUAGE>
<RESOURCES />
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
Test
</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_Test01_Name">
</Entry>
<Entry Name="Note_Test01_Text">
</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_prisondoorkey">
This key will open a specific prison door
</Entry>
<Entry Name="ItemName_prisondoorkey">
Prison Door Key
</Entry>
</CATEGORY>
</LANGUAGE>
And the .hps:
Quote: ////////////////////////
// Run when Starting
void OnStart()
{
AddUseItemCallback("", "prisondoorkey_1", "prisondoor_1", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor(string &in prisondoorkey_1, string &in prisondoor_1)
{
SetSwingDoorLocked(prisondoor_1, false, true);
PlaySoundAtEntity("", "unlock_door", prisondoor_1, 0, false);
RemoveItem(prisondoorkey_1);
}

////////////////////////
// Run when leaving map
void OnLeave()
{


}
These both WORK in game. I can use my key, open the door. All is good.
However, my level will no longer update properly.
There is only one room in the level, containing the door, the key and some various objects (floors, walls, props..). When I leave the room, there are some floor tiles leading to blackness. When I started adding a roof to the room, and more floors and walls to the next area, none of them would show ingame. Nor did they seem to exist (I could still fall through the blackness, in other words, there was no floor).
I added a light to the second area, which seemed to work and light up the floor. But the new floor (not the original floor connected with the first room) still won't show, or exist.
I tried adding objects to the first room and that works just fine, but the roof still won't show.

I have tried this so far:
-Rewriting the .lang and .hps files from scratch. At one time I used the HPLlang editor to try that as well.
-Creating a completely new level from scratch. The level I am describing is my second level. Nothing was copied from the last attempt.

I seem to be running in to this issue when I start using scripts. Any help is greatly appreciated.
Any questions can be directed to me here, or on my skype: LiVamxz

Thanks a ton Smile
01-04-2012, 08:52 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Level not updating past first room

I suggest 2 things:

1) Make sure there is no "mapname.map_cache" If there is one, delete it and restart the game. Don't worry, it won't ruin the map. just make sure it is the MAP_CACHE.

2) Simply try to restart amnesia. Sometimes the game needs to update its resources.
Also, you leave the syntax title the way it is, you don't fill it in with the information that it seems to call... for example:


void UsedKeyOnDoor(string &in prisondoorkey_1, string &in prisondoor_1)
{
SetSwingDoorLocked(prisondoor_1, false, true);
PlaySoundAtEntity("", "unlock_door", prisondoor_1, 0, false);
RemoveItem(prisondoorkey_1);
}


SHOULD SAY:



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


ALSO, you don't need "<RESOURCES />"... You can take that out.
(This post was last modified: 01-04-2012, 09:41 PM by Statyk.)
01-04-2012, 09:37 PM
Find
LiVam Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2012
Reputation: 0
#3
RE: Level not updating past first room

@Statyk

That appears to have done the trick Smile
Thanks a lot. Rep coming your way!
01-04-2012, 10:05 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Level not updating past first room

(01-04-2012, 10:05 PM)LiVam Wrote: @Statyk

That appears to have done the trick Smile
Thanks a lot. Rep coming your way!
Haha, no problem my friend =] May I ask which was the issue? Just curious
01-04-2012, 10:06 PM
Find
LiVam Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2012
Reputation: 0
#5
RE: Level not updating past first room

It appears to be related to the cache file. When I removed it first my custom story wouldn't load in Amnesia though. So I opened it in the level editor, saved it again, and a new cache was created. I deleted that, and then it worked just fine.

Is there some rule to remember when it comes to cache files or so?
01-04-2012, 10:11 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: Level not updating past first room

(01-04-2012, 10:11 PM)LiVam Wrote: It appears to be related to the cache file. When I removed it first my custom story wouldn't load in Amnesia though. So I opened it in the level editor, saved it again, and a new cache was created. I deleted that, and then it worked just fine.

Is there some rule to remember when it comes to cache files or so?
Well the cache saves the map and if you don't delete the map cache the map don't want to update in game Smile



01-04-2012, 10:30 PM
Find
LiVam Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jan 2012
Reputation: 0
#7
RE: Level not updating past first room

(01-04-2012, 10:30 PM)SilentStriker Wrote:
(01-04-2012, 10:11 PM)LiVam Wrote: It appears to be related to the cache file. When I removed it first my custom story wouldn't load in Amnesia though. So I opened it in the level editor, saved it again, and a new cache was created. I deleted that, and then it worked just fine.

Is there some rule to remember when it comes to cache files or so?
Well the cache saves the map and if you don't delete the map cache the map don't want to update in game Smile
Ah!
Thanks man Smile

01-04-2012, 11:00 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#8
RE: Level not updating past first room

(01-04-2012, 11:00 PM)LiVam Wrote:
(01-04-2012, 10:30 PM)SilentStriker Wrote:
(01-04-2012, 10:11 PM)LiVam Wrote: It appears to be related to the cache file. When I removed it first my custom story wouldn't load in Amnesia though. So I opened it in the level editor, saved it again, and a new cache was created. I deleted that, and then it worked just fine.

Is there some rule to remember when it comes to cache files or so?
Well the cache saves the map and if you don't delete the map cache the map don't want to update in game Smile
Ah!
Thanks man Smile
No problem Smile



01-05-2012, 12:40 AM
Find




Users browsing this thread: 1 Guest(s)