![]() |
#1 | |
Free Software Terrorist
Technical Director
|
![]() For an actual explanation of the additions and how they work well... ... You can check the readme online which explains all the things.
A quick intro: A proof of concept vJass compiler, vJass is an extension to the Jass syntax enabling a bunch of crazy things like libraries, structs and textmacros. Also adds the zinc scripting language, which is just a tweak of vJass with some small additions/more restrictions and syntax that is a little less verbose: check the zinc readme for more info.
The files
Bug reporting /suggestion rule #1 Oct 09, 2009, 22:00 GMT Please use vJass or zinc code for your suggestions and bug reports. Because it is confusing and if I have to learn a new language every time a person makes a post it would really suck. If you do not use either Zinc or vJass in your report, I'll not only ignore it, I will delete it. There is an exception though and it is when posting code in another language to explain a feature I should copy. Rule #2 Nov 13th, 2009. Report bugs in this thread, expecting me to go through links to other threads / and specifically other sites to be able to reproduce the bug is not going to be tolerated anymore. Rule #3 Nov 21th, 209. The easier you make to me to reproduce a bug, the more likely it will get fixed. Since I do not use NewGen Pack, sending me inputwar3map.j besides the map will seriously help a lot. Just in case When installing a new jasshelper version in newgen pack, replace jasshelper.exe and clijasshelper.exe in the folder called "bin" inside jass newgen pack's folder. |
|
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
BertTheJasser |
This message has been deleted by Vexorian.
Reason: ...
|
![]() |
#2 |
Free Software Terrorist
Technical Director
|
![]() because of lack of a command from WEHelper it is not compressing the mpq when closing the map, so you might notice that the map gets mich bigger than before after using it, don't worry, the effect can be solved by a mpq editor and is fixed automatically if you optimize the map
__________________ |
![]() |
![]() |
![]() |
#3 |
Free Software Terrorist
Technical Director
|
![]() Version 0.8.0 has got a new feature which complements scopes pretty well, this is a quick example:
__________________![]() //! textmacro STACK takes NAME, TYPE, TYPE2STRING //! scope $NAME$ globals private $TYPE$ array V private integer N=0 endglobals public function push takes $TYPE$ val returns nothing set V[N]=val set N=N+1 endfunction public function pop takes nothing returns $TYPE$ set N=N-1 return V[N] endfunction public function print takes nothing returns nothing local integer a=N-1 call BJDebugMsg("Contents of $TYPE$ stack $NAME$:") loop exitwhen a<0 call BJDebugMsg(" "+$TYPE2STRING$(V[a])) set a=a-1 endloop endfunction //! endscope //! endtextmacro //! runtextmacro STACK("StackA","integer","I2S") //! runtextmacro STACK("StackB","integer","I2S") //! runtextmacro STACK("StackC","string","") function Test takes nothing returns nothing call StackA_push(4) call StackA_push(5) call StackB_push(StackA_pop()) call StackA_push(7) call StackA_print() call StackB_print() call StackC_push("A") call StackC_push("B") call StackC_push("C") call StackC_print() endfunction |
![]() |
![]() |
![]() |
#5 |
Free Software Terrorist
Technical Director
|
![]() 0.9.0 fixes bugs, adds structs, library_once and textmacro_once.
__________________I didn't have time to document the aditions, the readme would be updated tomorrow with some luck. this is a sample of structs: ![]() struct vec integer x = 0 integer y=0 integer z=0 endstruct function vec_add takes vec A, vec B returns vec local vec C= vec.create() set C.x = A.x + B.x set C.y = A.y + B.y set C.z = A.z + B.z return C endfunction function vec_string takes vec A returns string return "("+I2S(A.x)+","+I2S(A.y)+","+I2S(A.z)+")" endfunction function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing local vec a=vec.create() local vec b=vec.create() local vec c set a.x=2 set a.y=2 set a.z=5 set b.x=-7 set b.y=8 set b.z=9 set c=vec_add(a,b) call BJDebugMsg(vec_string(a)+" + "+vec_string(b) +" = "+vec_string(c)) //either works: call vec.destroy(c) call a.destroy() call b.destroy() endfunction coming soon: methods, inheritance and polymorphism. (static attributes are currently possible, also private members, although they have no use since there are no methods) Notice structname.create() would return 0 if the 8190 instance limit is reached, if debug mode is enabled it would show a message in game in that case. So just be careful not to create more than 8190 instances and if there is that possibility check if the returned struct is not 0. |
![]() |
![]() |
![]() |
#6 |
Free Software Terrorist
Technical Director
|
![]() a quickfix version, 0.9.1
|
![]() |
![]() |
![]() |
#7 |
User
Join Date: Jul 2005
Posts: 88
![]() |
![]() So I noticed in the syntax error screen that this doesn't use gamecache like you originally planned(I saw an example of how you thought OOP could work), but instead it uses arrays, does that mean that using this should be faster than game cache?
Last edited by zergleb : 11-26-2006 at 11:33 PM. |
![]() |
![]() |
![]() |
#8 |
User
Join Date: Feb 2006
Posts: 399
![]() ![]() ![]() |
![]() Arrays are, as I hear, much faster than gamecache.
__________________ |
![]() |
![]() |
![]() |
#9 |
User
Respected User
|
![]() Hmm, can structs be set as globals? if yes can them be setted as global arrays, and how would you inialize them?
Last edited by BlinkBoy : 11-27-2006 at 03:24 AM. |
![]() |
![]() |
![]() |
#10 |
Free Software Terrorist
Technical Director
|
![]() hmnn, I guess that with that calculus exam floating around I forgot to make the documentation anyways. Considering we declared the vec struct type of the previous post:
__________________![]() globals vec ouch = 0 //you can initialize an struct reference at 0 in a globals declaration //syntax error: vec ouch = vec.create() //you cannot do struct syntax in global declarations (because global blocks are always moved to the top of the script, before functions exist. vec array SOLUTIONS //yes, arrays are possible, endglobals function doThings takes nothing returns nothing set ouch=vec.create() set SOLUTIONS[0] = vec.create() set SOLUTIONS[1] = vec.create() set SOLUTIONS[2] = vec.create() //and so and so... endfunction ![]() struct teststatic static integer N=0 //unlike 'normal' struct members these are static, they are effectively just global variables with other syntax static integer array V //syntax error: integer array X //array attributes are not allowed endstruct function teststatic_fun takes nothing returns nothing set teststatic.N=teststatic.N+1 set teststatic.V[ teststatic.N] = 8 endfunction |
![]() |
![]() |
![]() |
#11 |
Moderator
Code Moderator
Join Date: Feb 2006
Posts: 1,405
![]() ![]() ![]() ![]() |
![]() Looking good. Can't wait to see methods & polymorphism.
__________________ |
![]() |
![]() |
![]() |
#12 |
Free Software Terrorist
Technical Director
|
![]() 0.9.2 grave bugs when struct compiler had to add more than 20 globals were fixed.
__________________ |
![]() |
![]() |
![]() |
#13 |
User
Join Date: Jul 2005
Posts: 88
![]() |
![]() Is there going to be private/public global variable OOP support?? what I mean is like right now to use public struct variables I must work it like this.
![]() function InitIncArg takes nothing returns nothing set KillUnit = IncType.create()//these all work fine set KillHero = IncType.create() set Construct = IncType.create() set TrainUnit = IncType.create() set Outpost = IncType.create() set KillUnit.Value = 1.0/10 //Not a struct name, nor a variable function of a struct type set ResourceSystem_KillHero.Value = 1.0/5 set ResourceSystem_Construct.Value = 1.0/30 set ResourceSystem_TrainUnit.Value = 1.0/20 set ResourceSystem_Outpost.Value = 50.0 endfunction Just a question, nothing more. btw thanks for the fixes in version 0.9.2 I always appreciate/enjoy your work and promptness fixing problems. |
![]() |
![]() |
![]() |
#14 |
Free Software Terrorist
Technical Director
|
![]() I don't understand the question.
__________________Edit: I see, it is a bug, KillUnit should work, probably I forgot to consider . a token. Edit: All right, bug fixed. |
![]() |
![]() |
![]() |
#15 |
User
Respected User
|
![]() Ok, i've found some things and limitations, but also found a lil bug.
![]() struct domin integer tax = 0 player conqueror = Player(13) boolean sur = false endstruct globals domin array V force array C endglobals function Trig_Surrender_Settings_Actions takes nothing returns nothing local integer f = 0 set V[0] = domin.create() set V[1] = domin.create() set V[2] = domin.create() set V[3] = domin.create() set V[4] = domin.create() set V[5] = domin.create() set V[6] = domin.create() set V[7] = domin.create() set V[8] = domin.create() set V[9] = domin.create() set V[10] = domin.create() set V[11] = domin.create() // In this way, the syntax is correct, but then if i try setting them dynamicly: loop set V[f] = domin.create() set f = f + 1 exitwhen f >= 12 endloop // This will cause a syntax error set f = 0 loop set C[f] = CreateForce() set f = f + 1 exitwhen f >= 12 endloop endfunction My first Question, will you improve the system to support dynamic arrays, with structures ? Now a lil bug, that I found. If you set a struct variable in an if statement, it will cause a syntax error. ![]() //.............. if d != Player(13) and V[GetPlayerId(a)].sur == false then //.............. so i must declare a boolean variable and give it that value Last edited by BlinkBoy : 11-29-2006 at 06:10 PM. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|