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
Script Help FATAL ERROR: Could not load script file
MarkoJ Offline
Junior Member

Posts: 9
Threads: 1
Joined: Oct 2015
Reputation: 0
#1
FATAL ERROR: Could not load script file

Hello. I am experiencing a weird problem that I've never had before.

I made a script to open a door with a crowbar and it gives me this error

[Image: fP3SnmA.png]

It says that there is an Unexpected end of file, and I have no idea what that means when I checked the line it's closed and I checked the script a couple of times and everything seemed fine.

I really need someone to help me out with this, here you can find the full script:

http://pastebin.com/aXqu17PM

Thanks for reading.
10-03-2015, 02:03 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: FATAL ERROR: Could not load script file

This error means you're likely missing a certain quote, parethensis or bracket somewhere. Because of this, the code interprets a huge part of the script incorrectly and neverending. The (85, 2) is often inaccurate in these instances, but it could be worth look at it.

If you use a proper coding text editor, it will likely highlight the issue for you.

Regardless, this ought to be the issue:

PHP Code: (Select All)
AddEntityCollideCallback(""CrowbarJoint", "AreaBreak", "BreakDoor", true, 1); 

See it?

PS: When you put it on pastebin, if you select C++ as the syntax highlight, it will look like this, so it might be easy to find. That is, if you don't have this highlighting in your editor already (which you should).

(This post was last modified: 10-03-2015, 02:18 PM by Mudbill.)
10-03-2015, 02:14 PM
Find
MarkoJ Offline
Junior Member

Posts: 9
Threads: 1
Joined: Oct 2015
Reputation: 0
#3
RE: FATAL ERROR: Could not load script file

Thanks Mudbill, you may find this script familiar because it is a result of your tutorials Smile

As for scripting I use Notepad++ and I'd appreciate if you could tell me where I can enable the feature that will show me my scripting mistakes.

Thanks for your help Smile

P.S
Would it be possible for you to make a tutorial where u can go in depth about adding sound effects into the levels?
10-03-2015, 06:10 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: FATAL ERROR: Could not load script file

(10-03-2015, 06:10 PM)MarkoJ Wrote: Would it be possible for you to make a tutorial where u can go in depth about adding sound effects into the levels?

You can just ask a question in here, if you need help Smile

Not much is happening, so it's great with some activity that we can help out with Smile

Trying is the first step to success.
10-03-2015, 06:39 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: FATAL ERROR: Could not load script file

In Notepad++, go to the "Language" menu, then select C > C++.

You can also associate the extension completely. Go to Settings > Style Configurator, then select C++, and write "hps" into the "User ext." box at the bottom. Restart NP++.

10-03-2015, 07:21 PM
Find
MarkoJ Offline
Junior Member

Posts: 9
Threads: 1
Joined: Oct 2015
Reputation: 0
#6
RE: FATAL ERROR: Could not load script file

(10-03-2015, 06:39 PM)FlawlessHappiness Wrote: You can just ask a question in here, if you need help Smile

Well I guess that would be my question, because I used the engine scripts page and found the void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);
I wanted to add that when the player steps into an area, but I can't get it to work, if you could do a step by step small tutorial for me, I'd appreciate it Smile
10-03-2015, 09:29 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: FATAL ERROR: Could not load script file

Where do you want these sound effects? If you just want ambience stuff, here are some suggestions.

If you want for example critter noises in a certain room, add a script area there and use the PlaySoundAtEntity() function on it. Alternatively you can use the editor "Sound" object. Make sure you select a looping sound, or else it's likely not going to be noticed.

If you want a random wind or thunder sound play as the player walks by, add a script area with a collision callback for the player. In the callback, run a PlaySoundAtEntity() function. That function can be used to make the sound play from a certain source in the map. If you just need a sound that doesn't use 3D, you can use PlayGuiSound() but that's mostly for player gasp sounds and such.

10-03-2015, 09:40 PM
Find
MarkoJ Offline
Junior Member

Posts: 9
Threads: 1
Joined: Oct 2015
Reputation: 0
#8
RE: FATAL ERROR: Could not load script file

Yes like ambient sound, so when you enter an area the sound starts somewhere behind you or in another room, to just give you the creeps and then it stops and never plays again, even if you re-enter the level.
10-04-2015, 08:25 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: FATAL ERROR: Could not load script file

About the "never play again" the easiest way would be to play the sound when you enter an area, and then set the area inactive.

Trying is the first step to success.
10-04-2015, 01:06 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: FATAL ERROR: Could not load script file

Yup. Have a collision with the player and a script area. Use that collision to trigger a sound effect somewhere in the map (on another script area for example), then set the collision area inactive. Of course, it might not be necessary if the collision callback is set to only run once in the map's OnStart function.

10-04-2015, 05:55 PM
Find




Users browsing this thread: 3 Guest(s)