getting a jass script to compile in vanila editor custom text

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
I had a few issues, first, is there a way to define global variables, seeing as the global tags produce a syntax error? is it just:
JASS:
function GlobalDefinitions takes nothing returns nothing
    real r
    integer i
endfunction


just no local and it becomes a global?

and i keep getting an end of line error on every line, what does this mean?

AND i get syntax errors for lines that arent in the script

ie: max line is 500
i get errors for line 600+

vanilla jass is wack lol... but i have an awesome system for GUI users
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
You don't have freeform global declaration with vanilla jass. (well, not directly anyway) The only solution is to modify the war3map.j file to include the globals you need at the top of the script in the "globals" section.

That is all the vJass does to allow for freeform globals. It simply moves the globals you declare up to the "global" globals block. (heh) So if you want it for GUI, just create the variables using the variable editor or make a requirement of Jass NewGen.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
after going over weeps GUI Friendly Damage Detection it uses global variables that are not user-defined (udg_) but it says in order to use it correctly you must have automatically create unknown variables checked, would that work to use them if i made the code in another map and pulled it into mine?
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
It does use udg_ globals.

The way "automatically create unknown variables" works is that when you copy a trigger in GUI and paste it, it will automatically create any global variables used in that trigger. Many people have a separate trigger so that the users don't have to create the globals by themselves (well, if they are using GUI it should create it anyway, so they only create a separate trigger if using JASS for most of the system):
Code:
Example
    Events
    Conditions
    Actions
        Set MyInteger = 0
        Set MyReal = 104.432

In that example, if you have "automatically create unknown variables" checked, then upon pasting that trigger it will automatically create two variables: integer MyInteger and real MyReal.

Yes, it can work. You just have to create the variables in the variable editor and have a separate trigger kind of like the one I showed. (or like the one Weep has)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top