• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,533
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,
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
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