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

[Solved] Need help with pathing bug.

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2011
Messages
326
So i am working on a map and ive finished a hero with an ability like in the video. But everytime i click on an place that is not pathable my spells registers the point somewhere out of the map. I dont know how to fix this . Does anyone have any solution. As you can see if i click somewhere that is pathable the spell works just fine.


 
Level 8
Joined
Nov 9, 2011
Messages
326
can you post triggers map or something?
  • Hammer of Justice Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to S_BP_HoJ_Spell
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • S_BP_HoJ_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on Hammer of Justice Loop <gen>
        • Else - Actions
      • Set S_BP_HoJ_Index = (S_BP_HoJ_Index + 1)
      • Set S_BP_HoJ_Caster[S_BP_HoJ_Index] = (Triggering unit)
      • Set S_BP_HoJ_Position[S_BP_HoJ_Index] = (Target point of ability being cast)
      • Set S_BP_HoJ_tempPlayer = (Triggering player)
      • Set HeroAttribute_tempPlayerNumber = (Player number of S_BP_HoJ_tempPlayer)
      • Set S_BP_HoJ_Level[S_BP_HoJ_Index] = (Level of S_BP_HoJ_Spell for S_BP_HoJ_Caster[S_BP_HoJ_Index])
      • Set S_BP_HoJ_tempPoint = (Position of S_BP_HoJ_Caster[S_BP_HoJ_Index])
      • Set S_BP_HoJ_Angle[S_BP_HoJ_Index] = (Angle from S_BP_HoJ_tempPoint to S_BP_HoJ_Position[S_BP_HoJ_Index])
      • Set S_BP_HoJ_tempDamage[S_BP_HoJ_Index] = (S_BP_HoJ_Damage[S_BP_HoJ_Level[S_BP_HoJ_Index]] + HeroAttribute_SpellPower[HeroAttribute_tempPlayerNumber])
      • Custom script: call RemoveLocation (udg_S_BP_HoJ_tempPoint)
      • Set S_BP_HoJ_tempAngle = S_BP_HoJ_Angle[S_BP_HoJ_Index]
      • Set S_BP_HoJ_tempAngle = (S_BP_HoJ_tempAngle + 180.00)
      • Set S_BP_HoJ_tempPoint2 = (S_BP_HoJ_Position[S_BP_HoJ_Index] offset by S_BP_HoJ_SpawnRange[S_BP_HoJ_Level[S_BP_HoJ_Index]] towards S_BP_HoJ_tempAngle degrees)
      • Unit - Create 1 S_BP_HoJ_DummyType for Neutral Passive at S_BP_HoJ_tempPoint2 facing S_BP_HoJ_Angle[S_BP_HoJ_Index] degrees
      • Set S_BP_HoJ_Dummy[S_BP_HoJ_Index] = (Last created unit)
      • Unit - Turn collision for S_BP_HoJ_Dummy[S_BP_HoJ_Index] Off
      • Custom script: call RemoveLocation (udg_S_BP_HoJ_tempPoint2)
      • Set S_BP_HoJ_tempAngle = 0.00
      • Set HeroAttribute_tempPlayerNumber = 0
  • Hammer of Justice Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer S_BP_HoJ_tempInt) from 1 to S_BP_HoJ_Index, do (Actions)
        • Loop - Actions
          • Set S_BP_HoJ_tempPoint = (Position of S_BP_HoJ_Dummy[S_BP_HoJ_tempInt])
          • Set S_BP_HoJ_tempDistance = (Distance between S_BP_HoJ_tempPoint and S_BP_HoJ_Position[S_BP_HoJ_tempInt])
          • Custom script: call RemoveLocation (udg_S_BP_HoJ_tempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • S_BP_HoJ_tempDistance Less than or equal to S_BP_HoJ_MaxDistance
            • Then - Actions
              • Unit - Move S_BP_HoJ_Dummy[S_BP_HoJ_tempInt] instantly to S_BP_HoJ_Position[S_BP_HoJ_tempInt]
              • Set S_BP_HoJ_tempPlayer = (Owner of S_BP_HoJ_Caster[S_BP_HoJ_tempInt])
              • Unit - Kill S_BP_HoJ_Dummy[S_BP_HoJ_tempInt]
              • Special Effect - Create a special effect at S_BP_HoJ_Position[S_BP_HoJ_tempInt] using S_BP_HoJ_Effect
              • Special Effect - Destroy (Last created special effect)
              • Set S_BP_HoJ_tempGroup = (Units within S_BP_HoJ_AoE[S_BP_HoJ_Level[S_BP_HoJ_tempInt]] of S_BP_HoJ_Position[S_BP_HoJ_tempInt])
              • Unit - Create 1 S_GlobalDummy for S_BP_HoJ_tempPlayer at S_BP_HoJ_Position[S_BP_HoJ_tempInt] facing Default building facing degrees
              • Set S_TempDummy = (Last created unit)
              • Unit - Add a 5.00 second Generic expiration timer to S_TempDummy
              • Unit - Add S_BP_HoJ_DummySpell to S_TempDummy
              • Unit - Set level of S_BP_HoJ_DummySpell for S_TempDummy to S_BP_HoJ_Level[S_BP_HoJ_tempInt]
              • Unit Group - Pick every unit in S_BP_HoJ_tempGroup and do (Actions)
                • Loop - Actions
                  • Set S_BP_HoJ_tempUnit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (S_BP_HoJ_tempUnit is alive) Equal to True
                      • (S_BP_HoJ_tempUnit is A structure) Equal to False
                      • (S_BP_HoJ_tempUnit is Mechanical) Equal to False
                      • (S_BP_HoJ_tempUnit is Magic Immune) Equal to False
                      • (S_BP_HoJ_tempUnit belongs to an enemy of S_BP_HoJ_tempPlayer) Equal to True
                    • Then - Actions
                      • Unit - Cause S_BP_HoJ_Caster[S_BP_HoJ_tempInt] to damage S_BP_HoJ_tempUnit, dealing S_BP_HoJ_tempDamage[S_BP_HoJ_tempInt] damage of attack type Spells and damage type Magic
                      • Unit - Order S_TempDummy to Human Mountain King - Storm Bolt S_BP_HoJ_tempUnit
                    • Else - Actions
                  • Unit Group - Remove S_BP_HoJ_tempUnit from S_BP_HoJ_tempGroup
                  • Set S_BP_HoJ_tempUnit = No unit
              • Set S_TempDummy = No unit
              • Custom script: call DestroyGroup(udg_S_BP_HoJ_tempGroup)
              • Set S_BP_HoJ_Caster[S_BP_HoJ_tempInt] = No unit
              • Set S_BP_HoJ_Dummy[HeroAttribute_tempInt] = No unit
              • Set S_BP_HoJ_Caster[S_BP_HoJ_tempInt] = S_BP_HoJ_Caster[S_BP_HoJ_Index]
              • Set S_BP_HoJ_Angle[S_BP_HoJ_tempInt] = S_BP_HoJ_Angle[S_BP_HoJ_Index]
              • Set S_BP_HoJ_Dummy[S_BP_HoJ_tempInt] = S_BP_HoJ_Dummy[S_BP_HoJ_Index]
              • Set S_BP_HoJ_Level[S_BP_HoJ_tempInt] = S_BP_HoJ_Level[S_BP_HoJ_Index]
              • Custom script: call RemoveLocation (udg_S_BP_HoJ_Position[udg_S_BP_HoJ_tempInt])
              • Set S_BP_HoJ_Position[S_BP_HoJ_tempInt] = S_BP_HoJ_Position[S_BP_HoJ_Index]
              • Set S_BP_HoJ_tempDamage[S_BP_HoJ_tempInt] = S_BP_HoJ_tempDamage[S_BP_HoJ_Index]
              • Set S_BP_HoJ_Index = (S_BP_HoJ_Index - 1)
              • Set S_BP_HoJ_tempInt = (S_BP_HoJ_tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • S_BP_HoJ_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Set S_BP_HoJ_tempPoint = (Position of S_BP_HoJ_Dummy[S_BP_HoJ_tempInt])
              • Set S_BP_HoJ_tempPoint2 = (S_BP_HoJ_tempPoint offset by S_BP_HoJ_Speed[S_BP_HoJ_Level[S_BP_HoJ_tempInt]] towards S_BP_HoJ_Angle[S_BP_HoJ_tempInt] degrees)
              • Unit - Move S_BP_HoJ_Dummy[S_BP_HoJ_tempInt] instantly to S_BP_HoJ_tempPoint2, facing S_BP_HoJ_Position[S_BP_HoJ_tempInt]
              • Game - Display to (All players) the text: move
              • Custom script: call RemoveLocation (udg_S_BP_HoJ_tempPoint)
              • Custom script: call RemoveLocation (udg_S_BP_HoJ_tempPoint2)
As you can see here i made the dummy hammer face the point so there is no problem with finding an unpathable cast point. I dont know what is causing this . Maybe my poor way of registering the ''end'' of the spell when it reaches the destination
 
Level 8
Joined
Nov 9, 2011
Messages
326
is hammer unit flying or ground and then you just turn off collision?
he is flying and collision off. but what ive found is that sometimes he spawns a bit off. I shall try this by changing angle everytime it moves to actually face the point of cast.


I have fixed it. It seems that every time it spawned in an odd place it was never close (100 units) to the center for the trigger to end so it kept moving. Now everytime i move it i face it towards the cast point.
 
Status
Not open for further replies.
Top