Map won't play when I add a globals block

DaFatalGigabyte

New Member
Reaction score
0
Seriously. It works without the globals block. When I add a globals block to the custom script
Code:
globals
integer Base = 0
endglobals

it doesn't work. When I test the game, it goes to the main screen immediately.
 

DrEvil

FCRI Associate!
Reaction score
111
Do you have JNGP (Jass NewGen Pack)?
That allows the extension for vJASS (global blocks)
 

DaFatalGigabyte

New Member
Reaction score
0
Indeed, I do. When I ran NewGen, I needed a shopping list of other stuff to get syntax checking to work. Is there anything else I need to install?

I just made a new map, and put in an empty function that previously would have an error thrown by JassHelper, which was that at line 7118, a real couldn't be converted to an integer, and line 7118 is blizzard's script. Anyway, I didn't get that error, but now I have this code:

Code:
globals
integer Base = 0
endglobals
 
function testFunc takes real paramInput returns string
endfunction

and I get these errors:
Code:
Line 33: parse error
Line 33: Statement outside of function
Line 33: Statement outside of function
Line 34: Statement outside of function
Line 34: Statement outside of function
Line 34: Statement outside of function
Line 34: Statement outside of function
Line 34: Statement outside of function
Line 35: Statement outside of function
Line 35: Statement outside of function
Line 37: Missing return
 

DrEvil

FCRI Associate!
Reaction score
111
Line 37: Means that it won't parse as you specify the return type is a string, and nothing will be returned.

About the other errors... I'm really not sure, maybe add a scope?
Just seem like weird errors for global blocks.
 

DaFatalGigabyte

New Member
Reaction score
0
Code:
globals
endglobals
 
function testFunc takes real paramInput returns string
return ""
endfunction

Code:
Line 33: parse error
Line 33: statement outside of function
Line 33: statement outside of function
Line 34: statement outside of function
Line 34: statement outside of function

:(
 

WaterKnight

Member
Reaction score
7
Which tool is it that displays the error? It sounds like you had not enabled vJass. Do other features of vJass work?
 

DaFatalGigabyte

New Member
Reaction score
0
Good call, thanks! I forgot I had disabled script optimizer and vJASS syntax because it threw an error before over Blizzard's script about a real being converted into an integer. Now it's successfully compiling with a globals block.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top