• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Hashtable: Location is not saved correctly

Status
Not open for further replies.

Skyfire

S

Skyfire

Hi.

I'm working on some small triggers, which should order a unit to move to its spawnpoint if it runs to far away from his spawnpoint (greater than 1000).
So I tryed to save the locationhandle of units when they enter the map in my hastable.

I made some function to show where the stored location is and find out that it is not saved correctly. After hours of testing and searching for the reason why my saved loaction isn't identical with the units location I'm asking you for help.

  • MonsterStoreLoc
    • Ereignisse
      • Einheit - A unit enters (Playable map area)
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Owner of (Triggering unit)) Gleich Spieler 12 (Braun)
          • (Owner of (Triggering unit)) Gleich Spieler 9 (Grau)
      • ((Triggering unit) has buff Unverwundbar) Gleich False
    • Aktionen
      • Hashtabelle - Save Handle Of(Position of (Triggering unit)) as (Key Loc) of (Key (Triggering unit)) in MonsterHash
      • Video - Ping minimap for (All players) at (Load (Key Loc) of (Key (Triggering unit)) in (MonsterHash)) for 1.00 seconds, using a Einfach ping of color (100.00%, 0.00%, 0.00%)
      • Video - Ping minimap for (All players) at (Position of (Triggering unit)) for 1.00 seconds
If you need more information ask for it.

Thank you for help,
Skyfire

Edit: Position will be still wrong :(
Added triggers, which I forgot:
  • MonsterReactionOnDamage
    • Ereignisse
      • Spiel - GDD_Event becomes Gleich 0.00
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Owner of GDD_DamagedUnit) Gleich Spieler 12 (Braun)
          • (Owner of GDD_DamagedUnit) Gleich Spieler 9 (Grau)
    • Aktionen
      • Custom script: set bj_wantDestroyGroup = true
      • Einheitengruppe - Pick every unit in (Units owned by (Owner of GDD_DamagedUnit) matching ((Matching unit) Gleich GDD_DamagedUnit)) and do (Actions)
        • Schleifen - Aktionen
          • Set MonsterTempLoc = (Load (Key Loc) of (Key (Picked unit)) in MonsterHash)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Distance between MonsterTempLoc and (Position of GDD_DamagedUnit)) Kleiner gleich 600.00
          • (Current order of GDD_DamagedUnit) Gleich (Order(<Leerer String>))
        • 'THEN'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (GDD_DamageSource has buff Unverwundbar) Gleich True
            • 'THEN'-Aktionen
              • Einheit - Order GDD_DamagedUnit to Angreifen/Bewegen nach (Position of Hero[(Player number of (Owner of GDD_DamageSource))])
              • Spiel - Display to (All players) the text: Order Attack (Hero)
            • 'ELSE'-Aktionen
              • Einheit - Order GDD_DamagedUnit to Angreifen/Bewegen nach (Position of GDD_DamageSource)
              • Spiel - Display to (All players) the text: Order Attack (Sourc...
        • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Distance between MonsterTempLoc and (Position of GDD_DamagedUnit)) Größer gleich 1000.00
            • 'THEN'-Aktionen
              • Einheit - Order GDD_DamagedUnit to Bewegen nach MonsterTempLoc
              • Spiel - Display to (All players) the text: Order Back (OnDamag...
            • 'ELSE'-Aktionen
      • Custom script: call RemoveLocation (udg_MonsterTempLoc)
  • MonsterReactionOnAttack
    • Ereignisse
      • Einheit - A unit Wird angegriffen
    • Bedingungen
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Owner of (Attacking unit)) Gleich Spieler 12 (Braun)
          • (Owner of (Attacking unit)) Gleich Spieler 9 (Grau)
    • Aktionen
      • Einheitengruppe - Pick every unit in (Units owned by (Owner of (Attacking unit)) matching ((Matching unit) Gleich (Attacking unit))) and do (Actions)
        • Schleifen - Aktionen
          • Set MonsterTempLoc = (Load (Key Loc) of (Key (Picked unit)) in MonsterHash)
          • Spiel - Display to (All players) the text: (Unit which is used for Loc + (Name of (Picked unit)))
          • Video - Ping minimap for (All players) at (Position of (Picked unit)) for 1.00 seconds, using a Einfach ping of color (100.00%, 0.00%, 0.00%)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Distance between MonsterTempLoc and (Position of (Attacking unit))) Größer gleich 1000.00
        • 'THEN'-Aktionen
          • Einheit - Order (Attacking unit) to Bewegen nach MonsterTempLoc
          • Spiel - Display to (All players) the text: (Order Back (OnAttack) Distance: + (String((Distance between (Position of (Attacking unit)) and MonsterTempLoc))))
          • Video - Ping minimap for (All players) at MonsterTempLoc for 1.00 seconds, using a Einfach ping of color (100.00%, 100.00%, 100.00%)
        • 'ELSE'-Aktionen
      • Custom script: call RemoveLocation (udg_MonsterTempLoc)
Edit2: Ignore pings and text messages.
 
Last edited by a moderator:
Can you see some other misstakes which really effect location?
 
Yes:
  • MonsterHash
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Hashtabelle - Create a hashtable
      • Set MonsterHash = (Last created hashtable)
 
So the Event of "giving the Warning message to the player owning the unit" occurs onAttack and onDamamge ?

I would do with interval of 0.03 (1.00 can still be acceptable) checking the distance of each loaded starting location.
If its distance > maxDistance, order the unit to move to startingLocation.

Can the unit moved instantly to startingLocation or do you still want to order the unit to move naturally ?
 
I thought about a permanent loop. Maybe i change it, if i need it. But the problem would be the same: Location is not correct.
And i want the unit to move naturally back.

Edit:
How to set/get coordiantes?
Can you post an example for GUI?
 
Improvment is good for me, anyway thanks i will check your map tomorrow.
Good Night.
 
Status
Not open for further replies.
Back
Top