Simple question about libraries

Magoiche

Member
Reaction score
20
I was trying to make a library.
Here she(i.i) is:

JASS:
library Lybrary

public function PolledWait2 takes real duration returns nothing
    local real timeRemaining
    local real st=TimerGetElapsed( bj_gameStartedTimer)
    if st <= 0 then
        set bj_gameStartedTimer = CreateTimer()
        call TimerStart(bj_gameStartedTimer, 1000000, false, null)
    endif
    if (duration > 0) then
        loop
            set timeRemaining = duration - TimerGetElapsed( bj_gameStartedTimer) + st
            exitwhen timeRemaining <= 0
            if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
                call TriggerSleepAction(0.1 * timeRemaining)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
    endif
endfunction

endlibrary


This is the PolledWait2 that Vex made.

I tried "call PolledWait2" and "call Library_PolledWait2 but it didn't work.
The library trigger is set to run on MapInit.
I looked on jasshelper but i didn't found nothing.
If i put on same trigger trigger i won't need the library i will jsut have to put inside the scope. this i know.
But i remember seeing some systems taht don't need to be in the same trigger to work(I think the name is ABC).

Whats wrong?
 

saw792

Is known to say things. That is all.
Reaction score
280
Why is it run on Map Init? It has nothing to run. It has no trigger.

Anyway, the library name is "Lybrary". You should be calling this:
JASS:
call Lybrary_PolledWait2(duration)


Or you could just remove the 'public' keyword so you can just use
JASS:
call PolledWait2(duration)
 

SFilip

Gone but not forgotten
Reaction score
633
Your library is named "Lybrary" so you should call Lybrary_PolledWait2, not Library_PolledWait2.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top