• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[vJASS] Terrain Pathability Question

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
I am trying to make my own Knockback spell :)grin:) and I have come across a strange issue. When I try the following code, it thinks the terrain is unpathable and stops the Knockback (the unit is in a completely open space). Any ideas? The snippet is as follows:

JASS:
static method Timer_Actions takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local thistype D = GetTimerData(t)
    local real x
    local real y
    local real x2
    local real y2
    if D.DistLeft > 0 then
        set x = GetUnitX(D.targ)
        set y = GetUnitY(D.targ)
        set x2 = x + 5 * Cos(D.ang * bj_DEGTORAD)
        set y2 = y + 5 * Sin(D.ang * bj_DEGTORAD)
        if IsTerrainPathable(x2, y2, PATHING_TYPE_WALKABILITY) then //Here, it skips to the "else" actions.
            call SetUnitX(D.targ, x2)
            call SetUnitY(D.targ, y2)
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\FlyingMachine\\FlyingMachineImpact.mdl", D.targ, "chest"))
            set D.DistLeft = D.DistLeft - 5
        else
            call ReleaseTimer(t)
            call PauseUnit(D.targ, false)
            call SetUnitPathing(D.targ, true)
            call D.destroy()
        endif
    else
        call ReleaseTimer(t)
        call PauseUnit(D.targ, false)
        call SetUnitPathing(D.targ, true)
        call D.destroy()
    endif
    set t = null
endmethod
Thanks!

P.S. It works fine without the pathability check.
 
Speaking of wierd things in Warcraft III, did you know that player gold is not stored in memory plainly, but as some wierd integer that has to be processed with lots of functions in a class.
I discovered this today while playing around with Warcraft III and Cheat Engine :p
I was able to find and modify lots of values except for gold, lumber and food.

I found 3 instances of strings. One used in a very dynamic part of the script (after stopping the map, it turned to "Player Name", one of the strings in the lobby. Another instance in a cache used to speed up game-loading (it wasn't changed after quitting the game) and another instance used in-game (it turned null when I quit).

Something tells me Blizzard doesn't welcome cheaters :c
 
Status
Not open for further replies.
Top