• 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.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

Not working triggers and missing hair.

Status
Not open for further replies.
Level 13
Joined
Oct 10, 2009
Messages
439
Need help with a Trigger, or else I will go bald! D:

Need help for these both.


At the moment both "DGCreateLoop" and "PBMovement" are not working, and are highlighted in the map.

How are they not working? I dont know, but I can tell you, they are beginning to make me thin up top.

PBMovement is a parabola based trigger, utilising Hashtables and the like, but it has decided to not work as of now. Initially everything gets defaulted to move to the center of the map, and now. After trying to fix it myself, the trigger has now decided to stop working at all.

Please, help me and delve into this map. Solve the parabola problem and the nonresponding 'Point' problem.

http://www.hiveworkshop.com/forums/pastebin_data/pr88bx/_files/Hero.w3x


Your help would be greatly appreciated.

Trigger Regarding Parabola:
  • Ini
    • Events
      • Time - Elapsed game time is 6.00 seconds
    • Conditions
    • Actions
      • Set Point[5] = (Center of Start <gen>)
      • Special Effect - Create a special effect at Point[5] using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Sunderer for Player 1 (Red) at Point[5] facing Default building facing degrees
      • Unit Group - Add (Last created unit) to IniPortal
      • Set PlayerHero[(Integer A)] = (Last created unit)
      • Unit Group - Pick every unit in IniPortal and do (Actions)
        • Loop - Actions
          • Set TempReal[0] = 500.00
          • Set Point[0] = (Position of (Picked unit))
          • Set Point[1] = (Point[0] offset by TempReal[0] towards (Random angle) degrees)
          • Hashtable - Save TempReal[0] as (Key Distance) of (Key (Picked unit)) in Portal
          • Hashtable - Save Handle OfPoint[1] as (Key EndPoint) of (Key (Picked unit)) in Portal
          • Hashtable - Save Handle OfPoint[0] as (Key StartPoint) of (Key (Picked unit)) in Portal
          • Unit - Add Crow Form to (Picked unit)
          • Unit Group - Add (Picked unit) to UG_DD
          • Unit - Turn collision for (Picked unit) Off
          • Custom script: call RemoveLocation(udg_Point[0])
          • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_Point[5])
  • PBMovement
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in UG_DD and do (Actions)
      • Loop - Actions
        • Set TempReal[2] = (Load (Key Distance) of (Key (Picked unit)) from Portal)
        • Set TempReal[6] = TempReal[2]
        • Set TempReal[7] = (TempReal[6] / 2.00)
        • Set TempReal[2] = (TempReal[2] x 0.02)
        • Set Point[0] = (Position of (Picked unit))
        • Set Point[1] = (Load (Key EndPoint) of (Key (Picked unit)) in Portal)
        • Set TempReal[3] = (Angle from Point[0] to Point[1])
        • Set Point[3] = (Point[0] offset by TempReal[2] towards TempReal[3] degrees)
        • Set Point[4] = (Load (Key StartPoint) of (Key (Picked unit)) in Portal)
        • Set TempReal[1] = (Distance between Point[0] and Point[1])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempReal[1] Less than or equal to 5.00
          • Then - Actions
            • Unit - Turn collision for (Picked unit) On
            • Unit Group - Remove (Picked unit) from UG_DD
            • Animation - Change (Picked unit) flying height to 0.00 at 0.00
            • Unit - Remove Crow Form from (Picked unit)
            • Special Effect - Create a special effect at Point[0] using bjects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
            • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Portal
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions
            • Unit - Move (Picked unit) instantly to Point[3]
            • Set TempReal[4] = (Distance between Point[4] and Point[0])
            • Animation - Change (Picked unit) flying height to (((-1.00 / TempReal[7]) x ((TempReal[4] - TempReal[7]) x (TempReal[4] - TempReal[7]))) + TempReal[7]) at 0.00
        • Custom script: call RemoveLocation(udg_Point[0])
        • Custom script: call RemoveLocation(udg_Point[1])
        • Custom script: call RemoveLocation(udg_Point[2])
        • Custom script: call RemoveLocation(udg_Point[3])
Edit: Fixed the not working problem, however. It still moves to "Center of playable map" Other then EndPoint
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
When a location returns null, it will default to center of the map.

The problem is that you're removing the location you store in the hashtable.

  • Ini
    • Events
      • Time - Elapsed game time is 6.00 seconds
    • Conditions
    • Actions
      • // Here you set the locations
      • Set Point[0] = (Position of (Picked unit))
      • Set Point[1] = (Point[0] offset by TempReal[0] towards (Random angle) degrees)
      • // Then you save them in a hashtable
      • Hashtable - Save Handle OfPoint[1] as (Key EndPoint) of (Key (Picked unit)) in Portal
      • Hashtable - Save Handle OfPoint[0] as (Key StartPoint) of (Key (Picked unit)) in Portal
      • // Then you remove the points so they don't exist anymore
      • Custom script: call RemoveLocation(udg_Point[0])
      • Custom script: call RemoveLocation(udg_Point[1])
Don't remove them!

Same thing here:
  • DGCreateLoop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UG_DeathGate and do (Actions)
        • Loop - Actions
          • // You load the point
          • Set Point[1] = (Load (Key EndPoint) of (Key (Picked unit)) in Portal)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Greater than or equal to 1.00
            • Then - Actions
              • // You save the locs for the dummy
              • Hashtable - Save Handle OfPoint[1] as (Key EndPoint) of (Key (Last created unit)) in Portal
              • Hashtable - Save Handle OfPoint[0] as (Key StartPoint) of (Key (Last created unit)) in Portal
            • Else - Actions
              • Unit Group - Remove (Picked unit) from UG_DeathGate
              • // * THIS IS WHERE TO REMOVE THE LOC *
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Portal
          • // Here you remove the loc again even though you might still need them
          • Custom script: call RemoveLocation(udg_Point[0])
          • Custom script: call RemoveLocation(udg_Point[1])
The same goes for PB movement.
 
Level 13
Joined
Oct 10, 2009
Messages
439

Wow, something that simple? Bah!
I thought that it stored the point as a seperate variable in the hash, and so it deosnt matter if it was removed or not.
Anyways, thanks maker. I feel like an idiot >.<

Edit: Wouldnt changing that cause massive leaks because Point[1] is being overridden every 0.3 seconds for every unit in the Unit Group?

Also, this trigger here:
  • Ini
    • Events
      • Time - Elapsed game time is 6.00 seconds
    • Conditions
    • Actions
      • Set Point[5] = (Center of Start <gen>)
      • Special Effect - Create a special effect at Point[5] using Objects\Spawnmodels\Undead\UDeathMedium\UDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Sunderer for Player 1 (Red) at Point[5] facing Default building facing degrees
      • Unit Group - Add (Last created unit) to IniPortal
      • Set PlayerHero[(Integer A)] = (Last created unit)
      • Unit Group - Pick every unit in IniPortal and do (Actions)
        • Loop - Actions
          • Set TempReal[0] = 500.00
          • Set Point[0] = (Position of (Picked unit))
          • Set Point[1] = (Point[0] offset by TempReal[0] towards (Random angle) degrees)
          • Hashtable - Save TempReal[0] as (Key Distance) of (Key (Picked unit)) in Portal
          • Hashtable - Save Handle OfPoint[1] as (Key EndPoint) of (Key (Picked unit)) in Portal
          • Hashtable - Save Handle OfPoint[0] as (Key StartPoint) of (Key (Picked unit)) in Portal
          • Unit - Add Crow Form to (Picked unit)
          • Unit Group - Add (Picked unit) to UG_DD
          • Unit - Turn collision for (Picked unit) Off
          • Custom script: call RemoveLocation(udg_Point[0])
          • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_Point[5])

What am I doing wrong? It still gets defaulted to the center of the map, not a point offset by a random angle. Is it because I am still removing the points?

And, this trigger will not work if I decide to add more then one unit to Iniportal
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,266
Hashtable - Save Handle OfPoint[1] as (Key EndPoint) of (Key (Picked unit)) in Portal
Hashtable - Save Handle OfPoint[0] as (Key StartPoint) of (Key (Picked unit)) in Portal
Unit - Add Crow Form to (Picked unit)
Unit Group - Add (Picked unit) to UG_DD
Unit - Turn collision for (Picked unit) Off
Custom script: call RemoveLocation(udg_Point[0])
Custom script: call RemoveLocation(udg_Point[1])
Why on earth are you storing locations in a hashtable and then removing them....
If you want them removed, dont bother storing them as that causes its own problems and leaks...

Hashtables store the pointer to the location object, thus removing the location will force it to return null at that index (as the handle is no longer in use). the null location is at 0,0 aka the middle of the map.

If you have to store a location, remove it after you no longer need it (it has been used) not after you store it (when it still is needed).
 
Status
Not open for further replies.
Top