Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Fast Sword Beam

9 replies · 2,115 views · Started 17 June 2008

I want to have a "Lightning Sword", but I can't find out how to change the speed of the sword beam on a per-item basis.

Don't know if you can. I could maybe write a script for you though, if you were to accept it in the form of a script. It's a two or three liner.

item script swordbeam{
void run(int sp, int dm, int t, int c, int f, int fs){
int d = Link->Dir;
int x; int y;
if(f == 0) f = 1;
lweapon s = Screen->CreateLWeapon(2);
s->OriginalTile = t+d*f;
s->Tile = t+d*f;
s->CSet = c;
s->NumFrames = f;
s->ASpeed = fs;
s->Dir = d;
s->Damage = dm;
s->Step = sp;
if(d>1) x = (((d-2)*2)-1)*16;
if(d<2) y = ((d*2)-1)*16;
s->X = Link->X+x;
s->Y = Link->Y+y;
}
}

Tiles must be set up 'Up, Down, Left, Right' on the tilesheet.
You have to set them all up, the script doesn't use flips or anything silly like that.

  • D0 : Speed of sword beam
  • D1 : Damage of sword beam
  • D2 : First tile of sword beam sprites in tilesheet
  • D3 : Cset of sword beam
  • D4 : Number of frames of animation
  • D5 : Speed of animation

Don't know if you can. I could maybe write a script for you though, if you were to accept it in the form of a script. It's a two or three liner.

I'm fine with that. When my game is finished, you'll be on the credits list.

Edit: Never mind, Joe123 replied 1 sec. before I did.

Eh, mine would have been more simple and just replaced the sword beams based on the level of the last sword swung. But that works too and is actually a bit more flexible.

Oh, you'dve loaded the sword beams already on the screen and changed their speeds?

I'd never have thought to do that.

Ummm... Could you make it so that the beam "explosion" uses separate tiles?
Like this: UP; DOWN; LEFT; RIGHT; UP, LEFT; UP, RIGHT; DOWN, LEFT; DOWN, RIGHT.

Beam explosion?

This script doesn't have anything to do with beam explosions, I don't know how they work, sorry.
I don't think they're too easy to script up; they're rather hard coded I believe.

Beam shards (as they are more properly known) consist of the third and fourth tiles in the sword beam's weapon sprite. You can't change that.

Although you could change the sword beam's graphic just before it became invalid, so that it used the tiles you wanted, right?