User Tag List

Results 1 to 7 of 7

Thread: Sparkle sprites

  1. #1
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,962
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.55%

    Sparkle sprites

    Is it possible to create arrow or boomerang weapons that act just like non-scripted versions with sparkles?

    Anyone done this yet?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    Keese ScaryBinary's Avatar
    Join Date
    Dec 2006
    Age
    49
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    919
    Level
    10
    vBActivity - Bars
    Lv. Percent
    53.42%

    Re: Sparkle sprites

    **EDIT**
    Don't waste your time reading this post! Scroll down!
    **EDIT**

    ...OK, I don't understand what you're asking. I thought I had an answer for you, then I read your question again, and then I realized that I was waaaaay off (at least I think).

    So...you just want to create an arrow LWeapon? How do the sparkles fit in? My scripted arrows have sparkles (on impact)....?

    I ran a little experiment, and it looks like when you use CreateLWeapon(LW_ARROW) what you get is the "Arrow 1 (Wooden)" item. Are you trying to get a different arrow?

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,307
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.22%

    Re: Sparkle sprites

    Silver arrows and Gold arrows have a little trail of sparklies that follow them across the screen.

  4. #4
    Keese ScaryBinary's Avatar
    Join Date
    Dec 2006
    Age
    49
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    919
    Level
    10
    vBActivity - Bars
    Lv. Percent
    53.42%

    Re: Sparkle sprites

    Quote Originally Posted by Joe123 View Post
    Silver arrows and Gold arrows have a little trail of sparklies that follow them across the screen.
    Ah....I see.

    Then then for the wooden arrow, set the Sparkle Spite to the "MISC: Arrow 2 (Silver) Sparkle" or the gold one. I tried that and it worked.

    Kind of screws up your wooden arrows though, so again I think you'd have to create a custom arrow item that was a copy of the original wooden arrow.

    The issue (or at least *my* issue ) is that it seems the LW_ARROW value always spawns the Arrow 1 (Wooden) arrow. I don't know of any way to have the CreateLWeapon() method spawn a custom item, or a particular level of an item (like spawning a silver arrow instead of the wooden one)....There doesn't seem to be any relation between the value passed to CreateLWeapon() and the item that is spawned (for example, LW_ARROW is 8, and the Arrow 1 (Wooden) item is Item 13). So I think you're stuck spawning only the items allowed by the Great Developers.

    *EDIT*
    Interesting...I think, for arrows at least, you automatically spawn the level of weapon you have when you call CreateLWeapon? I started a quest with the gold arrow, and using CreateLWeapon(LW_ARROW) gave me the gold arrow - sparkles and all.

    O_O So it seems like you could create a custom arrow weapon, readjust the levels of the various arrows a bit, and somehow end up spawning your custom arrow using the LW_ARROW value...?

    Sorry this is all so jumbled up Gleeok. I'll try to go back and edit this a bit to clean it up.....later.

  5. #5
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,307
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.22%

    Re: Sparkle sprites

    Yes; when you spawn an LWeapon, you spawn the level of LWeapon you currently have.

  6. #6
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,962
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.55%

    Re: Sparkle sprites

    Quote Originally Posted by ScaryBinary View Post
    Ah....I see.

    *EDIT*
    Interesting...I think, for arrows at least, you automatically spawn the level of weapon you have when you call CreateLWeapon? I started a quest with the gold arrow, and using CreateLWeapon(LW_ARROW) gave me the gold arrow - sparkles and all.
    Wait, so you got it to work? Did the sparkles follow the arrow at angles also?

    Shit, I'll try it yet again...my problem might be something simple, like item properties or whatnot.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  7. #7
    Keese ScaryBinary's Avatar
    Join Date
    Dec 2006
    Age
    49
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    919
    Level
    10
    vBActivity - Bars
    Lv. Percent
    53.42%

    Re: Sparkle sprites

    Quote Originally Posted by Gleeok View Post
    Wait, so you got it to work? Did the sparkles follow the arrow at angles also?
    Sorry, I didn't try any weird angles, but the sparkles worked for up, down, left, and right.... All I did was create a new quest, and in the Init Data gave link gold arrows (you don't actually have to give him any amount, just make sure they're checked in the Equipment tab). Then I had a simple script that just spawned an LW_ARROW.

    I'll experiment a bit more post my script and results here in a minute.

    *EDIT*
    OK, I get sparkles with weird angles (really weird angles - apparently I don't quite understand the weapon->Angle property yet....but it worked well enough to prove a point). See pics below. I did find a limitation - originally I had intended to spawn three arrows. The spawning part worked, but only one of the arrows had sparkles at any given time. For example, if the arrow that had sparkles went off-screen, another arrow on-screen would suddenly get sparkles until it went off-screen, etc. So it seems like the engine can only render one sparkle trail at a time? Also note I didn't "flip" the tile appropriately.



    Here's my crappy test script. I had to comment out two of the arrows because of the sparkle anomaly noted above. Also my angles were a bit odd, but you get the idea. Don't forget to equip Link with a silver or gold arrow in the Init Data. The FFC script accepts an LW_ constant as the D0 argument (I used 8.0000, which is LW_ARROW).
    Code:
    import "std.zh"
    
    ffc script Test_LWeapon{
      void run(int LWeaponToCreate){
    
        lweapon LW_0;
        lweapon LW_p45;
        lweapon LW_n45;
    
        while(true){
    
          if ( Link->InputA ){
            // Spawn 3 projectile weapons. One in Link's "major" direction,
            // and then two more offset by +45 and -45 degrees.
            if ( Screen->NumLWeapons() == 0) {
              //LW_0 = Screen->CreateLWeapon(LWeaponToCreate);
              //LW_p45 = Screen->CreateLWeapon(LWeaponToCreate);
              LW_n45 = Screen->CreateLWeapon(LWeaponToCreate);
    
    //          LW_0->X = Link->X;
    //          LW_0->Y = Link->Y;
    //          LW_p45->X = Link->X;
    //          LW_p45->Y = Link->Y;
              LW_n45->X = Link->X;
              LW_n45->Y = Link->Y;
    
              // Let the game engine handle most of the computations.
    //          LW_0->DeadState = -1;
    //          LW_p45->DeadState = -1;
              LW_n45->DeadState = -1;
    
              // Figure out directions and angles.
              // Make sure the weapon is oriented properly.
              // THE FOLLOWING ASSUMES THE CLASSIC TILESET.
    //          LW_0->Dir = Link->Dir;
    //          LW_p45->Dir = Link->Dir;
              LW_n45->Dir = Link->Dir;
    //          LW_p45->Angular = true;
              LW_n45->Angular = true;
              if(Link->Dir == DIR_LEFT){
    //            LW_0->Angle = 180;
    //            LW_p45->Angle = 225;
                LW_n45->Angle = 135;
              }
              else if(Link->Dir == DIR_UP) {
    //            LW_0->Angle = 90;
    //            LW_p45->Angle = 135;
                LW_n45->Angle = 45;
              }
              else if(Link->Dir == DIR_DOWN) {
    //            LW_0->Angle = 270;
    //            LW_p45->Angle = 315;
                LW_n45->Angle = 225;
              }
              else if(Link->Dir == DIR_RIGHT) {
    //            LW_0->Angle = 0;
    //            LW_p45->Angle = 45;
                LW_n45->Angle = 315;
              }
    
            } // NumWeapons == 0
          } // InputA
    
          Waitframe();
    
        } // Inf Loop
      }
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social