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

[vJASS] [Solved] Is "map-specific code" section safe to use?

Level 3
Joined
Feb 11, 2024
Messages
22
It's the section that appears when you click at the map itself in the trigger editor.


aa.png



Like this, I want to use grp and UnitAlive in many other spell triggers in order to enum using first of group loop and filter alive units.
(AFAIK using just one group variable for many spells is safe if you use first of group loop)

Thanks in advance!
 
Yes, it is safe in the context of JASS/vJASS. It is at most as safe as GUI triggers, conditions and actions, given that GUI does insulate the user from syntax errors that working directly in JASS/vJASS might entail.

In your map script, UnitAlive should NOT be declared as a custom function, since it is already defined as one of the exported functions or natives (think of natives as functions which are already defined/provided by Blizzard). You can declare UnitAlive like this:

native UnitAlive takes unit id returns boolean
 
Level 3
Joined
Feb 11, 2024
Messages
22
@MyPad,

Thanks for the reply. Didn't know that there was native function for cheking alive function.

And for the first part, I'm noob so I can't really read between the lines... I think you're saying that it is safe right?
Unless I mess up somewhere by using another grp forgetting that I used it already.
 
Top