• 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] Redoing system in vJass to ordinary Jass

Status
Not open for further replies.
Level 4
Joined
May 20, 2008
Messages
89
Hello.
I need someone who can redo this simple system from vJass to ordinary Jass.

JASS:
library FadeOverTime
    
    globals
      //The interval that updates the faders
      private constant real TIMER_INTERVAL = .05
      //Default color codes
      private constant integer DEFAULT_RED   = 255
      private constant integer DEFAULT_GREEN = 255
      private constant integer DEFAULT_BLUE  = 255
    endglobals
    
    struct FoT
      unit fader
      real trans
      real transIncr
      real endTrans
      real timeLeft
      
      static timer tim = CreateTimer()
      static FoT array fots
      static integer total
      
        static method update takes nothing returns nothing
          local integer i=0
          local FoT fot
          
          loop
            exitwhen i >= .total
            set fot = .fots[.total]
            if fot.timeLeft <= .0 then
              call fot.destroy()
              set .total = .total - 1
              set .fots[i] = .fots[.total]
              if .total == 0 then
                call PauseTimer(.tim)
              endif
              set i=i-1
            else
              set fot.timeLeft = fot.timeLeft-TIMER_INTERVAL
              set fot.trans = fot.trans+fot.transIncr
              call SetUnitVertexColor(fot.fader, DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, R2I(fot.trans))
            endif
            set i=i+1
          endloop
        endmethod
        
        method onDestroy takes nothing returns nothing
              call SetUnitVertexColor(.fader, DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, R2I(.endTrans))
        endmethod
        
        static method start takes unit fader, real startTrans, real endTrans, real time returns nothing
          set .fots[.total]            = FoT.create()
          set .fots[.total].fader      = fader
          set .fots[.total].trans      = startTrans
          set .fots[.total].endTrans   = endTrans
          set .fots[.total].transIncr  = (endTrans-startTrans)/time/TIMER_INTERVAL
          set .fots[.total].timeLeft   = time
          if .total == 0 then
            call TimerStart(.tim, TIMER_INTERVAL, true, function FoT.update)
          endif
          set .total=.total+1
        endmethod
    endstruct
    
function FadeUnitTimed takes unit fader, real startTrans, real endTrans, real time returns nothing
  call FoT.start(fader, startTrans, endTrans, time)
endfunction
endlibrary

Thank you very much.
Skore_sM
 
Level 4
Joined
May 20, 2008
Messages
89
This is what happens when I open jass helper

problemg.jpg


but the SFmpq.dll is in "bin" folder -.-
 
Level 4
Joined
May 20, 2008
Messages
89
I tryed that one too.
Then it all works fine untill I enter in triggers window.
THen just gives me error message. ;s
 
Level 7
Joined
Aug 15, 2007
Messages
52
lol converting vjass to jass is the most funny thing ive heard. its like converting C# into assembly.... ofc not tat bad but well similar. :p
And u can do tat easy by asking someone to save the map and give u the *.j file

but ye try get newgen to work m8
 
lol converting vjass to jass is the most funny thing ive heard. its like converting C# into assembly.... ofc not tat bad but well similar. :p
And u can do tat easy by asking someone to save the map and give u the *.j file
The thing about saving the map and getting the .j file - where would the globals go?

but ye try get newgen to work m8
I totally agree.
 
Status
Not open for further replies.
Top