| 05-11-2008, 02:20 AM | #1 |
I'm trying to give height to trackables but its not working. Am I doing something wrong? You create a destructable at a given height, place a trackable over it, then remove the destructable. JASS:scope trackables private function test takes nothing returns nothing local destructable d local integer i = 4 call BJDebugMsg("Trackables - Starting") loop call BJDebugMsg(I2S(i)) set d = CreateDestructableZ('LTcr', 0, 0, i*128, 0, 1, 1) call TriggerSleepAction(1) call CreateTrackable("units\\nightelf\\Wisp\\Wisp.mdl", 0, 0, 0) call TriggerSleepAction(1) call RemoveDestructable(d) set d = null set i = i - 1 exitwhen i == 0 call TriggerSleepAction(1) endloop call BJDebugMsg("Trackables - Done") endfunction //Trackables need to be setup after the game starts, thus this. public function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterTimerEvent(t, .01, false) call TriggerAddAction(t, function test) endfunction endscope |
| 05-11-2008, 06:39 AM | #2 |
You need to use the floating platform destructable (not sure on the ID for it). |
| 05-11-2008, 08:14 AM | #3 |
Like Ammorth said; the destructable should be invisible platform, or similar: JASS:function CreateTrackableZ takes string path, real x, real y, real z, real face returns trackable local destructable d = CreateDestructableZ('OTip', x, y, z, 0.00, 1, 0) local trackable tr = CreateTrackable(path, x, y, face) call RemoveDestructable(d) set d = null return tr endfunction Taken from KaTTaNa's Trackable Tutorial on wc3jass. |
| 05-11-2008, 02:24 PM | #4 |
Solved. KaTTaNa's tutorial didn't take into account a map which has a higher terrain level. So use GetLocationZ. Edit: Side note, it seems you cant hit multiple trackables at once, overlapping them won't work. So trackables with height is useless to me now. lol. JASS:scope Trackables private function Test takes nothing returns nothing local destructable d local integer i = 4 local location l call BJDebugMsg("Trackables - Starting") loop set i = i - 1 call BJDebugMsg(I2S(i)) set l = Location(0, 0) set d = CreateDestructableZ('OTip', 0, 0, GetLocationZ(l)+(i*128), 0.00, 1.00, 0) call RemoveLocation(l) set l = null call CreateTrackable("Buildings\\Other\\BarrelsUnit1\\BarrelsUnit1.mdl", 0, 0, 0) call RemoveDestructable(d) set d = null exitwhen i == 0 endloop call BJDebugMsg("Trackables - Done") endfunction public function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterTimerEvent(t, .01, false) call TriggerAddAction(t, function Test) endfunction endscope |
