• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] vJass, the new generation

Status
Not open for further replies.
hmm..well, it had to happen some day that someone would post this here, though i stick to use handle vars on THW as it is more understandable for the most jassers we got here, since THW havent got as many advanced jassers like wc3c.

But maybe it is time to show people here that JASS preprocessers are much more effective than handle vars and such things.
 
Level 12
Joined
Mar 11, 2004
Messages
600
Using a timer stack mostly means you are doing things the wrong way.

For those 0.01~0.04 timeout timers used for animations you certainly don't need them

And for the other timers with bigger delays used for cleaning effects and to call functions after a time, you don't need more than 2 timers during the whole game.

Well that's the logic behind TimeLib which you may find at : http://www.wc3campaigns.net/showthread.php?t=93785

TimeLib simply says "don't attach stuff to timers, it is not needed" . And well, it saves a lot of hassle.

With timer stacks you need to be careful about double frees, you may add protection against them in the timer stack functions but I think that it should also be possible to have the timer as a member of an struct, the only thing required would be to have a way to get the struct from GetExpiredTimer() but it is an over complication to use timers this way.

And well, this is the reason vJass is not biased towards any library since stuff seem to get better with the time, so adding a lot of syntax to feature some kind of library more easily is not worth it since they tend to get obsolete with time.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Vexorian, could you please post a easy to DL link to this program, I can not download it from wc3c due to some anti link protection, even if i axcess and browse wc3c directly. Also the links in wc3c are messed up, they link me to random pages on the fourm. . .
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
UnMi --

Libraries; can require other libraries, can hold private members, and bump their script to the top of the map. Can also have initializers.

Eg.

JASS:
//Yayz! We're above even the Custom Script section!
library PieLib initializer PieInit needs CSCache //I need CSCache!
    private function Pie takes nothing returns nothing
        //Haha! I can only be called by functions inside PieLib
    endfunction
    function PieInit takes nothing returns nothing
        //Haha! I'm called on map init
    endfunction
endlibrary

That's basically libraries in a nutshell.

Scopes are basically just the Private option in libraries (correct me if they can have initializers). Eg.

JASS:
scope HidingCriminals
    private function Criminal takes nothing returns nothing
        //O_o the police can't get me!
    endfunction
    globals
         private string secretHideoutLocation = "Elm Street"//I'm also safe!
    endglobals
    private struct passwords
         string lastWeek = "camel"
         string thisWeek = "spam"
        //can't touch this!
    endstruct
endscope

function Police takes nothing returns nothing
    call Criminal()
    //Darn! It doesn't work! Where could those criminals have gone?
endfunction

Finally, methods are functions within structs. Eg.

JASS:
struct Pie
    integer numPies
    real percentCherry = .05
    method AddCherries takes real percent returns nothing
        set this.percentCherry = this.percentCherry + percent
    endmethod
endstruct

function TestPie takes nothing returns nothing
    local Pie dat = Pie.create()
    set dat.numPies = 3
    call dat.AddCherries()
endfunction
 
Last edited:
Level 5
Joined
Feb 16, 2006
Messages
151
LOL! You should become a teach in the primary school >>;...
Well, I see now, thanks a lot!
But...now where is the use of libaries/scopes? Are they like for easier importing? Why not just use the header?
The methods are very useful...
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Have fun with your posts, that's my philosophy :p

(as long as they're not spammy)

Libraries(/scopes) are mostly for

-Cheating with initializer functions (libraries)

-Making code that you want others to use, but have bits that only you should be able to touch (private, library/scope)

-not ever having to use the header again (libraries).
It's alot nicer to be able to organize your stuff in a 'Funcs' folder and just dump each thing in a seperate "trigger", rather than having to scroll through 10s of 1000s of lines of the header

Also, libraries can have scopes, but libraries can't have libraries. I also think scopes can have scopes, but don't quote me on that one
 
Last edited:
Level 12
Joined
Mar 11, 2004
Messages
600
Jacek, it is fine that you are vintage and won't take accept that things change, but could you please tell me how handle vars could replace "this way"? Purplepoot has been discussing a lot of things that are simply not related to what handle vars do.

Aren't you the same guy that said is unable to read long spell code? libraries or wewarlocks require have been invented because code organization is important, you do have a brain and should know the difference between coding a game using only one syntax file and using multiple syntax files with correct placing for code that has specific uses.

In regards to storage, I am also afraid that handle vars are an extremely overcomplicated way to do things that ends up doing them in the most unsafe and slow way possible, thus ever using handle vars makes you look bad, if you are afraid that using tools may make you look weak, then use the normal Jass you love so much, notice that handle vars are in no way "normal Jass", and that you could pretty much replace them with clever array usage. Of course, the post fix syntax of arrays may make the code look pretty bad, but that's the reason you are using "normal jass".

And if this a single case of the NIH syndrome, nothing stops you from making your own preprocessor.

..
scopes can have child scopes, although I am yet to find an use for that...

Dr. Super Good: Fix your browser's cookies or get a browser without bugged cookies. Or enable cookies.
 
Level 3
Joined
May 1, 2007
Messages
29
This stuff looks so sexy, hmmmm the possiblities =)



Grrrrr, Well as many of you know WC3c website is down and well....i can't find vJass anywhere else, is there anyway someone could like e-mail a copy 2 me or something? Just send me a PM and i will send you my e-mail. Thanx a bundle =)
 
Last edited:
Level 3
Joined
Oct 20, 2006
Messages
27
I don't have the latest version, but is the delay syntax included with the latest? I'd really like Vex to implement that, he showed it to me once. It was tons better than TSA and TSA loops, and might be even better than timers used for damage overtime. What it does is delay the thread, simply what TSA's(TriggerSleepAction) do, but very accurate and can "delay" the thread for 0.01 seconds. So you can replace timers & function callbacks with a loop and this delay Pipedream suggested to Vex.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Could you PM me JassNewGenPack two?

NewGenPack is making me problems, for some unknown reason, I don't have new features anymore and I think I screwed up my map, because when I save my map, it crashes (no wonder, WE sintax checker + vJass :)), but still saves some of it (because it crashes in the middle of loading) and I don't think saving like that is good.......

If anyone has a slightest clue what might be the problem, I would really appreciate if you tell me, though I seem to be the only one with that problem.......please help, I really love vJass :) (it seems that nobody on wc3jass knows what's wrong, but maybe you guys will)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
I'll have to find an alternate way to distribute it, since GMail doesn't like .exe files.

And I don't like sites like filefront, so that's out of the question

Hmm...

In other news

I don't have the latest version, but is the delay syntax included with the latest? I'd really like Vex to implement that, he showed it to me once. It was tons better than TSA and TSA loops, and might be even better than timers used for damage overtime. What it does is delay the thread, simply what TSA's(TriggerSleepAction) do, but very accurate and can "delay" the thread for 0.01 seconds. So you can replace timers & function callbacks with a loop and this delay Pipedream suggested to Vex.

Not that I know of
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
I doubt it, since Vex was only talking about implementing it.

And for the record, delay WILL NOT be the same as TriggerSleepAction accurately. The implementation will be using a timer, and with a different approach. This will have differences, ie: it won't be a proper thread, so waits in it will screw it up, you won't be able to reference things like GetTriggerUnit (unless it smartly determines if you need that and then stores it to an attached variable), etc.

Loads of problems are caused by people saying what things do with no concern for what is actually happening. If people don't understand what is actually going on, they'll never be able to fix things.
 
Level 3
Joined
May 1, 2007
Messages
29
Loads of problems are caused by people saying what things do with no concern for what is actually happening. If people don't understand what is actually going on, they'll never be able to fix things.


True, True. A while ago i was looking at assembly languge just to get a better understanding on how specifcly programing languges interacte with the computer. It was quite the eye opening experience =)
 
Level 11
Joined
Jul 12, 2005
Messages
764
I have jassnewgen 3a. It was 2 Mb, so i don't know what your talking about PP.. :S

And it would be the time to upload it on the Hive..

But, i have a problem. (Maybe 3c doesn't have it, but i couldn't dl it). So when i run the newgen we, the first time everything works fine, i have the special menus and such (-the map compiles-), but after the second run, it's like i opened the normal we. (?)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Paskovich, I had the exact same problem! It took me a long time to figure it out: if you have cracked wc3, then copy those cracks and replace them with the same ones, I'm not sure if it will work for you

Or if you have your JassNewGenPack in your wc3 folder, GET IT OUT, put it somewhere else (that's what banlord told me)
 
Level 11
Joined
Jul 12, 2005
Messages
764
I extracted it to a folder, and executed "New Gen World Editor.exe". After turning my PC on, first time it's ok, but after closing it and running it again, it runs like normal WE. If i restart my PC, it's working again. If i do it with the *.bat file, it's the same. I tried 'c', but the bug is still there.
(I have a cracked wc, could this be the problem?)

And also one more thing. I don't know if it's normal or not, but when i try to test-run a map with newgen WE, it simply opens wc (main menu). But when i save my map, and THEN test it, it works.
Strange...

EDIT: Silvenon, i just read your post. Then it must be the crack. But what do you mean by "copy those cracks and replace them with the same ones"?? And i extracted it to an entirely different folder, "far from" WarCraft.
 
Level 3
Joined
May 4, 2007
Messages
66
I have same problem but thats probably cuz of cracked WE. Its not such a big deal, i just restart WE a few times until i get NewGen WE. And i read in some manual that u have to save map manually before testing it.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
New Gen editor can't test the map if you don't save it (someone should have mentioned that, I had to find out that myself), but there's another thing that annoys me, you can't open a map in tft (game) when using new gen

Paskovich, I mean copy them somewhere else, and then put them in your wc3 folder, the the computer asks you if you want to replace it, then you said yes. My second suggestion doesn't work (the one that I posted to paskovich)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Yeah, well it seems that Vexorian was wrong :p

I don't think there's any scripting program that is compatible with vJass, but if they are going to do that, they should fix some bugs before that, because JassShopPro has a good sintax checker, JassCraft doesn't, JassCraft can import an external code, JassShopPro can't..........bah why don't they just fix one of them???
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I don't know how, but I think it's because JassCraft is a little buggy, I'm amazed how nobody had the problem with its sintax checker, when I want to check something, it gives me 50 errors on 5 lines. It seems that only I have that problem
 
Status
Not open for further replies.
Top