[Trigger] Trackable grid not being created

Level 23
Joined
Mar 15, 2012
Messages
2,669
Trying to make a grid of trackables however it doesn't work.

  • Ini
    • Events
    • Map initialization
    • Conditions
    • Actions
    • -------- Create a local variable for our trackable --------
    • Custom script: local trackable tr
    • -------- And one for a destructable which will be used to raise our trackable in the air --------
    • Set x = (Min X of (Playable map area))
    • Set x_Copy = (Max X of (Playable map area))
    • Set y = (Min Y of (Playable map area))
    • Set y_Copy = (Max Y of (Playable map area))
    • -------- Create a hashtable to save our trackables' data --------
    • Set s = war3mapImported\rectangle-32x32.mdx
    • Set s = <Empty String>
    • Hashtable - Create a hashtable
    • Set Track_Table = (Last created hashtable)
    • -------- Facing angle of the trackables --------
    • Set a = 270.00
    • For each (Integer i2) from ((Integer(x)) / 32) to ((Integer(x_Copy)) / 32), do (Actions)
    • Loop - Actions
    • Set i2_Copy = 0
    • For each (Integer i2_Copy) from ((Integer(y)) / 32) to ((Integer(y_Copy)) / 32), do (Actions)
    • Loop - Actions
    • For each (Integer i3) from 1 to 12, do (Actions)
    • Loop - Actions
    • Set p = (Player(i3))
    • Set s = <Empty String>
    • -------- Make model visible for 1 player only --------
    • Custom script: if udg_p == GetLocalPlayer() then
    • Set s = war3mapImported\rectangle-32x32.mdx
    • Custom script: endif
    • Set datx = (((Real(i2)) x 32.00) / 16.00)
    • Set daty = (((Real(i2_Copy)) x 32.00) / 16.00)
    • -------- Create trackable --------
    • Custom script: set tr = CreateTrackable(udg_s, udg_datx, udg_daty, udg_a)
    • Set i2_Copy = (i2_Copy + 1)
    • -------- Register Click event --------
    • Custom script: call TriggerRegisterTrackableHitEvent(gg_trg_Hit, tr)
    • -------- Register Move event --------
    • Custom script: call TriggerRegisterTrackableTrackEvent(gg_trg_Track, tr)
    • -------- Get handle id of our trackable --------
    • Custom script: set udg_i = GetHandleId(tr)
    • -------- Save all data related to our trackable --------
    • Hashtable - Save x as 0 of i in Track_Table
    • Hashtable - Save y as 1 of i in Track_Table
    • Hashtable - Save z as 2 of i in Track_Table
    • Hashtable - Save s as 3 of i in Track_Table
    • Hashtable - Save Handle Ofp as 4 of i in Track_Table
    • Set i2 = (i2 + 1)
    • -------- Null handle leaks --------
    • Custom script: set tr = null
 
Level 23
Joined
Mar 15, 2012
Messages
2,669
=) You guys are right, thanks however... I just seem to be terrible with coordinate finding so I don't know what's going wrong.
[trigger=]
Ini
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
-------- Create a local variable for our trackable --------
Custom script: local trackable tr
Set i2 = (i2 + ((Integer(x)) / 32))
Set i2_Copy = (i2_Copy + ((Integer(y)) / 32))
For each (Integer i3) from 1 to 12, do (Actions)
Loop - Actions
Set p = (Player(i3))
Set s = <Empty String>
-------- Make model visible for 1 player only --------
Custom script: if udg_p == GetLocalPlayer() then
Set s = units\human\Footman\Footman.mdl
Custom script: endif
Set datx = (((Real(i2)) x 32.00) / 16.00)
Set daty = (((Real(i2_Copy)) x 32.00) / 16.00)
-------- Create trackable --------
Custom script: set tr = CreateTrackable(udg_s, udg_datx, udg_daty, udg_a)
Set i2_Copy = (i2_Copy + 1)
-------- Register Click event --------
Custom script: call TriggerRegisterTrackableHitEvent(gg_trg_Hit, tr)
-------- Register Move event --------
Custom script: call TriggerRegisterTrackableTrackEvent(gg_trg_Track, tr)
-------- Get handle id of our trackable --------
Custom script: set udg_i = GetHandleId(tr)
-------- Save all data related to our trackable --------
Hashtable - Save x as 0 of i in Track_Table
Hashtable - Save y as 1 of i in Track_Table
Hashtable - Save z as 2 of i in Track_Table
Hashtable - Save s as 3 of i in Track_Table
Hashtable - Save Handle Ofp as 4 of i in Track_Table
-------- Null handle leaks --------
Custom script: set tr = null
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
i2 Greater than ((Integer(x_Copy)) / 32)
i2_Copy Greater than ((Integer(y_Copy)) / 32)
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
[/trigger]
 
Top