Discussion Globlas? No?

Chaos_Knight

New Member
I started to think about this thing for some days ago.

When you guys do spells for your own maps, do you use globals, or direct values?
Same for the vJASS. Are you making your spells too complicated? Using methods and structs[What the hell.. :p]?

When i do my spells, i peronally dont use globals.
And i dont complicate my spells.

Thanks

//Chaos_Knight
 

saw792

Is known to say things. That is all.
When i do my spells, i peronally dont use globals.
And i dont complicate my spells.
The reason you don't use globals is probably because you aren't making complex spells. Once you start coding more complex things global constants are almost essential as far as testing and debugging goes. It is so much easier to modify one value at the top of your code than trawl through ten or fifteen function replacing every instance of a repeated value to make sure it works for all situations.

Pretty much every time I create something complicated I start declaring global constants at the top of the script and commenting them. It's just impossible to understand your code after you've written it if it isn't set out properly/well commented.
 

BlackRose

Forum User
The reason you don't use globals is probably because you aren't making complex spells. Once you start coding more complex things global constants are almost essential as far as testing and debugging goes. It is so much easier to modify one value at the top of your code than trawl through ten or fifteen function replacing every instance of a repeated value to make sure it works for all situations.

Pretty much every time I create something complicated I start declaring global constants at the top of the script and commenting them. It's just impossible to understand your code after you've written it if it isn't set out properly/well commented.
:thup:
 

tooltiperror

Super Moderator
Staff member
It also more user friendly to use the globals. Especially if your spell has a lot of levels.
 

Viikuna

No Marlo no game.
When making and balancing a map, you will end up changing your spells damage and other values, which means that youll have to either edit your constant globals, or search those values from the spell code every single time.


People write those configuration header thingies for a reason. You can of course do it in the hard way if you want. Thats your problem.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Perhaps you anti it currently, but you will know the disadvantages of not declaring them as you code more on map.
 
Personally I can't make a single script without globals... They're just necessary for everything that will most likely not stay constant throughout your map updates.
 

Tyrulan

Ultra Cool Member
We use what are called local globals. These are variables declared within trigger scope but not accessible by other triggers.

JASS:

globals
        private constant integer ABILITY_ID = 'A000'
        private constant integer MAX_UNITS = 10
endglobals


That is the idea anyway. By doing this there are no conflicts with handle names.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    what is this Ghan? https://enterprise.ghannet.com/ you are totally holding out on us my friend
  • Ghan Ghan:
    Not mine, I just ran the server. They let the domain expire but it was a cool project so I kept it alive there.
  • Ghan Ghan:
    Used to be enterpriserpg.com I think.
  • The Helper The Helper:
    If you go to the world editor tutorials site and click the starcraft link it takes you there :)
  • Ghan Ghan:
    lol
  • Ghan Ghan:
    I forgot about that alias name. (The full URL still went to the correct site.) That should be fixed.
  • Ghan Ghan:
    Silkroad Forums site really needs help.
  • Ghan Ghan:
    Its software has been out of support since 2017.
  • Ghan Ghan:
    The woes of using custom styles....
  • The Helper The Helper:
    does anyone still use silk road forums?
  • Ghan Ghan:
    It's about as active as here I'd say. Not much going on.
  • Wizard Wizard:
    I think it doesn't help that the silk road game isn't as popular any more I think. The only MMO I play these days is FFXIV like most other people I know.
  • The Helper The Helper:
    I checked a status page for players and it says the game has 500 daily players.
  • The Helper The Helper:
    I cannot believe that site is still going I wonder if Ryoko is involved with it at all would love to talk to him again and see what he is up to
  • The Helper The Helper:
    my oldest daughter failed her driving test today for her license she is 22 and yes I have been driving her everywhere her whole life
  • The Helper The Helper:
    Now they are blaming me on Facebook for her failure LOL I am accepting it because it is my failure I am her driving teacher even though she had certified driving instruction from the best place in town I for some reason cannot teach her how to drive this is frustrating
  • jonas jonas:
    I didn't get my license until I was 25
    +1
  • The Helper The Helper:
    Back in the old days when I was getting a license people were getting them at 16 yrs old and many were getting hardships so they could get them earlier. Almost nobody did not drive when they were able. Nowadays though....
  • Ghan Ghan:
    Why drive when there's Uber Eats?
    +2
  • The Helper The Helper:
    I hope Varine is OK have not heard from him in a while.
    +1
  • Ghan Ghan:
    Diablo 2 Resurrected launching in 9 days.
  • The Helper The Helper:
    Just got a new to me computer hope it will run it
  • jonas jonas:
    I would buy if it had better modding support than D2, like a small lua script engine or much less hardcoded stuff
  • Ghan Ghan:
    Lots of folks are upset that they aren't supporting mods.

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top