| 11-21-2007, 10:31 PM | #1 |
After reading and searching thru the Scripts and Trigger section for sometime now, i noticed an interesting extension to JASS you guys are using called vJass. Wanting to learn it, i went thru the vJass for Spell Makers, Textmacros in vJass, How to Properly Inline Stuff, Create a New Object Type [vJass], and Scopes tutorial. I also read the readme.txt for JASSHelper. During my reading and searching, i came upon this interesting thread: http://www.wc3campaigns.net/showpost...67&postcount=4. Here are my questions:
To me, vJass's struct looks like a clever way to use globals to pass multiple data under a single variable type to another function. So, i'm curious, how do you guys do it from Jass? |
| 11-21-2007, 11:07 PM | #2 |
The jass code that the guy posted is incomplete where he put the ... in his example. You can check out easily how it works by writing a small vJass script, compiling it with JassHelper and then opening war3map.j (which then contains the compiled jass) in a text editor. |
| 11-22-2007, 01:49 AM | #3 |
Thanks! just what i was looking for. Funny, making a test vJass Script didn't seem to work the first time i tried it..., but then again, that was with a certain third party program. |
| 11-22-2007, 02:07 AM | #4 |
The basic idea is you have parallel arrays which you parcel out an index at a time. To recycle indices, you push them onto a stack. When you allocate a new struct you first try to pop that stack before creating a new index. |
| 11-22-2007, 03:04 AM | #5 |
well but that is just for struct. :P vJass is a tool for the lazy jassers :P But also keep things more readable and organized |
| 11-22-2007, 10:15 AM | #6 |
structs and global declaration are nice ^^ (structs allows to short the code (while typing it) and it's imho very handy) |
