• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Does JASS support global structs/classes?

Status
Not open for further replies.
Level 4
Joined
Nov 23, 2007
Messages
113
I've searched many tutorials etc and never found structs as a defined type in JASS. Although I've seen a few threads showing examples and discussing them but I have no idea in what context those structs are used.

I could certainly make use of them in my triggers and global functions so if someone could answer a few questions, I'd appreciate it:

1. Where do you define gobal structs? They aren't available as a type in the WE trigger editor, and I get errors when trying to define them in in the main script file (where you put global functions available to all triggers).

2. Can you create an array of structs?

Any info would be great. Thanks
 
Level 11
Joined
Feb 18, 2004
Messages
394
Structs and all of the functionality broght via vJASS (an extension to the JASS language) is done by compiling vJASS code containing things such as structs down to raw JASS code. (implimenting OOP, function interfaces, ext. in JASS) The vJASS manual can be found at: http://wc3campaigns.net/vexorian/jasshelpermanual.html

Link to get JASS NewGen in my sig. (A Grimoire-based world editor hack that causes JASSHelper (the vJASS compiler) to be run automagically on a map during save. It edits the WE's code in memory, meaning it doesn't overwrite any default WC3 files.)
 
Level 4
Joined
Nov 23, 2007
Messages
113
Great stuff. Many thanks, guys. I was really a bit turned off by the lack of robustness of JASS as a language (when you're so used to OOP) but vJASS looks like it will open a lot of options that were very tedious to do with just JASS.

Thanks again.
rep++++++++++++++++++++++++++++++++++++
:)
 
Status
Not open for further replies.
Top