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

[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: 77
Status
Not open for further replies.
Top