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

[GUI] Generic usage in MUI spells Global Variables

Status
Not open for further replies.
Level 4
Joined
Feb 17, 2008
Messages
67
Hello these past few days i have been trying to understand the basic mechanics of making MUI spells.I have read the hashtable guide provieded by wyrmlord and Jazztastic and i have a few basic questions.
I have read that every variable declared via trigger editor > variables is a global variable thus using 2 variables declared in this way in 2 basic functions can cause 1 set to be overwritten.
My questions are :
- how dose one solve this problem with overwriting variables for example in a MUI function that picks all units in a group and for every picked unit data is imported from an hashtable and saved in variables (global variables)... won't this cause just 1 set of information,probably latest added in the group, to be used for all of the picked units from the group?
I'd like to know how most people deal with this problem..
-and about hashtables when saving an handle key ...if one saves a handle as a key in one hashtable(1) will the key be the same if the same handle be saved in a diffrent hashtable(2)? ..like key_handle (hash1) == key_handle (hash2)
-i presume when saving variables under key handles in hashtables in order to retrieve them latter the point of the key is to be unique.. if units can be identified uniquely (key (event..triggering unit)) are positions/points unique enough?
Hope i was clear enough ..thanks for reply in advance
 
Hi Anbu,

Please excuse me for not actually answering your questions. I just wanted to let you know that you are dealing with some things now in the world editor that are quite difficult to do in GUI. 99% of users who create complex MUI spells and systems do it solely in vJass.

Your questions have simple explanations in vJass, but I don't know how to go about answering you with respect to GUI since I didn't even learn these concepts myself until much after I learned vJass.

Cheers and good luck,
 
Anbu, each unit has a unique "key" value. So if you assign "100" as "0" of "(Key(Unit1))", that will store 100 specifically for that unit. If you assign "200" as "0" of "(Key(Unit2))", that will store 200 specifically for that unit.

I disagree with Cokemonkey11. A lot of GUI guys use Hanky's Dynamic Indexing because that is the best GUI indexing system around. http://www.hiveworkshop.com/forums/spells-569/gui-dynamic-indexing-template-144325/
 
Level 4
Joined
Feb 17, 2008
Messages
67
Thank you for replying
CodeMonkey I'd rather continue working in GUI for the time being, from what i know Jass takes a bit of getting used to and I kind of lack the time/patience at the moment thanks thou,


Bribe I understand and agree, just one more thing do you know if there is any risk of losing the unit's key as in the unit gets destroyed and the key loses its purpose?When exactly is a unit's ID/key cleared (unit dies/unit -expire function..remove unit)?
Thanks by the way for the link to Dynamic Indexing Template this system is extremely useful and it seems to solve my problem completely, i am trying to understand it right now.
 
Status
Not open for further replies.
Top