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

[JASS] Trackable Problems

Status
Not open for further replies.
Level 13
Joined
Nov 22, 2006
Messages
1,260
Hi, I wanted to create a trackable on every grid in map, but I don't think they're created.......can you perhaps see why? (This is vJass)

JASS:
struct Trackable_Data
    trackable t
    real x
    real y
    
    static method create takes real x, real y, trigger t returns Trackable_Data
        local Trackable_Data td = Trackable_Data.allocate()
        
        set td.t = CreateTrackable("4x4Trackable.MDX", x, y, 0)
        set td.x = x
        set td.y = y
        
        call SetCSData(t, td)
        
        return td
    endmethod
endstruct

private function Init_UndeadArchery takes nothing returns nothing
    local Trackable_Data td
    local trigger t = CreateTrigger()
    local real x1
    local real x2 = GetRectMaxX(bj_mapInitialPlayableArea) - 64
    local real y1 = GetRectMinY(bj_mapInitialPlayableArea) + 64
    local real y2 = GetRectMaxY(bj_mapInitialPlayableArea) - 64
    
    loop
        exitwhen y1 > y2
        set x1 = GetRectMinX(bj_mapInitialPlayableArea) + 64
        
        loop
            exitwhen x1 > x2
            set td = Trackable_Data.create(x1, y1, t)
            set x1 = x1 + 128
        endloop
        
        set y1 = y1 + 128
    endloop
endfunction


Don't mind that trigger.
 
Last edited:
Level 13
Joined
Nov 22, 2006
Messages
1,260
*BUMP*

Trackables aren't your field, huh? Well, I wanted to use WarSoc (it has a mouse detection), but I don't know how to decrack my wc3 :(

News: they are created, but for some reason not detected until I set a different model, maybe something is wrong with the model (which I find hard to believe since it worked in KaTTaNa's Bomb map.......
 

Attachments

  • 4x4Trackable.MDX
    2.2 KB · Views: 76
Status
Not open for further replies.
Top