- Joined
- May 11, 2012
- Messages
- 2,108
can someone give me a detailed explanation on how to turn the regular spell into MUI?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hashtable - Save 100 as 0 of 0 in someHashtable
Set someHashtable[0][0] = 100
Actions

Hashtable - Create a hashtable

Set someHashtable = (Last created hashtable)
Hashtable - Save 100 as 0 of 0 in someHashtable
Actions

Set handleId = (Key (Triggering unit))

Hashtable - Save spellDamage as 0 of handleId in someHashtable
Actions

Set handleId = (Key (Triggering unit))

Hashtable - Save 0.00 as handleId of 0 in (Last created hashtable)

Unit Group - Add (Triggering unit) to spellGroup
Actions

Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)


Loop - Actions



Set handleId = (Key (Picked unit))



Set spellDamage = (Load handleId of 0 from someHashtable)
Hashtable - Clear all child hashtables of child handleId in someHashtable
Init

Events


Map initialization

Conditions

Actions


Hashtable - Create a hashtable


Set spellHashtable = (Last created hashtable)
Init Spell

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


-------- === Setup Spell Data === --------


Set tempUnitType = Footman


Set tempReal = 10.00


-------- === End Setup === --------


Set tempLoc = (Position of (Triggering unit))


-------- Create the summoned unit --------


Unit - Create 1 tempUnitType for Player 1 (Red) at tempLoc facing Default building facing degrees


-------- Save data --------


Set handleId = (Key (Last created unit))


Hashtable - Save tempReal as 0 of handleId in spellHashtable


-------- Add unit to group --------


Unit Group - Add (Last created unit) to spellSummonGroup


-------- This is an integer I use to track the amount of instances running --------


-------- Because the loop-trigger does not need to be running when there is no instance --------


Set spellSummonCount = (spellSummonCount + 1)


-------- Start Loop --------


Trigger - Turn on Loop Spell <gen>
Loop Spell

Events


Time - Every 0.10 seconds of game time

Conditions

Actions


-------- === Trigger initially off === --------


Unit Group - Pick every unit in spellSummonGroup and do (Actions)



Loop - Actions




-------- Retrieve data --------




Set handleId = (Key (Picked unit))




Set tempReal = ((Load 0 of handleId from spellHashtable) - 0.10)




-------- Check if time is over --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






tempReal Less than or equal to 0.00





Then - Actions






-------- Time is over, clear everything --------






Hashtable - Clear all child hashtables of child handleId in (Last created hashtable)






Unit Group - Remove (Picked unit) from spellSummonGroup






Unit - Remove (Picked unit) from the game






Set spellSummonCount = (spellSummonCount - 1)





Else - Actions






-------- There is still some time left, save the new time --------






Hashtable - Save tempReal as 0 of handleId in spellHashtable


-------- Check if there are any instances left --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




spellSummonCount Equal to 0



Then - Actions




-------- No instances left, turn off this trigger --------




Trigger - Turn off (This trigger)



Else - Actions
Actions

Hashtable - Save realDamage as (Key FireballDmg) of handleId in spellHashtable

Hashtable - Save realDistance as (Key FireballDistance) of handleId in spellHashtable
Huh? MUI stands for multi unit instanceability, so every unit needs to carry its own data in order to not affect the other ones, so reserve memory space for each unit and assign it to it.
MUIness is no topic if you store the data sencefully where it belongs to from the beginning.
Ohh, this again? Really?dont use hashtables they cause fatal errors one some computers instead use jnpg and make your own globals to store everytihng
Face it, they forced me to use a system called "Unit Indexer" to make my systems approvable, if I use Hashtable, it is "bad approach" because apparently Indexing > Hashtable in terms of speed.Ohh, this again? Really?
Post.
Thread.
You've got to come with pretty hard evidence to make me believe what you claim, as I (as said the thread above) have never encountered anything wrong with hashtables.
Besides, every time you talk bad about hashtables, it's very vague. What do you have against hashtables that you try your best to convince people who aren't familiar with them to not use those?
no no it has nothing to do with speed my current theory is that a hashtable sometimes tries to overwrite memory addresses used by the game which contain leaked handles thus you get the notorious "memory could not be read/written" fatal error that is just a theory of course but one thing is certain for me: i have had many maps crash because of hashtable systems, right after i delete the system triggers the crash stops occurring
Really? That sucks.Face it, they forced me to use a system called "Unit Indexer" to make my systems approvable, if I use Hashtable, it is "bad approach" because apparently Indexing > Hashtable in terms of speed.
I just said, Well, it is fast to my eyes, does it do the same to you ? every time.
Defskull already gave a proper answer to this.no no it has nothing to do with speed my current theory is that a hashtable sometimes tries to overwrite memory addresses used by the game which contain leaked handles thus you get the notorious "memory could not be read/written" fatal error that is just a theory of course but one thing is certain for me: i have had many maps crash because of hashtable systems, right after i delete the system triggers the crash stops occurring
We're talking GUI here.not sometimes but it will always overwrite if you use the same handleID again but not destroying the old pointer (like locations)...
if you have more than 255 HT, it will not work, in vJass, Tables are there for us to use nearly unlimited # of instances, I call it virtual hashtable, wihout any conflict...
Depends on how you use it, a spell without saving should use UnitIndexer or DynamicIndexing, but I recommend UnitIndexer, else use Hashtables...
I made a trigger to support SUMI by making each dummy unit to hold data ;pAnd if you do it right, hashtables can make any system or spell SUMI, so that shouldn't be a problem either.
possible to 1 user, not possible if he's importing spells or systems with hashtable usage from different users coz for sure they will initialize HT on their own...Besides, I always encourage people to use only 1 hashtable for all systems.
That is true.possible to 1 user, not possible if he's importing spells or systems with hashtable usage from different users coz for sure they will initialize HT on their own...
One does not simply initiate discussions with such topics.
