Moving sprites within spells

Discussion in 'Modding' started by zellking, May 24, 2014.

  1. zellking

    zellking Member

    Is it possible to create a multi-part sprite that moves when used in a spell?
    To explain the situation a bit, heres a very unusual example:
    Say i created a spell which spawns a sprite of a man riding a bicycle which takes two blocks of space, would it be possible to make it move forward several blocks 1 at a time, without creating any unusual looking visuals or heavy delay between movements
    If that explanation didn't make too much sense (its kinda hard to describe this), these great paint modified images might be able to help:
    image1.png
    image2.png
    To put it simply, my questions are:
    1. Would a multi block sprite have to be multiple images, or can it be a single image that takes up two spaces and actually takes that space?
    2. Is it possible to make the sprite move in such a way?
    3. is it also possible to make this occour over several turns? (entirely different question, but interested in this anyway)
     
  2. Alistaire

    Alistaire Member

    You could make it like the Dragon's Breath spell, make a 96x64 sprite with only the right 64x64 part being used as image, so you can <anim> that image on a tile to make it also occupy the tile next to it.
    You could make this happen over several turns by adding a <effect type='trigger' amount='1'/> to make the next step trigger after one turn, much like Dragon's Breath. You'll have to use an un-anchored template (template without @) to make that happen.

    I have however never come up with a way to get the direction a spell was cast, and I don't think you want a spell that can only be cast to the left side of the player.
     
  3. zellking

    zellking Member

    Is it atleast possible to check which way a spell is cast?
    pretty important for anything that would use a sprite similar to the one i used in the example.
     
  4. bluehinter

    bluehinter Member

    No. Which can be quite frustrating.

    But to answer some of your other questions, there's no width limit on sprites, so they can take up more than one space, but they are always centered over a single tile, so you'll need to take that into account with your animations. For example, when making mine carts in my Monstrous mod, each frame was a whopping 352 x 224! While it did have to be targeted to a single square in the middle of the animation, the good news was that it still played, even if the center of effect was outside of the player's sight radius.

    Really, for traveling animation, your best bet is to go with a slow moving missile spell, as it's the only one where the animation loop automatically tracks from point A to point B. The downside to this is that there's no differentiating between what the missile looks like when it's traveling up/down/left/right. With something like a bicycle, your animation is going to look weird when moving any direction other than left to right. A unicycle, pogo stick, or any other means of travel that doesn't have such an obvious front and back to it is going to be much easier to pull off.
     
  5. zellking

    zellking Member

    Alright, well i won't be able to do what i intended due to the fact it requires a cone sprite coming from the player, but thanks for answering.