play many animations in a timer (0.04s) ?

tuantai120

Cool Member
Reaction score
1
play many animations in a timer (0.04s) and Missing : endblock ?

i really dont know how to play many animations in a timer :(
ex : play animations "attack" and "spell" many times
JASS:
    set d.random = GetRandomInt(1,3)
    set d.random = d.random + 1
    if d.random == 1 then
        call SetUnitAnimation(d.trunks,a1)
    else
        if d.random == 2 then
            call SetUnitAnimation(d.trunks,a1)
        endif
    endif

this is the code of a spell with have 1 timer ( work )

JASS:
        set data.random = GetRandomInt(1,3)
        set data.random = data.random + 1
        call DestroyEffect(AddSpecialEffectTarget(SFX4,data.target,"chest"))
        call DestroyEffect(AddSpecialEffectTarget(SFX5,data.target,"chest"))
        if data.random == 1 then
            call SetUnitAnimation(data.broly,"attack")
        else
            if data.random == 2 then
                call SetUnitAnimation(data.broly,"attack")
            else
                call SetUnitAnimation(data.broly,"spell throw")
            endif
        endif

this is the code of a the spell with have 2 timer ( not work ) :(

and what is "Missing : endblock" ?

please help me :(
 

Bribe

vJass errors are legion
Reaction score
67
[ljass]endif[/ljass] is the endblock. Your structures look alright here, so it's probably another part of the code which causes that error.

JASS:
if data.random == 1 then
    call SetUnitAnimation(data.broly,"attack")
else
    if data.random == 2 then
        call SetUnitAnimation(data.broly,"attack")
    else
        call SetUnitAnimation(data.broly,"spell throw")
    endif
endif


Can be shortened to:

JASS:

if data.random == 1 or data.random == 2 then
    call SetUnitAnimation(data.broly,"attack")
else
    call SetUnitAnimation(data.broly,"spell throw")
endif


The [ljass]elseif[/ljass] is a beautiful construct that makes a lot of logical sense, so I recommend fitting that into some of your functions.
 
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