Announcement

Collapse
No announcement yet.

trouble animating sprites

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • trouble animating sprites

    Hi i am trying to animate a sprite and am not sure what i am doing wrong. Basically what i want to do is repeat 2 frames back and forth for a second. I ran the makespr program and it created the sprite but when i entered the game it is not animating. Below is a copy of the script. Please let me know what the hell i'm doing wrong. It is very frustrating since this is my first sprite.
    ################################################## ############
    # This is a sample Unit Sprite script.
    ################################################## ############

    0 # this leading zero is required (it can be any number. A number
    # here is required, but ignored currently

    #
    # The UNIT_SPRITE keyword indicates that this is a sprite for units
    #
    UNIT_SPRITE
    {
    # The UNIT_SPRITE_MOVE tag specifies whether this sprite has
    # a Move action. It has a value of either 0 or 1. If it's 0,
    # no sprite action definition block is required. Since it's 1,
    # this block is required.
    #
    UNIT_SPRITE_MOVE 1
    {
    # This is the sprite action definition block. All sprite
    # actions require this block if the sprite action is defined.
    #
    SPRITE_NUM_FRAMES 2 # number of frames of animation
    SPRITE_FIRST_FRAME 0 # the index of the first frame
    SPRITE_WIDTH 96 # the width of each sprite image
    SPRITE_HEIGHT 72 # the height of each sprite image
    SPRITE_HOT_POINTS # the hot points (center points) of
    # the sprite for each of the 5 facings
    49 54 # facing 1
    43 51 # facing 2
    50 48 # facing 3
    58 38 # facing 4
    74 53 # facing 5
    }

    # The ANIM block is required for each UNIT_SPRITE_* action block
    # that is defined (set to 1, and has a sprite action definition
    # block.) It describes the animation that will pay, given the
    # sprite frames described in the UNIT_SPRITE_* block.
    #
    ANIM 1
    {
    ANIM_TYPE 2 # what type of animation is this?
    # 0 = sequential (play through from
    # the first frame to the last
    # defined frame
    # 1 = looped (starts over at the
    # first frame when it's gone
    # through all of the frames
    # 2 = back-n-forth (reverses
    # direction of playback when
    # it reaches the last frame,
    # and playes back to the first
    # before reversing direction
    # again.
    ANIM_NUM_FRAMES 2 # How many frames of animation?
    ANIM_PLAYBACK_TIME 1000 # How much time does it take to play
    # back the animation (in ms.) This
    # is not currently supported.
    ANIM_DELAY 100 # amount of time to repeat the very
    # last frame of the animation before
    # continuing (when playing looped
    # or Back 'n Forth animations)
    ANIM_FRAME_DATA # the list of the sprite frames to
    1 2 # to play (must be the same number
    # as defined in ANIM_NUM_FRAMES)

    #
    # The ANIM_MOVE_DELTAS are nudges applied to each frame of
    # animation which bump the draw location the specified offset.
    # They allow an single static frame to be moved around a fixed
    # location, for instance.
    #
    # There's one per frame of animation as defined in
    # ANIM_NUM_FRAMES
    #
    ANIM_MOVE_DELTAS 1
    {
    0 0
    0 0









    }

    #
    # This is a 4 bit transparency value, ranged from 0-15, to be
    # applied to each frame. This allows the sprite to fade in or
    # out over the course of animation, or whatever transparency
    # might be used for. 0 is invisible, 15 is opaque
    #
    ANIM_TRANSPARENCIES 1
    {
    15 15

    }

    }

    #
    # The Attack animation for this sprite. As you can see, this
    # unit doesn't have an Attack animation, so the tag's value is zero.
    # Because this tag's value is zero, there's no sprite action
    # definition block, and no ANIM {} block associated with this action.
    #
    UNIT_SPRITE_ATTACK 0

    #
    # The Idle animation for this unit. There's no Idle animation
    # either.
    #
    # If this sprite had an idle animation, the format of the sprite
    # action definition block would be exactly the same as the format
    # of the Move block above
    #
    UNIT_SPRITE_IDLE 0

    #
    # This Unit DOES have a victory/death animation. For this sprite
    # action definition block, and this one only (Victory) there's
    # an additional flag field immediately following the
    # UNIT_SPRITE_VICTORY tag, and that's UNIT_SPRITE_IS_DEATH, which
    # is set to either 0 (indicating that this animation specifies
    # a Victory animation--an animation to play when this unit wins
    # a battle) or 1 (indicating that this is a death animation, which
    # will play when the unit is killed.)
    #
    UNIT_SPRITE_VICTORY 0


    #
    # This is the Unit Sprite's Work animation (Special Animation)
    # to be used when doing special attacks or special movement.
    #
    # As you can see, it's not defined.
    #
    UNIT_SPRITE_WORK 0

    #
    # Unit Sprite Attributes Section
    #
    #
    # This section specifies a bunch of unit sprite attributes
    #

    #
    # Firepoints
    #
    # This block indicates where on the sprite that ammunition should
    # originate when the unit attacks. This is currently ignored.
    #
    UNIT_SPRITE_FIREPOINTS 0

    # Work Firepoints
    #
    # This block indicates where on the sprite that the ammunition
    # should originate when the unit special attacks. This is also
    # currently ignored.
    #
    UNIT_SPRITE_FIREPOINTS_WORK 0

    # UNIT_SPRITE_MOVEOFFSETS
    #
    # These are sprite nudges to be applied when the unit is moving.
    # They are an alternate way of specifying how many pixels in each
    # direction that unit should move. There's one pair of offsets
    # (x,y) for each facing (1-5).
    #
    # These are not currently used in the engine.
    #
    UNIT_SPRITE_MOVEOFFSETS 0


    # UNIT_SPRITE_SHIELDPOINTS
    #
    # This tag's block, when defined, allows you specify where the
    # unit's herald shield will appear in the sprite for each of the
    # 5 facings, for each of the 5 actions that the unit will perform.
    #
    # Often a fixed shield position wouldn't always work, as the shield
    # might cover up an important part of the sprite. This block
    # allows specific points to be used.
    #
    UNIT_SPRITE_SHIELDPOINTS 1
    {
    UNIT_SPRITE_SHIELDPOINTS_MOVE
    82 9
    82 9
    82 9
    82 9
    82 9
    UNIT_SPRITE_SHIELDPOINTS_ATTACK
    48 36
    48 36
    48 36
    48 36
    48 36
    UNIT_SPRITE_SHIELDPOINTS_IDLE
    48 36
    48 36
    48 36
    48 36
    48 36
    UNIT_SPRITE_SHIELDPOINTS_VICTORY
    82 9
    48 36
    48 36
    48 36
    48 36
    UNIT_SPRITE_SHIELDPOINTS_WORK
    48 36
    48 36
    48 36
    48 36
    48 36
    }

    }
    Also to let you know i created 2 frames for each facing for a total of 10 frames. I named them GU01MA1.0.TIF, GU01MA1.1.TIF, GU01MA2.0.TIF, GU01MA2.1.TIF and so on.

    Thanks in advance.

    ------------------
    Gemini

  • #2
    You have two frames 1 and 2 so you should change SPRITE_FIRST_FRAME 0 to SPRITE_FIRST_FRAME 1. And change change the frames number of the gu01ma files from 0 and 1 to 1 and 2.
    [This message has been edited by LittleWing (edited August 26, 1999).]

    Comment


    • #3
      gemeni
      There are a few things you need to do to get your animations.

      Firstly,how are your tiffs numbered? ie is your starting sprite 0 or 1. I assume its 1 or I don't think it will get through makespr.

      As you've said the number of tifs are two this should mean you only have tiffs ..0 and ...1. The problem then in your animation sction is your quoting numbers 1 and 2. Makespr I think loops round and thinks 2 is actually Tiff 0 (I know if you start with 1 then all the animations quoted are actually1 higher than the Tifs used and the highest frame goes back to the start!).

      Also, the timings don't mean a thing (as they say). with only two animations the sequence shown is Tif 0 then your animation Tifs but this looks like this probably shows 1 then 0 again. It may be more useful to extend and repeat the same tiffs to make sure they come up.

      The final thing is what version of CTP are you using. 1.1 has an option to set the animation speed. This doesn't affect the speed only how many images will be displayed! eg set to slowest and you get 12 (I think this is the max) speed it up and you get down to 1).

      Also, I only use animation type 1 which is pobably the most useful type.

      Hope this helps.

      Comment


      • #4
        Okay I finally got it working. The only thing I had wrong was the ANIM_FRAME_DATA. Instead of 1 2 i should have had 0 1. I wish they would have made a little better example cos the one that activision gave is kind of confusing. Any way i'm happy now. Thank you for replying to my post and once i'm done making my sprites i'll post them.

        ------------------
        Gemini

        Comment

        Working...
        X