Board index Roller Coaster Games NoLimits Coaster 2 NoLimits Coaster 2 Scripting Syntax Error When Scripting

Syntax Error When Scripting

Post your Nolimits 2 scripts here! Also any discussion regarding scription for NoLimits Coaster 2 should be placed in this forum

Post January 15th, 2014, 7:35 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Hi all, am working on scripting.
I get this error,

..\..\Users\Kyle\Documents\com.nolimitscoaster.nolimits2\Soarin\BlockScript.nlvm(1185) : error C10: Syntax error
...1 error(s), 0 warning(s)

I compared the original script, to my new script and I see nothing wrong with it. Any advice?

Credit to Mrcobra92 for the script.
I will not be uploading this, so I didn't ask for permission to use script. Hope you don't mind!

Post January 15th, 2014, 7:36 pm

Posts: 2892
Points on hand: 9,697.00 Points
Location: Philadelphia, Pennsylvania
If it's a syntax error, the tiniest thing could be wrong. Missing a ; or something. Compare again and look for every detail.

Post January 15th, 2014, 7:39 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Do spaces like this count?

Edit: Can't get more space bar hits between "this" and "count"
but you know what I mean.

Post January 15th, 2014, 7:51 pm

Posts: 5852
Points on hand: 5,806.00 Points
Location: Toronto, Ontario, Canada

Welcome to the world of writing code.

Post the contents of the script.

Post January 15th, 2014, 7:58 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Lol as I am sure you can tell, I am a noob at this.

Now I have done something and gotten this error
error C8: Class not found: BlockScript
...1 error(s), 0 warning(s)

I am going to post the original script that came with the download, and then my version of it.

Original: https://www.dropbox.com/s/qpb1uhaqf6vyc ... cript.nlvm
My Version: https://www.dropbox.com/s/3sw0h2txor4yw ... dited.nlvm

Post January 15th, 2014, 8:03 pm

Posts: 5852
Points on hand: 5,806.00 Points
Location: Toronto, Ontario, Canada


Post January 15th, 2014, 8:12 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
So what settings should I choose for Syntax Highlighting?
Sorry, what do you mean by change anything?
From file to Pastebin? No
From inside Pastebin? No

Original Script
http://pastebin.com/Pra89JvR

Custom Script
http://pastebin.com/eNsZwXF4

Post January 15th, 2014, 8:34 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
Look at the error message you received. See that '(1185)'? That's the line that triggered the the error. That doesn't mean that's the line with the error, but it's close.

In this case, you are missing a closing bracket before line 1185. Add a '}' on the line before 'private void processStorage3Block()'.

It appears you are also missing closing brackets before lines 1232 and 1279.

Post January 15th, 2014, 8:41 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Oh wow I totally missed that!
Now I get this error
..\..\Users\Kyle\Documents\com.nolimitscoaster.nolimits2\Soarin\BlockScript.nlvm(1233) : error C10: Syntax error
...1 error(s), 0 warning(s)

I think I know what I need to do now.
I'll post again if I get really stumped.

Thanks all!

Post January 15th, 2014, 8:46 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
Originally posted by TTD03

Oh wow I totally missed that!
Now I get this error
..\..\Users\Kyle\Documents\com.nolimitscoaster.nolimits2\Soarin\BlockScript.nlvm(1233) : error C10: Syntax error
...1 error(s), 0 warning(s)

I think I know what I need to do now.
I'll post again if I get really stumped.

Thanks all!


Sorry, I was editing my post to include those lines and took time to test it.

Also, line 8 needs to be changed to be your class name, the name of the file so change "BlockScript" to "BlockScriptedited"

Post January 15th, 2014, 9:23 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
I just changed it to BlockScriptedited for uploading purposes.
I left it at BlockScript for the original.
Thanks for the help!
Will fix it in a bit.

Post January 15th, 2014, 11:46 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Thought I almost had it all fixed.
Then I get this.

BlockScript: Block 'Storage 3' not found

Exception: NullPointerException
at private void BlockScript.updateControlPanel() in line 506
at public void BlockScript.onAutoMode(com.nolimitscoaster.Coaster)
at void com.nolimitscoaster.Coaster.handleScriptedBlockSystemEvents()

Have no idea how to fix this one.

Link to this code: http://pastebin.com/dP5Z07BQ

Post January 16th, 2014, 11:27 am

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
Do you have 'Storage 3' defined somewhere? It sounds like you are trying to use it without telling the script what it is. Given the structure of the error, it may be something missing or misnamed in your coaster setup rather than the code.

I'm at work right now, but I'll take a look at the script when I get home to see what I can see.

Post January 16th, 2014, 12:22 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
I haven't changed anything, I am pretty sure everything that needs to be defined is defined. I don't think I messed anything up in the coaster set up either. I'll wait to see what you find out.
Thanks.

Post January 16th, 2014, 11:17 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
I don't see what the problem could be, but I haven't sat down and read through all the code at the execution level to see what it's supposed to be doing. My suggestion would be to contact the original author if you can.

A Null Pointer Exception means you are trying to perform a pointer operation on something that doesn't exist.

I know you said your coaster is correct, and I'm not saying it's wrong, but the easiest thing to check is your coaster. Make sure there is a 'Storage 3'. I'm sure there is, but you always start with the simplest solution because it's usually the thing you are absolutely sure isn't wrong, that's wrong.

Post January 16th, 2014, 11:20 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Ok so you think I should check in the NL2 editor that Storage 3 exists.
Will try. Thanks

Post January 19th, 2014, 8:01 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7306
Points on hand: 738.00 Points
Bank: 111,265.11 Points
Update: I haven't changed anything since the previous error
Now I get a
error C8: Class not found: BlockScript
...1 error(s), 0 warning(s)

EDIT: nevermind about the C8 error, I had the file as a .txt instead of a .nlvm.

Now just getting this error still

BlockScript: Block 'Storage 3' not found

Exception: NullPointerException
at private void BlockScript.updateControlPanel() in line 506
at public void BlockScript.onAutoMode(com.nolimitscoaster.Coaster)
at void com.nolimitscoaster.Coaster.handleScriptedBlockSystemEvents()

Most recent version: http://pastebin.com/FR3ASJV2
Also posting the park file itself: https://www.dropbox.com/sh/xta8ktl1ny9l6tl/ua6Kas2BVe

It should be placed in the com.nolimitscoaster.nolimits2 folder
All credit goes to Mrcobra92 for everything except the little parts I tweaked.


Return to NoLimits Coaster 2 Scripting

 


  • Related topics
    Replies
    Views
    Last post
cron