[Trigger] Part of trigger not executing

Status
Not open for further replies.
Level 7
Joined
Aug 19, 2009
Messages
279
I am making a trigger to rotate and object around another object, but the problem is that, a part of the trigger is not executing.

JASS:
function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
local real h
local real k
local real x1mh
local real y1 
local integer con
call DisplayTextToForce( GetPlayersAll(), "works-1" )
set h = GetLocationX(GetUnitLoc(udg_hero))
set k = GetLocationY(GetUnitLoc(udg_hero))
if (udg_x1<=-150) then
set con = -1
endif
if (udg_x1>=150) then
set con = 1
endif
if (con == -1) then
set udg_x1=udg_x1+5
endif
call DisplayTextToForce( GetPlayersAll(), "works-2" )
if (con == 1) then
set udg_x1=udg_x1-5
endif
set x1mh = udg_x1-h 
set y1 = ((SquareRoot(22500-(x1mh*x1mh)))-k)
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_003 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_003 = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Untitled_Trigger_003, 1 )
    call TriggerAddAction( gg_trg_Untitled_Trigger_003, function Trig_Untitled_Trigger_003_Actions )
endfunction

in game the works-1 is shown but not the works-2.


I am attaching the map too.
 

Attachments

Status
Not open for further replies.
Back
Top