- Joined
- Dec 15, 2012
- Messages
- 650
Hello,
So my problem is that am I using the correct event or not ? Why is there nothing happen when I hit(my meaning is "left-click" with mouse) any of the trackables. The event itself wass a problem already or I misunderstood the use of the event ?? Please tell me more about "Trackable". Thank you.
I made this trigger with JNGP 2.0.X
JASS:
globals
trackable array T
trigger Init
trigger Event
endglobals
function InitFunc takes nothing returns nothing
local timer = Timer
local integer i = 1
local integer x = 1
local integer y = 1
loop
exitwhen i > 250
if x > 25 then
set x = 1
set y = y + 1
endif
set x = x + 1
set T[i] = CreateTrackable("units\\human\\peasant\\peasant.mdx", x, y, 90)
set i = i + 1
endloop
call CameraSetupApplyForPlayer( true, gg_cam_Main_Camera, Player(0), 0.01 )
call SetTimeOfDay( 8.00 )
endfunction
function InitTrig_Init takes nothing returns nothing
set Init = CreateTrigger()
call TriggerRegisterTimerEventSingle( Init, 0.00 )
call TriggerAddAction( Init, function InitFunc )
endfunction
// Trigger Separation
function Action_Hit takes nothing returns nothing
call DisplayTextToPlayer(Player(0), 0, 0, "Button Clicked !")
endfunction
function Event_Hit takes nothing returns nothing
local integer i = 1
set Event = CreateTrigger()
loop
exitwhen i > 250
call TriggerRegisterTrackableHitEvent(Event, T[i])
set i = i + 1
endloop
call TriggerAddAction(Event, function Action_Hit)
endfunction