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

===Formula Thread===

Status
Not open for further replies.
Level 29
Joined
Mar 10, 2009
Messages
5,016
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
 
Level 12
Joined
Aug 12, 2008
Messages
349
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