| 03-04-2008, 03:38 PM | #1 |
- Have you ever seen a map with more than 8190 functions? - Has a map ever survived with more than 60000 handle ids? - Has anyone actually successfully used MagicTimers? I plan to make a tutorial on them (which will mostly be about vJass' awesomeness (accept it)) but I first need to know if they are stable. - I was thinking on using {} for inline syntax, dunno if it is too lame of an idea. For example: JASS:function A takes integer level returns integer return 2*level endfunction //... set x = A{ GetUnitAbilityLevel(u,s) } //-> set x = 2*GetUnitAbilityLevel(u,s) - Also, next jasshelper version is going to be the last one that will bring more features to vJass, after that I am going to begin work on another (cross platform) compiler and there will be plenty of time before it hits stability, I will only add features to vJass after this compiler is released and 'kind of' stable. So, if you need to remind me of a very important feature that's missing, this may actually be your last chance in a long time. (I'll still fix bugs in jasshelper while making the new compiler though) |
| 03-04-2008, 04:55 PM | #2 |
Well, we all use the map optimizer so having inline syntax on the jasshelper level might not be neccessary; it's not a bad idea, though. I just noticed vJass globals get declared prior to some map-specific handles, like bj_mapInitialPlayableArea. I tried doing this: JASS:globals private real minX = GetRectMinX(bj_mapInitialPlayableArea) private real maxX = GetRectMaxX(bj_mapInitialPlayableArea) private real minY = GetRectMinY(bj_mapInitialPlayableArea) private real maxY = GetRectMaxY(bj_mapInitialPlayableArea) endglobals |
| 03-04-2008, 09:29 PM | #3 | ||
Quote:
No. bj_mapInitialPlayableArea is declared before such globals. But initBlizzard initializes it. There is no way to have map bounds in a rect just during globals declarations, so you are forced to init variables dependant on bj_mapInitialPlayeableArea manually. Quote:
|
| 03-04-2008, 10:08 PM | #4 | |||||
Quote:
Quote:
(It was actually playable after that... )Quote:
Quote:
Quote:
I'm quite satisfied with what I got now. |
| 03-05-2008, 12:36 AM | #5 |
more than 8190 functions: no more than 60000 handle ids: potentially bad if you're I2Sing them but I have no data {}: Any progress/anything you can implement on the inlining front is not lame. |
| 03-05-2008, 04:05 AM | #6 |
more than 8190 functions: no more than 60000 handle ids: only on cohadar's test maps. I've done a couple of test spells with magic timers, but I haven't used them for anything serious. Don't have any opinions about using {} other than I would prefer using for control statements, as in void test() { if (true) {} } But I'm fairly sure that wouldn't be worth the effort. |
| 03-05-2008, 05:41 AM | #7 |
8190 functions : how we count the number of function in the map anyway... -.-" Well for the magic timer, it just don't works as expected in my map (maybe is my fault anyway) but thanks to its idea of using linked list, i got a pretty good idea of doing things in the data structure way :) and the {} syntax... well i think it is okay... looks cool and C++-ish... |
| 03-05-2008, 07:08 AM | #8 |
what about JASS:globals integer array MyArray = { 2, 5, 8, 5} endglobals |
| 03-05-2008, 08:03 AM | #9 | |
Quote:
Extract war3map.j from your map (with mpqmaster) then you open it in some text editor and do a global replace of keyword function with something else. After it is done the editor says: "replaced 1530 instances of function"... |
| 03-05-2008, 12:34 PM | #10 | |
Quote:
|
| 03-05-2008, 01:00 PM | #11 | |
Quote:
I suggest to do it with "takes" or "returns" because function can be used in timers for instance. I'll do my test with my map to see how much code it has. |
| 03-05-2008, 01:14 PM | #12 |
Hey, 647 functions in DoE. I wouldn't worry about 8190, I'd bet any map with that many functions has more problems than worrying about its function count. :p I actually like what Midiway suggested, although I use programming at my job more in engineering applications, so I have different requirements, so maybe it wouldn't be useful in WC3. I'd probably use square brackets. JASS:globals real Test = 12.934 integer array Numbers = [2, 4, 6, 8] real array Numbers2 = [Test, 2*Test, 4., Test/2] //Maybe some array multiplication! //The dot signifies all matrix elements get multiplied by corresponding ones in second matrix. real array Numbers3 = Numbers.*Numbers //Numbers3 would now be [4, 16, 36, 64] //Conversely, division and stuff would work with the dot-syntax. real array Numbers4 = Numbers3./Numbers //Numbers 4 should now equal Numbers, [2, 4, 6, 8] endglobals struct MyStruct //Actual matrix multiplication, inversion, etc. would be useless because jass only supports 1-D arrays, so no need for that. //But this notation might also have applications in structs too. real a = 12. real b = 4. endstruct function ObligatoryFunction takes nothing returns MyStruct local MyStruct data1 = MyStruct.create() local MyStruct data2 = MyStruct.create() return data1.*data2 //This would return a MyStruct with a = 144 and b = 16 endfunction |
| 03-05-2008, 02:53 PM | #13 |
I oftentimes wish it was easier to manipulate things like structs on a lower level. what If I wanted to insert code into the struct algorithm itself, or to make code that directly changes a value of one of the variables used in the struct system? I understand that I could just do this myself, but if it wouldn't be too difficult, an option for viewing the variable and function names used for VJASS syntax would be very convenient. |
| 03-05-2008, 03:36 PM | #14 |
Dusk, that's hard mostly because it happens during globlas declarations. It is possible I would add operator declaring for +,*,-,/ which in a way would allow you to do that stuff. But I may not do it. There's a little problem right now with my Jass grammar in which it totally ignores operator precendence... I actually have made a matrix struct which supports adition, product and power, totally out of boredom, when I go back to home I might find my .j file and try to release it... |
| 03-05-2008, 08:08 PM | #15 |
add ++,-- += -= etc ? ^^ and imho the func body could looks like in C/C++ etc. integer MyFunc (integer lol,string xD){ ... call doingmyshithere() ... } but well it's a suggestion if you not have what to do xD 60000 handles may happen... 8K is a bit too much imho. (so "it's save") ~10K of vars/arrays is possible =) |
