Deleted member 219079
D
Deleted member 219079
I ditched programming for a long time. I did try numerous languages occasionally, including big ones Java and C++. To me it seems like those languages seek for the stars and forget simplicity. Maybe if I worked in a group project / it was my job, I could do C++. I just came across C couple weeks ago and I love its simplicity.
And what better place to return to coding than the ever so lovable hive?
I made this little tool that converts intendation based vJASS into normal vJASS, without compromising readability.
Converts to:
---------------
HOW TO USE
Download newest version from my post on this thread. Have your vjassindent's folder appended in your PATH, or do mklink "path to jassnewgenpack\vjassindent.exe" "path to vjassindent.exe" on an elevated command prompt, or manually replace the jassnewgenpack's vjassindent on new version.
Command line setup guide:
vjassindent --help gives you up-to-date argumentation guide.
Sublime Text setup guide:
---------------
I'm way more ambitious than this (you have to start small
). I seek to create an entire vJass enhancement suite, including some new additions like generics, something like:
I need help with this:
If I knew how jasshelper opens the .w3x file, reads its script and writes it over, I'd do my own vJASS compiler, instead of fiddling with some command line stuff.
Also if here's people who know C, I'd appreciate to go over the script of the tool (in my most recent post on this thread) and give me feedback on how it looks.
---------------
Edit: Updated setup guide
And what better place to return to coding than the ever so lovable hive?
I made this little tool that converts intendation based vJASS into normal vJASS, without compromising readability.
JASS:
library ayy requires optional SpellEvent
//this is globals block
globals
private constant integer spellId='A000'
private struct Ayy extends array
static method onCast takes nothing returns nothing
//its the spell!
static if(LIBRARY_SpellEvent)
//init with spellevent
static method onInit takes nothing returns nothing
call SpellEvent.create(spellId,function thistype.onCast)
else
static method onAnyCast takes nothing returns boolean
if(GetSpellAbilityId()==spellId)then
call onCast()
return false
//init without spellevent
static method onInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function thistype.onAnyCast))
set t=null
JASS:
library ayy requires optional SpellEvent
//this is globals block
globals
private constant integer spellId='A000'
endglobals
private struct Ayy extends array
static method onCast takes nothing returns nothing
//its the spell!
endmethod
static if(LIBRARY_SpellEvent)
//init with spellevent
static method onInit takes nothing returns nothing
call SpellEvent.create(spellId,function thistype.onCast)
endmethod
else
static method onAnyCast takes nothing returns boolean
if(GetSpellAbilityId()==spellId)then
call onCast()
endif
return false
endmethod
//init without spellevent
static method onInit takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function thistype.onAnyCast))
set t=null
endmethod
endif
endstruct
endlibrary
---------------
HOW TO USE
Download newest version from my post on this thread. Have your vjassindent's folder appended in your PATH, or do mklink "path to jassnewgenpack\vjassindent.exe" "path to vjassindent.exe" on an elevated command prompt, or manually replace the jassnewgenpack's vjassindent on new version.
Command line setup guide:
vjassindent --help gives you up-to-date argumentation guide.
Sublime Text setup guide:
First get this (by Ruke): http://www.hiveworkshop.com/threads/sublimetext-jass.240219/
1. Go to Preferences>Settings - User
2. Add to list: "trim_automatic_white_space": false
3. Go to Tools>Build System>New Build System...
4. Insert (Angle bracketed items need to be edited):
Either have discrete folder for your indentation syntaxed files, or have different extension for them, for example .jx (and change build file's selection from *.j to *.jx)
Inside your map have
Troubleshooting:1. Go to Preferences>Settings - User
2. Add to list: "trim_automatic_white_space": false
3. Go to Tools>Build System>New Build System...
4. Insert (Angle bracketed items need to be edited):
{
"cmd": "vjassindent \"$file_path\*.j\" -o \"$file_path\\out.j\" && copy \"<path to map.w3x>\" \"<path to map (out).w3x>\" && \"<path to jasshelper.exe>\" \"<path to common.j>\" \"<path to Blizzard.j>\" \"<path to map (out).w3x>\" && del \"$file_path\\out.j\"",
"working_dir" : "<path to jassnewgenpack>",
"selector" : "source.jass",
"quiet" : true,
"shell": true
}
Either have discrete folder for your indentation syntaxed files, or have different extension for them, for example .jx (and change build file's selection from *.j to *.jx)
Inside your map have
//! import "path from jass folder to your out.j"
, jass folder being path to jassnewgenpack\jass
General: Indentation based syntax means that the tool relies on your indentation to be able to parse your code, which makes the tool very strict on your indentation. Therefore always make sure your text editor doesn't trim white space! For problems about code CnP:d from internet giving you errors, use --fix-by-ceil.
Sublime Text: Make sure you actually have your sublime-build selected from Tools>Build System ("automatic" should work as well if you have Ruke's plugin installed). Then make sure you know how to compile from cmd, as the "cmd" value in .sublime-build is simply just a command written to cmd that's cd'd to "working_dir". After that check for correct formatting in your build file, quotes have to be \" and backslashes have to be \\.
Sublime Text: Make sure you actually have your sublime-build selected from Tools>Build System ("automatic" should work as well if you have Ruke's plugin installed). Then make sure you know how to compile from cmd, as the "cmd" value in .sublime-build is simply just a command written to cmd that's cd'd to "working_dir". After that check for correct formatting in your build file, quotes have to be \" and backslashes have to be \\.
---------------
I'm way more ambitious than this (you have to start small
JASS:
struct LinkedList<Type> extends array
readonly <Type> data
readonly integer n
readonly integer p
//...
endstruct
I need help with this:
If I knew how jasshelper opens the .w3x file, reads its script and writes it over, I'd do my own vJASS compiler, instead of fiddling with some command line stuff.
Also if here's people who know C, I'd appreciate to go over the script of the tool (in my most recent post on this thread) and give me feedback on how it looks.
---------------
Edit: Updated setup guide
Last edited by a moderator: