• 🏆 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!

[Trigger] Hashtable spell

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
349
I just involved in hashtable spell making recently and I'm still not really sure how to use it yet as it seems quite different from indexing.
Here's my first spell using hashtable for my map. I just want to ask whether if it's the correct usage of hashtable.

Passive Ability
Nerothos becomes overheat after receiving several attacks from enemies. Due to overheat, Nerothos releases the raging flame to surroundings, dealing 100 damage to all nearby enemies.
Level 1: 8 attacks
Level 2: 7 attacks
Level 3: 6 attacks
Level 4: 5 attacks
Level 5: 4 attacks
Upgrading this ability during the half way of storing charges of overheat may reset


[trigger=Overheat learns]
Overheat learns
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Overheat
Actions
Set O_charges = 0
Set tempUnit = (Triggering unit)
Set O_level = (Level of Overheat for tempUnit)
Set O_maxCharges = (9 - O_level)
Custom script: set udg_O_key = GetHandleId (udg_tempUnit)
Hashtable - Save O_charges as 1 of O_key in Hashtable
Hashtable - Save O_maxCharges as 2 of O_key in Hashtable
[/trigger]
[trigger=Overheat]Overheat
Events
Game - GDD_Event becomes Equal to 0.00
Conditions
(GDD_DamagedUnit has buff Overheat ) Equal to True
Actions
Custom script: set udg_O_key = GetHandleId (udg_GDD_DamagedUnit)
Set O_charges = ((Load 2 of O_key from Hashtable) + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
O_charges Equal to (Load 3 of O_key from Hashtable)
Then - Actions
Set O_charges = 0
Set tempPoint = (Position of GDD_DamagedUnit)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 325.00 of tempPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and ( and do (Actions)
Loop - Actions
Set tempPoint2 = (Position of (Picked unit))
Unit - Cause tempUnit to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at tempPoint using Abilities\Spells\Other\Doom\DoomDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint2)
Custom script: call RemoveLocation (udg_tempPoint)
Else - Actions
Hashtable - Save O_charges as 2 of O_key in Hashtable
[/trigger]


Don't mention about the part of creating hashtable. I did it in the map initialisation.
 
Last edited:
Level 11
Joined
Nov 15, 2007
Messages
781
This spell isn't MUI the way you have it set up. If you don't need this spell to be MUI, it really only needs a single variable, the hashtable is unnecessary. And you're creating the special effect at center of playable map area. Other than that I don't see anything that would prevent it from working as intended.
 
Level 12
Joined
Aug 12, 2008
Messages
349
It's my first time too to use the damage detection >< .. Is it only to use the damage detection only? because I not sure whether the damage detection detects incoming spell damage..

How do I deals the damage if I didn't save the unit? Arghh... hashtable is so complicated T-T

EDIT: Updated the triggers a bit. Are there what you mean, sir? *confused state*
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Remove this: Hashtable - Save Handle OftempUnit as 1 of O_key in O_hashtable
You have the charges already in a variable: (Load 2 of O_key from O_hashtable) Equal to (Load 3 of O_key from O_hashtable)
You're not removing tempPoint or tempPoint2
Delete the first "save charges" action in Overheat. Make the second "save charges" action the last action in the trigger, take it out of the if/then/else
 
Status
Not open for further replies.
Top