MarkoJ
Junior Member
Posts: 9
Threads: 1
Joined: Oct 2015
Reputation:
0
|
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
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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:
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 |
|
MarkoJ
Junior Member
Posts: 9
Threads: 1
Joined: Oct 2015
Reputation:
0
|
RE: FATAL ERROR: Could not load script file
Thanks Mudbill, you may find this script familiar because it is a result of your tutorials
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
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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
Not much is happening, so it's great with some activity that we can help out with
Trying is the first step to success.
|
|
10-03-2015, 06:39 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
MarkoJ
Junior Member
Posts: 9
Threads: 1
Joined: Oct 2015
Reputation:
0
|
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
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
|
|
10-03-2015, 09:29 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
MarkoJ
Junior Member
Posts: 9
Threads: 1
Joined: Oct 2015
Reputation:
0
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
|