Snippet PreventSave

Romek

Super Moderator
Reaction score
963
The fact that the non-constant global which users are meant to modify is in all capitals is indeed misleading.
I also assumed it was a constant simply by the name of it.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
what, change it to constant or change to non-capitals?

I personally think it's fine, if someone really wanted to toggle saving in their map, they probably would look through the code and realise that it is not a constant.
 

Jesus4Lyf

Good Idea™
Reaction score
397
They also prefix all user variables with udg_, but we don't...
And you're right, for example they have an array named [LJASS]bj_ghoul[/LJASS].
But it is problematic for us, because one-word global variables would take on the same name accidentally as a local variable, so we uppercase the first letter of each word including the first one these days...

For example, if you had to store a unit in a global temporarily for a [LJASS]ForGroup[/LJASS] call, let's say you'd call the unit [LJASS]Unit[/LJASS] or [LJASS]Hero[/LJASS] (or something). Without the convention we use, it would be [LJASS]unit[/LJASS] (which is a type keyword) or [LJASS]hero[/LJASS] (which could conflict with a local variable or parameter). So we don't follow Blizzard's stuff on this one - the reason is we don't follow their udg_ stuff (with which this wouldn't occur...).
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
> From what I've seen, blizzard names their globals like this;
bj_variableName.

Yes, that's correct from what I've seen in Blizzard.j
 

black.sheep

Active Member
Reaction score
24
Works, I think... Someone left when I did it thou, but that might be cuz they were a dick.
Shall try again.

Okay, I think it might crash macs, but apart from that it will work.
 

Weep

Godspeed to the sound of the pounding
Reaction score
401
Works fine in single-player and on BNet (one player), from what I can tell.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top