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

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570

~Solved~


I added both actions to the same trigger, and not to the different ones,,



Hello people

I have been trying out some things with Trackables,, but i cant get it to work properly
JASS:
function Track takes nothing returns nothing
    call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"Track")
endfunction
function Hit takes nothing returns nothing
    call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"Hit")
endfunction
//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    local trigger t = CreateTrigger()
    local trigger u = CreateTrigger()
    local trackable tt = CreateTrackable("units\\human\\Peasant\\Peasant.mdl", 0,0,0)
    call TriggerRegisterTrackableHitEvent(t,tt)
    call TriggerRegisterTrackableTrackEvent(u,tt)
    call TriggerAddAction(t,function Hit)
    call TriggerAddAction(t,function Track)
endfunction

This is my code, and it shows the messages, only not at the right moment.
As soon as i click the trackable, it shows both, but it should only show one on hit, and one on track,,

Any ideas? Or cant you give both events to the same trackable? =S

-Yixx,,-
 
Last edited:
Status
Not open for further replies.
Top