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
Unexplainable Error!
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#1
Unexplainable Error!

I keep having the following error:
FATAL ERROR: Could not load script file 'custom_stories/betrayal/maps/Map1.hps'! main (75, 2) : ERR : Unexpected end of file

and I use the following script(this is the entire script used, the end is associated with the error, so the OnLeave):
PHP Code: (Select All)
////////////////////////////
// Run when entering map the first time
void OnStart()
{
    
FadeOut(0);
    
SetPlayerActive(false);
    
SetSanityDrainDisabled(true);
    
ShowPlayerCrossHairIcons(false);
    
AddTimer("fadein"3"Intro");
    
PlayMusic("janji_summer_memories.ogg"false1.201false);
    
AddUseItemCallback("""key_door_room_1_1""level_room_1_2""unlock_1"false);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
    
AddEntityCollideCallback("Player""area_load_1_1""Load1Enter"false1);
}

void Load1Enter(string &in asParentstring &in asChildint alState)
{
    
AddLocalVarInt("Load1Enter"1)


void unlock_1(string &in asItemstring &in asEntity)
{
    
SetLevelDoorLocked("level_room_1_2"false);
    
PlaySoundAtEntity("""unlock_door.snt""level_room_1_2"0false);
    
RemoveItem("key_door_room_1_1");
}

void Intro(string &in asTimer)
{
    if(
GetLocalVarInt("Intro") < 3) {
        if(
asTimer == "fadein") {
            
TeleportPlayer("intro_" GetLocalVarInt("Intro"));
            
FadeIn(1);
            
AddTimer("fadeout"4"Intro");
        }
        if(
asTimer=="fadeout") {
            
FadeOut(1);
            
AddTimer("fadein"1"Intro");
            
AddLocalVarInt("Intro"1);
        }
    }
    else
    {
        
TeleportPlayer("begin");
        
FadeIn(2);
        
SetPlayerActive(true);
        
SetSanityDrainDisabled(false);
        
ShowPlayerCrossHairIcons(true);
        
PlayMusic("janji_summer_memories.ogg"true0.222false);
    }
}

void note_room_1_1(string &in asEntity)
{
    
AddGlobalVarInt("key_1"1);
    if(
GetGlobalVarInt("sanity_1") == 1){
        
AddGlobalVarInt("sanity_action_1"1);    
    }
    else{
        
AddGlobalVarInt("sanity_off_1"1);
    }

////////////////////////////
// Run when leaving map
void OnLeave()
{
    if(
GetLocalVarInt("Load1Enter") == 1){
        
SetupLoadScreen("load_1_1""load_1_1"false"map_2_edited.png");
    }


What did I do wrong? Whoever explains it from Romulator or Mudbill (they usually explain it Tongue) will be the best for me. Thx ^_^
11-14-2016, 07:06 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Unexplainable Error!

PHP Code: (Select All)
void Load1Enter(string &in asParentstring &in asChildint alState)
{
    
AddLocalVarInt("Load1Enter"1)


Missing semicolon.

11-14-2016, 10:18 PM
Find
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#3
RE: Unexplainable Error!

(11-14-2016, 10:18 PM)Mudbill Wrote:
PHP Code: (Select All)
void Load1Enter(string &in asParentstring &in asChildint alState)
{
    
AddLocalVarInt("Load1Enter"1)


Missing semicolon.

Thanks for that, but I still experience the same problem! It's probably because you can't use "if" statements in OnLeave properly, I will try to make it using Interact Callbacks. However, that's gonna wait for tomorrow, I gtg sleep. Tongue

EDIT: Man I'm busy, I'll do it eventually. Tongue
(This post was last modified: 11-15-2016, 11:16 PM by Verkehr.)
11-14-2016, 11:14 PM
Find
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#4
RE: Unexplainable Error!

How do I make different pictures for each door? I can't think of a solution, but the "if" statements don't work apparently. :/
11-16-2016, 05:55 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: Unexplainable Error!

Different pictures? What do you mean? Loading screens?

11-16-2016, 05:57 PM
Find
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#6
RE: Unexplainable Error!

(11-16-2016, 05:57 PM)Mudbill Wrote: Different pictures? What do you mean? Loading screens?

Oh my god I JUST realized the mistake! :D
PHP Code: (Select All)
void note_room_1_1(string &in asEntity)
{
    
AddGlobalVarInt("key_1"1);
    if(
GetGlobalVarInt("sanity_1") == 1){
        
AddGlobalVarInt("sanity_action_1"1);    
    }
    else{
        
AddGlobalVarInt("sanity_off_1"1);
    }
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
    if(
GetLocalVarInt("Load1Enter") == 1){
        
SetupLoadScreen("load_1_1""load_1_1"0"map_2_edited.png");
    }

Normally, the note_room_1_1 didn't have the } on the end, so it resulted in as it didn't have a proper ending at the end.
Just now how do I make the picture load? I use this directory:
C:\Program Files (x86)\Steam\steamapps\common\Amnesia The Dark Descent\custom_stories\betrayal\textures\loading\map_2_edited.png
How do I make it load? It doesn't load that, and so neither the lang I use! :/
Until that part, everything works just as it should, which is good!
(This post was last modified: 11-16-2016, 07:49 PM by Verkehr.)
11-16-2016, 07:48 PM
Find
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#7
RE: Unexplainable Error!

(11-16-2016, 05:57 PM)Mudbill Wrote: Different pictures? What do you mean? Loading screens?

And yes, I do.
11-16-2016, 10:57 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Unexplainable Error!

Add a debug message in your if statement to see that it actually runs.

11-17-2016, 12:32 AM
Find
Verkehr Offline
Member

Posts: 60
Threads: 13
Joined: Oct 2016
Reputation: 1
#9
RE: Unexplainable Error!

OK, but if it doesn't, can you tell me the best option I have? I use right now areas for it.

Nope, didn't work. :/
(This post was last modified: 11-17-2016, 04:04 PM by Verkehr.)
11-17-2016, 03:29 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Unexplainable Error!

Is it possible that OnEnter() doesn't trigger if this is the map the player spawns in?
If so, then the "Load1Enter" starts at 0, causing the if-statement not to trigger.

Another thing: Is it on purpose that you used AddGlobalVarInt and not SetGlobalVarInt?
If the player enters the level 2 times "Load1Enter" will then be 2 and the if-statement won't trigger anymore.

Trying is the first step to success.
(This post was last modified: 11-17-2016, 06:43 PM by FlawlessHappiness.)
11-17-2016, 06:42 PM
Find




Users browsing this thread: 4 Guest(s)