• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] trigger waiting the end of a function running

Status
Not open for further replies.
Level 2
Joined
Jun 5, 2006
Messages
18
hi...i've created a function in JASS (because it's really easier and shorter to use by giving it parameters instead using globals...)

unfortunately is necessary that this function uses some "Wait X" inside itself....

differently than if i do "Run trigger (ignoring conditions)", my triggers wait the ends of the function (and that's not good because this should be a thing that happens WHILE the trigger is running)

can you help me?Maybe i have to use a trigger to do this right?

here is the code (i will note post the GUI code because is very long)

JASS:
function FDDcastbar takes integer mySpell, integer myPg returns nothing
    local real intervalli = ( FDDspellinfoDELAY(mySpell) / 20.00 )
    local real lastInterval = ModuloReal(FDDspellinfoDELAY(mySpell), 20.00)
    local string castBar = " "
    local integer cicloA = 1
    local integer cicloB = 1
    loop
        exitwhen cicloA > 10
        set cicloB = 1
        loop
            exitwhen cicloB > cicloA
            set castBar = ( castBar + "|c00ffffffl |r" )
            set cicloB=cicloB+1
        endloop
        set cicloB=cicloA+1
        loop
            exitwhen cicloB > 10
            set castBar = ( castBar + "|c00ff0000l |r" )
            set cicloB=cicloB+1
        endloop
        call TriggerSleepAction( intervalli )
        if ( cicloA == 10 ) then
            call TriggerSleepAction( lastInterval )
        endif
        call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(myPg), udg_FDD_CastBar[myPg], castBar )
        set castBar = " "
        set cicloA=cicloA+1
    endloop
    call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(myPg), udg_FDD_CastBar[myPg], "|c00ffffff l l l l l l l l l l |r" )
endfunction

i've done it with a trigger:) (by simply adding the function to trigger actions)

a question...are there any better ways to do it?:O
 
Status
Not open for further replies.
Top