JASS2, vJASS parser for Linux

Sooda

Diversity enchants
Reaction score
318
Indeed Jasshelper runs on Linux with Wine. I use command:
Code:
jasshelper.exe --scriptonly <path_to_common.j> <path_to_blizzard.j> <path_to_input.j> <path_to_output.j>
For test I try to compile PreventSave by TriggerHappy and compiler starts and finds error on line 2:
Could not find correct main function in file. / unclosed string.

Line 2 is comment line. Same happens with KT Timer code, finds error on line 2 which is again comment line. What now?

Fore those who try same in Linux (Ubuntu), make sure all file paths are correctly written. Space in file path will be marked with "\" + [SPACE] for example My Documents, will be My\ Documents.

In jasshelper folder (navigate to there with cd command) run looks this:
Code:
wine jasshelper.exe --scriptonly <path_to_common.j> <path_to_blizzard.j> <path_to_input.j> <path_to_output.j>
 

Artificial

Without Intelligence
Reaction score
326
> Could not find correct main function in file.
The file needs to have a function called main. [ljass]main[/ljass] is called by WC at map init, and it fires off all initialization. JH injects library, scope, etc. initialization calls there.

So if you're to parse a file instead of a map, you need to make sure there is a function called main there (just add an empty one if there isn't).
 

Sooda

Diversity enchants
Reaction score
318
:thup: This is solving that problem.
JASS:
function main takes nothing returns nothing
endfunction

It wants InitBlizzard now inside main function. Looks like I have to extract pure main function and always paste into my code header.
 

Artificial

Without Intelligence
Reaction score
326
What version of JH do you have? o_O According to the JH changelog missing the InitBlizzard call hasn't raised an error since 0.9.H.0 (the newest version is 0.A.2.A).

JASS:
function main takes nothing returns nothing
    call InitBlizzard()
endfunction

In case the newer versions do require it (I know they didn't a couple of versions ago, tested myself). ;p
 

Vexorian

Why no custom sig?
Reaction score
187
It is a problem when people use newgen crap to make their maps. Because they paste vJass code directly to triggers. But it is easy when it is your new map. I use WE to generate my map scripts.

Try this:
Open WE.
New Map
Delete all triggers
Go to custom script section
Type //! import "try.j"
Go to terrain editor. Export map script.
When running jasshelper use the map AND the map script I think something like:
jasshelper.exe common.j blizzard.j map.w3x war3map.j
It will tell you about not finding "try.j" that means everything is fine.
Make a hello world library and add it to a try.j file in the same path as the map. Now you can use vJass code without newgen pack and on windows + any OS that supports WINE.

Then you can import other files inside "try.j"

For now on, if you want to add preplaced units, or rects or items or other things that WE adds to the map script. Re-export the map script after doing so. Then recompile in command line using jasshelper and the new file. You can also change object editor stuff, but will need to recompile as well (you do not need to export the script in those cases, though)

Basically, I've been doing this for 2.5 years and it is even more effective than newgen pack. There is a problem when distributing a demo map made with this, I have to convert it to bunch of triggers with vjass code. So I made a tool called warcity to edit the .wct file. That whole thing is optional and you should only bother if you plan sharing demo maps.

Edit: If you want to open vJass maps made with newgen, you will need warcity to export the vJass code somewhere. Then convert everything to import, it sucks a little.

Edit: Ah I wanted to mention, these issues are not because using WINE has bugs or anything, jasshelper actually should work better in WINE than in dows vista/vista7 considering I use WINE to test jasshelper... The issues are related to not using jass new gen pack. I think that doing some things related with PEditor you can use newgen pack. But I don't care enough. Coding inside WE is uncomfortable, particularly so under WINE.
 

Sooda

Diversity enchants
Reaction score
318
Great tips like always. I use Ubuntu and World Editor crashes without reason constantly (Wine 1.1.34). Anyway Warcraft 3 is ageing and don't put too much steam into Windows Linux transition.
I am currently more into modeling, always runing with time can I import model and save map before WE decides to crash. Has made me avoid World Editor use in Linux until better days.
 

Vexorian

Why no custom sig?
Reaction score
187
WE Crashes are related to switching desktops or minimizing. If you use winecfg to make WE run in a virtual WINE desktop, it will not crash that easily anymore.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
It is a problem when people use newgen crap to make their maps. Because they paste vJass code directly to triggers.
I don't know if you saw my post over in the massive JassHelper thread on wc3c; I was wondering about the feasibility of a line prefix that works like an inverse of [ljass]//! novjass[/ljass], whereby the line is considered commented to the World Editor's syntax checker but is still compiled by JassHelper. Using it would be as easy as find all-replace line breaks with line break+prefix.

I've also been wondering about getting JassHelper to run ObjectMerger in WINE when called in a script. I haven't had any success. Have you? What setup needs to be done?
 

Vexorian

Why no custom sig?
Reaction score
187
I don't know if you saw my post over in the massive JassHelper thread on wc3c; I was wondering about the feasibility of a line prefix that works like an inverse of //! novjass, whereby the line is considered commented to the World Editor's syntax checker but is still compiled by JassHelper. Using it would be as easy as find all-replace line breaks with line break+prefix.
I didn't see such post but the idea has no practical use. It would still require we to modify newgen crap maps. And adding a //! vjass prefix to every single line of our code will ... suck, really, a lot. //! import is really easier and when you get used to it you become much faster at doing code stuff than when using newgen crap.

I was able to run object merger, but only the newest version that is found in the newest newgen. You need to modify jasshelper.conf or to use the one from newgen pack.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top