Jump to content

Photo

Multi-frame custom sword beam


  • Please log in to reply
25 replies to this topic

#1 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 27 September 2009 - 05:20 AM

I was sick and tired of having my swords shoot blinking replicas of themselves, so I made my own sword beam sprite based on MC. It is 4-frame and 8-bit, arranged in the tilesheet like this: U1, U2, U3, U4, R1, R2, R3, R4. The sword beam sprite is set to 4 frames, 2 speed, misc type 1 (like the sword sprites). Yet it always appears facing up when shooting left or right. What am I doing wrong?

#2 Joe123

Joe123

    Retired

  • Members

Posted 27 September 2009 - 11:21 AM

You'd need a script to make that work properly.

#3 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 27 September 2009 - 11:49 AM

GAH! STUPID NES LIMITATIONS!

Well, is there such a script? How hard would it be to make?

#4 knightmortua

knightmortua

    Experienced Forumer

  • Members

Posted 27 September 2009 - 12:21 PM

You could just replace the sword beam sprites by yours, no ?

#5 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 27 September 2009 - 06:34 PM

those are the splitting sprites, when your beam hits something.

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 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 September 2009 - 08:47 PM

Hm... well, I think Joe's right. But I'm not much into LWeapons, though, so he'll have to help you! lol

The flipping seems only to work with 1 tile sprites, btw. I have no idea why. Maybe a bug?

#7 Old-Skool

Old-Skool

    Hero of Time

  • Members
  • Location:Missouri

Posted 27 September 2009 - 08:59 PM

You don't NEED scripts to pull this off if you're using recent builds (or anything that promotes a semi-modern item editor.) What you do is create new weapons (in weapons/misc), and let those be identified as sword beams (multiple weapons/misc items too, if you want different beams for each sword). at this point, you don't need to do anything else with them. don't bother with statistics or anything like that: Just set the sprites you want to use (set it like you would, oh, an arrow. Set it on the vertical "up" beam tile you wanna use, and it'll know the horizontal right next to it as well.)

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 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 28 September 2009 - 08:07 AM

QUOTE(Old-skool @ Sep 28 2009, 05:59 AM) View Post
You don't NEED scripts to pull this off if you're using recent builds (or anything that promotes a semi-modern item editor.) What you do is create new weapons (in weapons/misc), and let those be identified as sword beams (multiple weapons/misc items too, if you want different beams for each sword). at this point, you don't need to do anything else with them. don't bother with statistics or anything like that: Just set the sprites you want to use (set it like you would, oh, an arrow. Set it on the vertical "up" beam tile you wanna use, and it'll know the horizontal right next to it as well.)

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
And the sword beam always faces up when fired to the side.


#9 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 28 September 2009 - 02:16 PM

Yeah, same thing happens to me. 'Cept the down facing sprites are correctly displayed (facing down). But when shot off from the side, they face up. (and, YES, I do have the sideways tiles right to the right of the up facing tiles.)

#10 Joe123

Joe123

    Retired

  • Members

Posted 28 September 2009 - 02:43 PM

It's a really easy script, just something like:
CODE
[pseudocode]
    //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:

CODE
    void AnimatedSwordBeams(){
        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 Old-Skool

Old-Skool

    Hero of Time

  • Members
  • Location:Missouri

Posted 28 September 2009 - 08:16 PM

I'll put up some screenshots. hang on.

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 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 28 September 2009 - 10:12 PM

Old-skool, I did all that, but I want it to be animated and not be unable to face the side. Joe123, thanks for the script, but how do you make a call to it?

#13 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 29 September 2009 - 03:26 AM

QUOTE(Joe123 @ Sep 28 2009, 03:43 PM) View Post

Stick that in after run() your global script, with a call to it somewhere in the while loop and it should sort you out.



#14 Joe123

Joe123

    Retired

  • Members

Posted 29 September 2009 - 05:27 AM

CODE
global script{
    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:
CODE
    void AnimateSwordBeams(){
        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:
CODE
Up1, Up2, ... Upn, Down1, Down2, ... Downn, Left1, Left2, ... Leftn, Right1, Right2, ... Rightn


#15 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 29 September 2009 - 08:37 AM

Okay, they both have the same problem: When shooting to the side, it faces up, but when I swing before it's gone it shifts to the next 4-frame animation. What gives?!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users