• 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] 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