Staredit Network > Forums > Modding Assistance > Topic: Permanently Spinning Units
Permanently Spinning Units
Dec 1 2015, 9:32 pm
By: Sand Wraith  

Dec 1 2015, 9:32 pm Sand Wraith Post #1

she/her

Let's say I have a unit. This unit ought to have the appearance of an equilateral triangle. Its graphic, the triangle, continually rotates. This unit also moves around, so of course, its graphic should be centered on the unit's coordinates.

Graphically, the unit ought to:
1) Always spin with a constant period.
2) Have no hitches in any and all animation transitions.
3) Spin during all animations.

So basically this unit we have in mind always spins. When it attacks, it doesn't stop spinning. When it moves or comes to a stop, it still spins.

I thought this sort of unit would be easy to implement.

It turns out I was wrong.

Here is the "base" unit:
Code
.headerstart
IsId               68
Type               12
Init               AK_InvisBase_Init
Death               AK_InvisBase_Death
GndAttkInit         AK_InvisBase_GndAttkInit
AirAttkInit         AK_InvisBase_GndAttkInit
Unused1             [NONE]
GndAttkRpt         AK_InvisBase_GndAttkInit
AirAttkRpt         AK_InvisBase_GndAttkInit
CastSpell           [NONE]
GndAttkToIdle       AK_InvisBase_GndAttkToIdle
AirAttkToIdle       AK_InvisBase_GndAttkToIdle
Unused2             [NONE]
Walking             AK_InvisBase_Walking
WalkingToIdle       AK_InvisBase_WalkingToIdle
SpecialState1       [NONE]
.headerend
# ----------------------------------------------------------------------------- #

AK_InvisBase_Init:
    # Spawn actual thing
    #sprol             247 0 0
    imgol             261 0 0
    playfram           0x00     # frame set 0
    tmprmgraphicstart
    goto               AK_InvisBase_WalkingToIdle

AK_InvisBase_GndAttkToIdle:
AK_InvisBase_WalkingToIdle:
    wait             125
    goto               AK_InvisBase_WalkingToIdle

AK_InvisBase_GndAttkInit:
    wait             1
    attack
    gotorepeatattk
    goto             AK_InvisBase_GndAttkToIdle
   
   
AK_InvisBase_Death:
    wait               3
    end                

AK_InvisBase_Walking:
    goto               AK_InvisBase_WalkingToIdle


And here is the "turret" image animation:
Code
.headerstart
IsId               89
Type               12
Init               AK_Graphic_Init
Death               AK_Graphic_Death
GndAttkInit         AK_Graphic_WalkingToIdle
AirAttkInit         AK_Graphic_WalkingToIdle
Unused1             [NONE]
GndAttkRpt         AK_Graphic_WalkingToIdle
AirAttkRpt         AK_Graphic_WalkingToIdle
CastSpell           [NONE]
GndAttkToIdle       AK_Graphic_WalkingToIdle
AirAttkToIdle       AK_Graphic_WalkingToIdle
Unused2             [NONE]
Walking             AK_Graphic_WalkingToIdle
WalkingToIdle       AK_Graphic_WalkingToIdle
SpecialState1       [NONE]
.headerend
# ----------------------------------------------------------------------------- #

AK_Graphic_Init:
    imgul               224 0 42     # AK_Graphic_Shad (terran\AK_Graphic_.grp)
    playfram           0x00     # frame set 0
    goto               AK_Graphic_WalkingToIdle

AK_Graphic_GndAttkToIdle:
AK_Graphic_WalkingToIdle:
    playfram             0x0
    wait             2
    playfram             0x1
    wait             2
    playfram             0x2
    wait             2
    playfram             0x3
    wait             2
    playfram             0x4
    wait             2
    playfram             0x5
    wait             2
    playfram             0x6
    wait             2
    playfram             0x7
    wait             2
    playfram             0x8
    wait             2
    playfram             0x9
    wait             2
    playfram             0xa
    wait             2
    playfram             0xb
    wait             2
    playfram             0xc
    wait             2
    playfram             0xd
    wait             2
    playfram             0xe
    wait             2
    playfram             0xf
    wait             2
    goto               AK_Graphic_WalkingToIdle

AK_Graphic_GndAttkInit:
    wait             1
    goto             AK_Graphic_GndAttkToIdle
   
   
AK_Graphic_Death:
    playsnd             210     # Terran\DROPSHIP\TDrDth00.wav
    imgol             215 0 0 # Protoss Large Explosion
    imgol               333 0 0     # TerranBuildingExplosionmedium (thingy\tBangL.grp)
    wait               3
    end                

AK_Graphic_Walking:
    goto               AK_Graphic_WalkingToIdle    


Here's what I have tried:
1) Implementing via one unit with no spawned overlays.
2) One unit spawning an image overlay.
3) One unit spawning a sprite overlay.

The problem with (2) is that the unit will reset its very simple spinning animation every time it transitions from attacking to moving, from moving to stopping, from stop to moving, from stop to attack, from attack to stop, etc, producing a noticeable and annoying "hitch," stall, or jerk.

The problem with (3) is that the sprite overlay will not follow the unit (so one could see the selection circle moving about, but the graphic remains spinning in place where the unit was created).

So the question is simple: How does one implement such a spinning unit flawlessly (or at least mostly flawlessly)?




Dec 1 2015, 10:45 pm Neiv Post #2



Does disabling images.dat Use full iscript for the child overlay help?



None.

Dec 1 2015, 11:31 pm Sand Wraith Post #3

she/her

I haven't tried that. As soon as I can I will, that sounds highly promising.




Dec 5 2015, 10:45 pm Sand Wraith Post #4

she/her

It worked, thanks.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
Please log in to shout.


Members Online: NudeRaider, Roy