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

===Formula Thread===

Status
Not open for further replies.
OK if you want a formula/pattern, here's a formula for Hashtable usage...

You may:
1. Ceate your own event
2. Replace the footman to a dummy unit
3. Change the duration timer and loop timer


  • Timer
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Set Loc = (Position of (Triggering unit))
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Loc facing Default building facing degrees
      • Set Dummy = (Last created unit)
      • Set ID = (Key (Last created unit))
      • Custom script: call RemoveLocation(udg_Loc)
      • Hashtable - Save 10.00 as 1 of ID in Hash
      • Unit Group - Add Dummy to UGrp
      • Trigger - Turn on Timer Loop <gen>
  • Timer Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UGrp and do (Actions)
        • Loop - Actions
          • Set Dummy = (Picked unit)
          • Set ID = (Key (Picked unit))
          • Set Timer = (Load 1 of ID from Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Timer Greater than 0.00
            • Then - Actions
              • Hashtable - Save (Timer - 1.00) as 1 of ID in Hash
              • Floating Text - Create floating text that reads (String(Timer)) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            • Else - Actions
              • Unit - Add a 0.01 second Generic expiration timer to Dummy
              • Unit Group - Remove (Picked unit) from UGrp
              • Hashtable - Clear all child hashtables of child ID in Hash
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (UGrp is empty) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: TRIG OFF
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
mckill2009, I face a problem in saving the Multi Shot ability that you made in vJASS in my map.
The syntax errors checks that there's a compile error in the line 625: Member redeclared : onInit and line 761: (From this instance)
Any way to solve it?

you redeclared something inside the module, so remove it...
 
Level 12
Joined
Aug 12, 2008
Messages
350
I don't know how to show the whole code because the syntax error checking show the whole code of my map; but I got this (the below script is highlighted)
Line 605: Member redeclared: onInit
JASS:
    private static method onInit takes nothing returns nothing

Line 741: From this instance
JASS:
    implement MultiShot__Init

The errors above occur before I change anything. What I did is just import the whole folder from the MultiShot - vJASS.w3x and then pasted it in my map then I moved the trigger T32x and MultiShot to above folder which I catergorised in Heroes then remove the useless folder that I imported along.
 
Status
Not open for further replies.
Top