Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FATAL ERROR: Could not load script file
Author Message
WalkingTerror Offline
Junior Member

Posts: 2
Joined: Jun 2017
Reputation: 0
Post: #1
FATAL ERROR: Could not load script file

I had all done and set up and then this error showed up what am i doing wrong ? Sad And the .HPS and .Map file is in the maps folder and have both exact same names Sad

This is my Code:

void OnStart()
{
AddUseItemCallback("", Key, Door, "UseKeyOnDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
}

void OnEnter()
{
SetPlayerLampOil(100);
PreloadSound("amb_idle.snt");
}

void OnLeave()
{
}


Attached File(s)
.png  Screenshot (1).png (Size: 30.75 KB / Downloads: 9)
06-11-2017 10:48 PM
Find all posts by this user Quote this message in a reply
Romulator Offline
G'day mate! :3

Posts: 3,503
Joined: Jan 2013
Reputation: 191
Post: #2
RE: FATAL ERROR: Could not load script file

The error code tells you your issue and apparently they are on your third line. Key and Door are not declared.

Look at your script's 3rd line: the AddUseItemCallback.

The script telling you that they are not declared means that the script thinks you're referencing something else in the .hps file. Really, all that you have done is forget to put them in quotation marks ( "" ) because they are string references. Provided you have an entity named "Key" and "Door" in your Level Editor, this should work.

PHP Code: (Select All)
AddUseItemCallback("""Key""Door""UseKeyOnDoor"true); 

Discord: Romulator#4942
[Image: 8f5d099c7b.png]
06-12-2017 09:32 AM
Find all posts by this user Quote this message in a reply
WalkingTerror Offline
Junior Member

Posts: 2
Joined: Jun 2017
Reputation: 0
Post: #3
RE: FATAL ERROR: Could not load script file

(06-12-2017 09:32 AM)Romulator Wrote:  The error code tells you your issue and apparently they are on your third line. Key and Door are not declared.

Look at your script's 3rd line: the AddUseItemCallback.

The script telling you that they are not declared means that the script thinks you're referencing something else in the .hps file. Really, all that you have done is forget to put them in quotation marks ( "" ) because they are string references. Provided you have an entity named "Key" and "Door" in your Level Editor, this should work.

PHP Code: (Select All)
AddUseItemCallback("""Key""Door""UseKeyOnDoor"true); 


Thank you it works! Smile
06-14-2017 12:21 PM
Find all posts by this user Quote this message in a reply
Romulator Offline
G'day mate! :3

Posts: 3,503
Joined: Jan 2013
Reputation: 191
Post: #4
RE: FATAL ERROR: Could not load script file

No problem! Good luck on your project Smile If you have any more questions, feel free to post them here Smile

Discord: Romulator#4942
[Image: 8f5d099c7b.png]
(This post was last modified: 06-15-2017 08:53 AM by Romulator.)
06-15-2017 08:52 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)