Multi-frame custom sword beam
#1
Posted 27 September 2009 - 05:20 AM
#2
Posted 27 September 2009 - 11:21 AM
#3
Posted 27 September 2009 - 11:49 AM
Well, is there such a script? How hard would it be to make?
#4
Posted 27 September 2009 - 12:21 PM
#5
Posted 27 September 2009 - 06:34 PM
In 2.5 you can select which weapon/misc sprites are used for the sword, the sword slash, and the sword beam. They don't have to be the same.
#6
Posted 27 September 2009 - 08:47 PM
The flipping seems only to work with 1 tile sprites, btw. I have no idea why. Maybe a bug?
#7
Posted 27 September 2009 - 08:59 PM
You don't need to fill out AAAANNNNYYYTHING else for this element, and it really won't matter, as long as it exists in the right list, and you've set the tiles for it appropriately. (though you might wanna... you know... label them.)
Once you've done THAT, then in the item editor, you can choose from the whole Weapons/misc list what you want to use for a beam. So, select the sword beams you made in that list, and there you go. Repeat for your other swords if desired.
#8
Posted 28 September 2009 - 08:07 AM
You don't need to fill out AAAANNNNYYYTHING else for this element, and it really won't matter, as long as it exists in the right list, and you've set the tiles for it appropriately. (though you might wanna... you know... label them.)
Once you've done THAT, then in the item editor, you can choose from the whole Weapons/misc list what you want to use for a beam. So, select the sword beams you made in that list, and there you go. Repeat for your other swords if desired.
That's what I did.
- Tilesheet: U1 U2 U3 U4 R1 R2 R3 R4 (all 8Bit)
- Sprites: Name: Sword beam. Set to U1, 4-frame 2-speed
- Wep. editor: Beam sprite: Sword beam
#9
Posted 28 September 2009 - 02:16 PM
#10
Posted 28 September 2009 - 02:43 PM
//in global script
loopthroughlweapons{
if(l->Misc[something] == 0) l->Misc[something] = l->OriginalTile;
l->OriginalTile = l->Misc[something]+l->Dir*l->NumFrames;
}
[/pseudocode]
EDIT:
And for a more helpful, less pseudo kinda code:
for(int i=0;i<Screen->NumLWeapons();i++){
lweapon l = Screen->LoadLWeapon(i);
if(l->ID != LW_BEAM) continue;
if(l->Misc[0] == 0) l->Misc[0] = l->OriginalTile;
l->OriginalTile = l->Misc[0]+l->Dir*l->NumFrames;
}
}
Stick that in after run() your global script, with a call to it somewhere in the while loop and it should sort you out.
#11
Posted 28 September 2009 - 08:16 PM
EDIT: Zquest will not take screenshots when you're looking at a window in it. That's... yeah that's nice. So do this, because I get the feeling you mistook what I said before. (and it wasn't written well to begin with.)
Lemme try this again. I'm using b1030 in this.
1: Your beam tiles should be three tiles in width: One facing up, one facing right, and one to represent the four diagonal explosions.your beams cannot be animated.
2: Quest --> Graphics --> Sprites --> Weapons/Misc.
3: You will be shown a list representing various attacks, projectiles, magic things, effects, etc. Scroll to the very bottom, where you'll see blanks labeled "z" then a number. click on one and open the editing window for it.
4: First off, name it "sword beam". Then, for the sprite, use the first of the three tiles you made. (remember, these three tiles must be consecutive.) Set the misc. type to "3" to effect the explosion sprite if desired. Since you're using 8 bit mode, I won't tell you to set the flash (you must have good reasons here I'm sure.) hit OK
5: Go to Quest --> Items, and select the desired sword. click the "action" tab. look on the bottom half of this window, and look for a dropdown labeled "Beam sprite" click on it, and it will take you through the several sprites of the weapons/misc mode you were in before. Select "sword beam (you just made this remember) from this list, and hit OK for the sword item.
Edited by Old-skool, 28 September 2009 - 08:33 PM.
#12
Posted 28 September 2009 - 10:12 PM
#14
Posted 29 September 2009 - 05:27 AM
void run(){
while(true){
//there are other function calls here
AnimateSwordBeams();
Waitframe();
}
}
//There are other function declarations here
void AnimateSwordBeams(){
for(int i=0;i<Screen->NumLWeapons();i++){
lweapon l = Screen->LoadLWeapon(i);
if(l->ID != LW_BEAM) continue;
if(l->Misc[0] == 0) l->Misc[0] = l->OriginalTile;
l->OriginalTile = l->Misc[0]+l->Dir*l->NumFrames;
}
}
}
EDIT:
On second thoughts, this function may be better:
for(int i=0;i<Screen->NumLWeapons();i++){
lweapon l = Screen->LoadLWeapon(i);
if(l->ID != LW_BEAM || l->Misc[0] != 0) continue;
l->OriginalTile += l->Dir*l->NumFrames;
l->Tile += l->Dir*l->NumFrames;
l->Misc[0]++;
}
}
Try both and tell me what you think.
EDIT2:
Oh yeah, for both of them your tiles have to go:
#15
Posted 29 September 2009 - 08:37 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users