Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Linear spell that travels across the tiles without animation alteration.


Tai Kamiya
 Share

Recommended Posts

Hi there!

I saw the video above and thought, what kind of alterations should I do in the Linear Spells script that make this possible? I mean, a spell that don't show its animation in only one tile, but across the tiles that it pass by. Well, the video:

[http://www.youtube.com/watch?feature=player_embedded&v=P8h_cblixo4](http://www.youtube.com/watch?feature=player_embedded&v=P8h_cblixo4)

Thanks for the attention, ciao~
Link to comment
Share on other sites

> Use ElapsedTime and change the location by it's x or y axis (dependent on the direction the player is facing obviously) after each amount of time has passed

,

If I do this, will the sprite that show in the spell animation be the same in each tile? I think that something like a frame for the first tile, and an another one for the others tiles. Like the characters sprites…
Link to comment
Share on other sites

> You can make it that way.

Using that scheme of ElapsedTime and y/x locations change? I must learn programming, 'cause I don't even know where to start. XD

Well, here's the code that I think that have relation with this:

```

Case SPELL_TYPE_LINEAR

DidCast = True

Linha = 1

Do While Linha < Spell(SpellNum).AoE

Select Case GetPlayerDir(Index)

Case DIR_UP

Calculate = GetPlayerY(Index) - Linha

If Calculate <= 0 Then Exit Sub

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - Linha).Type = TILE_TYPE_BLOCKED Then Exit Sub

SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - Linha

IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index) - Linha

Case DIR_DOWN

Calculate = GetPlayerY(Index) + Linha

If Calculate >= Map(Linha).MaxY Then Exit Sub

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + Linha).Type = TILE_TYPE_BLOCKED Then Exit Sub

SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + Linha

IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index) + Linha

Case DIR_LEFT

Calculate = GetPlayerX(Index) - Linha

If Calculate <= 0 Then Exit Sub

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - Linha, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index) - Linha, GetPlayerY(Index)

IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index) - Linha, GetPlayerY(Index)

Case DIR_RIGHT

Calculate = GetPlayerX(Index) + Linha

If Calculate <= 0 Then Exit Sub

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

SendAnimation GetPlayerMap(Index), Spell(SpellNum).SpellAnim, GetPlayerX(Index) + Linha, GetPlayerY(Index)

IsUseLinear Index, SpellNum, vital, GetPlayerMap(Index), GetPlayerX(Index) + Linha, GetPlayerY(Index)

End Select

Linha = Linha + 1

Loop

```

Where "Linha" means line. Where I should specify to use the frame scheme?
Link to comment
Share on other sites

This is doable, during the main engine render loop, if the projectiles current X/Y position is less than the destination X/Y position, then offset it by a pixel over and over until it lands at the new location.

I can whip this up as a tutorial on Wednesday when I finish my night rotations.
Link to comment
Share on other sites

> This is doable, during the main engine render loop, if the projectiles current X/Y position is less than the destination X/Y position, then offset it by a pixel over and over until it lands at the new location.
>
> I can whip this up as a tutorial on Wednesday when I finish my night rotations.

Then I'll wait for the tut, my thanks, Rob! :3
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...