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

Does Raised Terrain Disrupt X and Y Locations of an Item?

Status
Not open for further replies.
Level 11
Joined
Aug 6, 2009
Messages
697
I'm making a spell that summons a rock and throws it at the target.
I'm using the item method of checking pathing.
The rock is only supposed to be destroyed if it hits a doodad.
Whenever a rock goes onto raised terrain the rock is destroyed?
Is there a way to prevent this?
Do I have to add a Z coordinate?

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in TempGroup) Greater than or equal to 1
    • Then - Actions
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Remove Unit from the game
      • Unit Group - Pick every unit in TempGroup and do (Unit - Cause Unit to damage (Picked unit), dealing 150.00 damage of attack type Spells and damage type Universal)
    • Else - Actions
      • Custom script: set udg_X = GetLocationX(udg_TempPoint2)
      • Custom script: set udg_Y = GetLocationY(udg_TempPoint2)
      • Custom script: call SetItemPosition(udg_PC_Item, udg_X, udg_Y)
      • Custom script: if GetWidgetX(udg_PC_Item) == udg_X and GetWidgetY(udg_PC_Item) == udg_Y then
      • Custom script: call SetUnitX(udg_Unit, udg_X)
      • Custom script: call SetUnitY(udg_Unit, udg_Y)
      • -------- ------------------------------ --------
      • -------- ------------------------------ --------
      • -------- Part to be changed or removed ? --------
      • Custom script: else
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Remove Unit from the game
      • -------- ------------------------------ --------
      • -------- ------------------------------ --------
      • Custom script: endif
      • Custom script: call SetItemVisible(udg_PC_Item, false)
 
Level 11
Joined
Aug 6, 2009
Messages
697
I can't seem to figure out the problem... I've tried multiple things but I suppose I could just use move unit instantly. However, I'm using this pathing checker on multiple spells...

The issue is that when the rock is on terrain that isn't flat (raised terrain tool or lower terrain tool) it is destroyed... (X and Y change??)

I edited the spell a little bit and decided to try broadening the range a little, however it was to little effect.

Consider this a bump.
If anyone has any answers, here's the full trigger, points of interest are marked.
I bold the trigger because I think it's hard to read at times.


  • Rock Formation
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Rock Formation
    • Actions
      • Set TempInt = (Player number of (Owner of (Triggering unit)))
      • Set RF_Caster[TempInt] = (Triggering unit)
      • Set RF_Point[TempInt] = (Position of RF_Caster[TempInt])
      • Set RF_Timer[TempInt] = 4.00
      • Set RF_Percentage[TempInt] = 0.00
      • Set RF_AngleSetupRan[TempInt] = False
      • Set RF_Tracker[TempInt] = 0
      • Special Effect - Create a special effect attached to the origin of RF_Caster[TempInt] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: if udg_RF_Group[udg_TempInt] == null then
      • Custom script: set udg_RF_Group[udg_TempInt] = CreateGroup()
      • Custom script: endif

  • Rock Formation Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LoopIndex[5]) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RF_Timer[LoopIndex[5]] Greater than 0.00
            • Then - Actions
              • Set RF_Timer[LoopIndex[5]] = (RF_Timer[LoopIndex[5]] - 0.05)
              • Set RF_Percentage[LoopIndex[5]] = (RF_Percentage[LoopIndex[5]] + 1.25)
              • Set RF_Tracker[LoopIndex[5]] = (RF_Tracker[LoopIndex[5]] + 1)
              • Floating Text - Create floating text that reads ((String(RF_Percentage[LoopIndex[5]])) + %) above RF_Caster[LoopIndex[5]] with Z offset 10.00, using font size 10.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 0.06 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • RF_Tracker[LoopIndex[5]] Equal to 16
                      • RF_Tracker[LoopIndex[5]] Equal to 32
                      • RF_Tracker[LoopIndex[5]] Equal to 48
                      • RF_Tracker[LoopIndex[5]] Equal to 64
                      • RF_Tracker[LoopIndex[5]] Equal to 80
                • Then - Actions
                  • Set TempPoint = (Position of RF_Caster[LoopIndex[5]])
                  • Set TempPoint2 = (Random point in (Rect centered at TempPoint with size (750.00, 750.00)))
                  • Special Effect - Create a special effect attached to the origin of RF_Caster[LoopIndex[5]] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect attached to the origin of RF_Caster[LoopIndex[5]] using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Create 1 Rock Formation(Dummy) for (Owner of RF_Caster[LoopIndex[5]]) at TempPoint2 facing Default building facing (270.0) degrees
                  • Unit Group - Add (Last created unit) to RF_Group[LoopIndex[5]]
                  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RF_Caster[LoopIndex[5]] Not equal to No unit
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RF_AngleSetupRan[LoopIndex[5]] Equal to False
                    • Then - Actions
                      • Set RF_Percentage[LoopIndex[5]] = 0.00
                      • Set RF_AngleSetupRan[LoopIndex[5]] = True
                      • Set TempPoint = (Position of RF_Caster[LoopIndex[5]])
                      • -------- --------------------------------------------------- --------
                      • -------- --------------------------------------------------- --------
                      • -------- Adjust Range Here --------
                      • Set TempGroup = (Units within 2500.00 of TempPoint matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of RF_Caster[LoopIndex[5]])) Equal to True)))
                      • -------- --------------------------------------------------- --------
                      • -------- --------------------------------------------------- --------
                      • Custom script: call RemoveLocation(udg_TempPoint)
                      • Set RF_DummyArray[LoopIndex[5]] = 0
                      • Set TempReal = 0.00
                      • Unit Group - Pick every unit in RF_Group[LoopIndex[5]] and do (Actions)
                        • Loop - Actions
                          • Set TempPoint = (Position of (Picked unit))
                          • Set TempPoint2 = (Random point in (Rect centered at (Position of (Random unit from TempGroup)) with size (200.00, 200.00)))
                          • Set RF_DummyArray[LoopIndex[5]] = (RF_DummyArray[LoopIndex[5]] + 1)
                          • Set RF_Angle[RF_DummyArray[LoopIndex[5]]] = (Angle from TempPoint to TempPoint2)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between TempPoint and TempPoint2) Greater than or equal to TempReal
                            • Then - Actions
                              • Set TempReal = (Distance between TempPoint and TempPoint2)
                              • Set RF_Timer2[LoopIndex[5]] = ((TempReal / 30.00) x 0.05)
                            • Else - Actions
                          • Custom script: call RemoveLocation(udg_TempPoint)
                          • Custom script: call RemoveLocation(udg_TempPoint2)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in TempGroup) Equal to 0
                        • Then - Actions
                          • Set RF_Timer[LoopIndex[5]] = 0.00
                          • Set RF_Timer2[LoopIndex[5]] = 0.00
                          • Floating Text - Create floating text that reads No Targets In Range... above RF_Caster[LoopIndex[5]] with Z offset 10.00, using font size 10.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                        • Else - Actions
                      • Custom script: call DestroyGroup(udg_TempGroup)
                    • Else - Actions
                      • Set RF_DummyArray[LoopIndex[5]] = 0
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RF_Timer2[LoopIndex[5]] Greater than 0.00
                        • Then - Actions
                          • Set RF_Timer2[LoopIndex[5]] = (RF_Timer2[LoopIndex[5]] - 0.05)
                          • Unit Group - Pick every unit in RF_Group[LoopIndex[5]] and do (Actions)
                            • Loop - Actions
                              • Set Unit = (Picked unit)
                              • Set RF_DummyArray[LoopIndex[5]] = (RF_DummyArray[LoopIndex[5]] + 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit is alive) Equal to True
                                • Then - Actions
                                  • Set TempPoint = (Position of Unit)
                                  • Set TempPoint2 = (TempPoint offset by 30.00 towards RF_Angle[RF_DummyArray[LoopIndex[5]]] degrees)
                                  • Set TempGroup = (Units within 50.00 of TempPoint matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of RF_Caster[LoopIndex[5]])) Equal to True)))
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Number of units in TempGroup) Greater than or equal to 1
                                    • Then - Actions
                                      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                                      • Special Effect - Destroy (Last created special effect)
                                      • Unit - Remove Unit from the game
                                      • Unit Group - Pick every unit in TempGroup and do (Unit - Cause Unit to damage (Picked unit), dealing 150.00 damage of attack type Spells and damage type Universal)
                                    • Else - Actions
                                      • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
                                      • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
                                      • -------- Points Of Interest --------
                                      • Custom script: set udg_X = GetLocationX(udg_TempPoint2)
                                      • Custom script: set udg_Y = GetLocationY(udg_TempPoint2)
                                      • Custom script: call SetItemPosition(udg_PC_Item, udg_X, udg_Y)
                                      • Custom script: set udg_TempReal = GetWidgetX(udg_PC_Item)
                                      • Custom script: set udg_TempReal2 = GetWidgetY(udg_PC_Item)
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Or - Any (Conditions) are true
                                            • Conditions
                                              • (udg_TempReal == udg_X and udg_TempReal2 == udg_Y)
                                              • (udg_TempReal == udg_X + 1 and udg_TempReal2 == udg_Y + 1)
                                              • (udg_TempReal == udg_X - 1 and udg_TempReal2 == udg_Y - 1)
                                              • (udg_TempReal == udg_X - 1 and udg_TempReal2 == udg_Y + 1)
                                              • (udg_TempReal == udg_X + 1 and udg_TempReal2 == udg_Y - 1)
                                        • Then - Actions
                                          • Custom script: call SetUnitX(udg_Unit, udg_X)
                                          • Custom script: call SetUnitY(udg_Unit, udg_Y)
                                        • Else - Actions
                                          • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                                          • Special Effect - Destroy (Last created special effect)
                                          • Unit - Remove Unit from the game
                                      • Custom script: call SetItemVisible(udg_PC_Item, false)
                                  • Custom script: call RemoveLocation(udg_TempPoint)
                                  • Custom script: call RemoveLocation(udg_TempPoint2)
                                  • Custom script: call DestroyGroup(udg_TempGroup)
                                  • -------- Points Of Interest --------
                                  • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
                                  • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
                                • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RF_Caster[LoopIndex[5]] Not equal to No unit
                            • Then - Actions
                              • Set RF_Caster[LoopIndex[5]] = No unit
                              • Unit Group - Pick every unit in RF_Group[LoopIndex[5]] and do (Actions)
                                • Loop - Actions
                                  • If (((Picked unit) is alive) Equal to True) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing)
                                  • Unit Group - Remove (Picked unit) from RF_Group[LoopIndex[5]]
                                  • Custom script: call DestroyGroup(udg_RF_Group[udg_LoopIndex[5]])
                              • Custom script: set udg_RF_Group[udg_LoopIndex[5]] = null
                            • Else - Actions
                • Else - Actions
 
Status
Not open for further replies.
Top