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

pathning checking doesnt always work propley

Status
Not open for further replies.
Level 11
Joined
Jul 17, 2013
Messages
544
Hey with help of some people i made a jump spell, it shouldnt allow u to jump into blocked area, or aswell it shouldnt allow u to jump over things that have pathning like rock, tress, boxes etc. it seems to work fine most of time but sometimes it bugs

i have just found a bug and screenshooted it, i think guy managed to jump to where he shouldnt because pathning is really thick there, is there way to fix it in the code? i know i can make pathning bigger there but the problem is there can be more places like this and it will take long time to be aware of them all and fix it


upload_2020-10-9_14-22-7.png
upload_2020-10-9_14-22-39.png
upload_2020-10-9_14-22-48.png
upload_2020-10-9_14-22-56.png



this is how he managed to jump over blocked area, he tired hard to do this bug again, and return up there but he couldnot i think its just hard to position urself correctly.









this is the photo of pathning at this place
upload_2020-10-9_14-23-28.png





as i mentioned before if its possible i would like to change it globaly, by changing the code somehow, now let me post the code


Pathning checking

JASS:
function IsPointWalkable takes real x, real y returns boolean
    local real X
    local real Y
    local item I = CreateItem('sehr', x, y)
    set X = GetItemX(I)
    set Y = GetItemY(I)
    call RemoveItem(I)
    return X-x <= 0.125 and Y-y <= 0.125
endfunction



  • first
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Jump
    • Actions
      • Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
      • Set VariableSet targecikjumpa = (Target point of ability being cast)
      • Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
      • Custom script: if (IsPointWalkable(GetLocationX(udg_targecikjumpa),GetLocationY(udg_targecikjumpa))) then
      • Custom script: else
      • Unit - Order Gimli 0005 <gen> to Stop.
      • Game - Display to Player Group - Player 6 (Orange) the text: |cffffcc00This area...
      • Custom script: endif
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation(udg_targecikjumpa)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LeapDistance Less than 100.00
        • Then - Actions
          • Unit - Order Gimli 0005 <gen> to Stop.
          • Game - Display to Player Group - Player 6 (Orange) the text: |cffffcc00Target is...
        • Else - Actions

  • second
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jump
    • Actions
      • Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
      • Set VariableSet targecikjumpa = (Target point of ability being cast)
      • Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
      • Set VariableSet skok = (TempLoc offset by 20.00 towards LeapDistance degrees.)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Unit - Turn collision for Gimli 0005 <gen> Off.
      • Unit - Add Crow Form to Gimli 0005 <gen>
      • Unit - Remove Crow Form from Gimli 0005 <gen>
      • Animation - Change Gimli 0005 <gen> flying height to 130.00 at 400.00
      • Trigger - Turn on third <gen>


  • third
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet TempLoc = (Position of Gimli 0005 <gen>)
      • Set VariableSet LeapDistance = (Distance between TempLoc and targecikjumpa)
      • Set VariableSet skok = (TempLoc offset by 20.00 towards (Angle from TempLoc to targecikjumpa) degrees.)
      • Custom script: if (IsPointWalkable(GetLocationX(udg_skok),GetLocationY(udg_skok))) then
      • Unit - Move Gimli 0005 <gen> instantly to skok
      • Set VariableSet newLoc = (Position of Gimli 0005 <gen>)
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • LeapDistance Less than or equal to 15.00
              • (Distance between newLoc and TempLoc) Less than 15.00
        • Then - Actions
          • Set VariableSet skok = targecikjumpa
          • Trigger - Turn off (This trigger)
          • Custom script: call RemoveLocation(udg_targecikjumpa)
          • Custom script: call RemoveLocation(udg_newLoc)
          • Custom script: call RemoveLocation (udg_skok)
          • Animation - Change Gimli 0005 <gen> flying height to 0.00 at 400.00
          • Unit - Turn collision for Gimli 0005 <gen> On.
          • Unit - Create 1 Dummy for Player 6 (Orange) at TempLoc facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Add gimlia dummy to (Last created unit)
          • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Custom script: call RemoveLocation (udg_TempLoc)
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set level of gimlia dummy for (Last created unit) to (Level of Jump for Gimli 0005 <gen>)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp.
          • Set VariableSet gimliuk = (Position of Gimli 0005 <gen>)
          • Set VariableSet gimliknock = (Units within 230.00 of gimliuk matching (((Matching unit) has buff Knockbacked (Pause) gimljusz) Equal to True).)
          • Unit Group - Pick every unit in gimliknock and do (Actions)
            • Loop - Actions
              • Custom script: if IsUnitType(GetEnumUnit(),UNIT_TYPE_GIANT) then
              • Unit Group - Remove (Picked unit) from gimliknock.
              • Custom script: endif
          • Unit Group - Pick every unit in gimliknock and do (Actions)
            • Loop - Actions
              • Unit - Turn collision for (Picked unit) Off.
              • Unit - Add Crow Form to (Picked unit)
              • Unit - Remove Crow Form from (Picked unit)
              • Animation - Change (Picked unit) flying height to (Random real number between 150.00 and 190.00) at 400.00
          • Set VariableSet knockbackCounter = 0
          • Trigger - Turn on fourth <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempLoc)


ok so theres whole code (except 1 trigger that doesnt matter at jump progress because it knockbacks enemy after gim jumps)



i would like to mention 1 more issue sometimes when a lot of characters stand near rock and gimli jumps into them then he can move them behind that rock, since theres no space for him to land is it somehow possible to fix it? what i mean is


upload_2020-10-9_14-41-27.png



oWnMeH if u can then check out this thread, u helpped me with this ability
 
Status
Not open for further replies.
Top