• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Saving a unit group in a hashtable

Status
Not open for further replies.
Level 9
Joined
Dec 6, 2007
Messages
233
Possible? I found a function that was save Unitpool handel, but it doesn't seem to be working. Or the issue could be that the units aren't being saved. Here is the trigger:

  • Upon Cast
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Force Of Nature Gone Awry
    • Actions
      • Set Temp_Loc = (Target point of ability being cast)
      • Hashtable - Save Handle Of(Units within (((Real((Level of Force Of Nature Gone Awry for (Triggering unit)))) x 75.00) + 75.00) of Temp_Loc) as Trees of (Key (Triggering unit)) in Troubled_Treant_Hash
      • Hashtable - Save Handle OfTemp_Loc as Ability_Target of (Key (Triggering unit)) in Troubled_Treant_Hash
      • Hashtable - Save 0 as Timer_Tick of (Key (Triggering unit)) in Troubled_Treant_Hash
      • Unit Group - Add (Triggering unit) to First_Stage
      • Custom script: call RemoveLocation(udg_Temp_Loc)
It starts out as force of nature, so it creates a bunch of summons. I'm trying to save all of those summons in a unit group hashed to the caster, then load them later in this trigger segment:

  • Unit Group - Pick every unit in (Load Trees of (Key (Picked unit)) in Troubled_Treant_Hash) and do (Actions)
    • Loop - Actions
      • Set Temp_Loc = (Position of (Picked unit))
      • Unit Group - Add (Picked unit) to Flying_Trees_Up
      • Unit - Create 1 JetFire for (Owner of (Picked unit)) at Temp_Loc facing Default building facing degrees
      • Game - Display to (All players) the text: POW
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Hashtable - Save Handle Of(Last created unit) as Fire of (Key (Picked unit)) in Troubled_Treant_Hash


Something is causing these units to not be saved properly, or not be loaded properly, or WHATEVER, because that little debug line in the second bit (the "POW") never shows up in game. Any help would be appreciated.
 
Level 9
Joined
Dec 6, 2007
Messages
233
No offense, but if can't help me with my current, pressing, issue, why did you post? I really don't want to learn jass right now since this is for the zephyr challenge. Although you did prove that it's possible to save a unit group to a hashtable.

EDIT: whoops, i was using "save group handle", not the unitpool one. I just tried unitpool, however, and it was the first time my editor crashed. The odd thing is that this happened right after i read Bribe's statement. Bribe, are you physic?
 
Level 9
Joined
Dec 6, 2007
Messages
233
Didn't fix anything. Anywho, I'm reorganizing everything. It seems to have issues saving the summons to any sort of unit group, so I'm going to look at each one separately. This reorganization seems to have made my other trigger fail to save a number to my timer tick, however, so it's still broken.

  • Hashtable - Save ((Load Timer_Tick of (Key (Picked unit)) from Troubled_Treant_Hash) + 1) as Timer_Tick of (Key (Picked unit)) in Troubled_Treant_Hash
That tick gets stuck at 1

Is the hashtable simply bugged? or am i missing something stupid?

EDIT: Problem solved, i made a very silly mistake in another trigger. Thanks anyways bribe (+rep).

EDIT2: whoops, can't +rep, ah well, thanks
 
Last edited:
Status
Not open for further replies.
Top