Jump to content

Photo

Introducing the newest script in ZC....


  • Please log in to reply
54 replies to this topic

#31 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 16 January 2007 - 10:58 PM

QUOTE(Beta Link @ Jan 16 2007, 10:53 PM) View Post

WOAH! I don't know who's better: You, or _L_!
I thought the first version of this script was awesome, but now, I must say...
OMG!!!

You think THIS version is awesome?! Wait until the Final Version, when you can make only one copy of the block at a time and even make it vanish if one's already on-screen! icon_biggrin.gif

Edit: By the way, here's my priorities for the Cane of Somaria script:

-Fix code so block can be "created" no matter which direction you're facing.
-Make code to prevent more than one block from being on the screen at one time. Make it so if one is on-screen, get rid of it and complete the rest of the code.

I also have another idea for it:

-Make "Cane of Somaria LttP" script. This script won't be much different from the other one, but instead of simply removing one block and placing another if one is already on-screen, "spawn" magic going in 4 directions when previous block is "destroyed" and end script. Simple, isn't it?

To make the script destroy a Block is one is already on-screen when the cane is used, I'm modifying a few things in the script. For starters, SomariaBlockX and SomariaBlockY are being moved to void run() so they'll be declared at script runtime, but no value will be set to them. To compensate for this, ALL direction codes write to both SomariaBlockX and SomariaBlockY, whether they move the block out of Link's X or Y row/column or not. Plus, I declare a new variable at runtime- SomariaCheck. This block will be set to 1 when a block is created, and when one is destroyed, it is set to 0. Thus, 0 = No Block, while 1 = Block on screen. icon_biggrin.gif At this new code, it first checks to see if SomariaCheck == 1. If not, it completes the rest of the code and eventually sets the variable to 1. If it IS equal to 1, however, it checks for solidity at the location of the Somaria Block via the variable "SomariaBlockPosition". However, the compiler reads for variables starting from the top. It doesn't matter if code is made to where a variable will never be undeclared even if its declaration is AFTER the code that first calls it- It'll still give a compiler error. Thus, I MUST declare this variable at runtime, just like the other three variables I placed there. If all goes well, no more than one block can be on the screen at once! However, I'm still not sure why the block can't be created unless you're facing north. It probably has to do with the fact that I kept doing things like "SomariaBlockY = SomariaBlockY - 32;". (That, by the way,is the part of the North Code that puts the Somaria Block 2 tiles away from Link.) It's supposed to be "SomariaBlockY = Link->Y - 32;"... and I already changed that for all of them. Now they'll all read from Link's position, not the position of the Block. (Even though they previously were set to Link's position anyways. icon_heh.gif ) So, feel free to contribute your ideas. I'll see if I can't add it into a copy of the script. icon_wink.gif Oh yeah, just don't put your requests/ideas here- Send them to my PM box instead. icon_razz.gif

Edited by Matthew, 16 January 2007 - 11:31 PM.


#32 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 17 January 2007 - 05:38 PM

There's no need to declare the variable types twice in your script. Unless you copy and pasted to get it out in a rush. icon_razz.gif But congrats, you outsmarted me. icon_thumbsup.gif Setting combos is better than setting FFCs. I have to go ask C-Dawg or Jman about the weird solidity problem in my script...

Edited by Fire Wizzrobe, 17 January 2007 - 05:38 PM.


#33 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 17 January 2007 - 06:20 PM

QUOTE(Fire Wizzrobe @ Jan 17 2007, 05:38 PM) View Post

There's no need to declare the variable types twice in your script. Unless you copy and pasted to get it out in a rush. icon_razz.gif But congrats, you outsmarted me. icon_thumbsup.gif Setting combos is better than setting FFCs. I have to go ask C-Dawg or Jman about the weird solidity problem in my script...

Actually, I copied and pasted because I thought it was the problem with my script. I forgot a right brace, which is why it only worked while facing north. Then I forgot some SomariaBlockY variables (If you look closely, the one of Link->Dir == 2 had TWO SomariaBlockX variables, one set to Link->X - 32 and the other set to Link->Y. XD). Now it all works, except for my code for destroying a block if you create one when there's one already on-screen. Saffith is kinda helping me figure out my problem now.

icon_razz.gif Outsmarting you doesn't feel satisfying. Which is good, because I'm not SUPPOSED to get any satisfaction from it. icon_lol.gif

#34 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 18 January 2007 - 12:59 PM

I know, another double-post. But this is big! Cane of Somaria version 3.0 is ready! And guess what? IT'S THE PERFECT OOA CANE OF SOMARIA! Here you go (It's a copy of what I posted at AGN, so meh):

No words can express the joy I have because... I JUST PERFECTED THE CANE OF SOMARIA. Granted, right now it's only the Oracle of Ages version, but I'll work on the LttP/FSA version at a later time, when making Wand Magic spawn in 4 different directions is a bit more feasible. So, without further ado, I bring you...

THE CANE OF SOMARIA: ORACLE OF AGES VERSION. This is version 3.0 of my Cane of Somaria script. It has EVERYTHING: Only one block can be on the screen at a time, it can be pushed, slashing it gets rid of it, and anything you'd expect the OoA Cane of Somaria to do (Minus any picking up, of course).

CODE
// Cane of Somaria (OoA version)- When used, this item will create a block in front of Link if the block in front of him isn't solid.
// If the combo is solid, this script does nothing.
// Variables:
// Cmb- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
// CmbC- The CSet of the new combo. Only use 0-11 for best results.
// CmbS- Secret Flag of the new combo.
// SomariaCheck- A special variable used only for checking if a Somaria Block is already on-screen. Creating a Block
// sets this Variable to 1. Destroying one sets it to 0. This variable is checked only by one function. DO NOT MESS WITH IT!!!!
// CmbR- The combo the Block resets to when SomariaCheck is set to 1 when you use this item.
// CmbRC- CSet the of the reset combo.
// CmbRS- Secret Flag of the reset combo.

import "std.zh"
item script CaneSomariaOoA
{
    int SomariaBlockX = 0;
    int SomariaBlockY = 0;
    int SomariaCheck = 0;
    int SomariaBlockPosition = 0;
    int CurScreen = 0;
    int LastScreen = 0;
    int CurMap = 0;
    int LastMap = 0;
    int Cmb = A;
    int CmbC = B;
    int CmbS = C;
    int CmbR = D;
    int CmbRC = E;
    int CmbRS = F;

    void run()
    {
        CurScreen = Game->GetCurScreen();
        CurMap = Game->GetCurMap();
        if (CurScreen != LastScreen)
        {
            SomariaCheck = 0;
        }
        else if (CurMap != LastMap)
        {
            SomariaCheck = 0;
        }
        if (SomariaCheck == 1)
        {
            SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
            if (Screen->ComboS [SomariaBlockPosition] == 15)
            {
                Screen->ComboD [SomariaBlockPosition] = CmbR;
                Screen->ComboC [SomariaBlockPosition] = CmbRC;
                Screen->ComboF [SomariaBlockPosition] = CmbRS;
                SomariaCheck = 0;
            }
        }
        if (Link->Dir == 0)
        {
            int BlockCheckY = Link->Y - 32;
            int BlockCheckX = Link->X;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockY = Link->Y - 32;
                SomariaBlockX = Link->X;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        else if (Link->Dir == 1)
        {
            int BlockCheckY = Link->Y + 32;
            int BlockCheckX = Link->X;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockY = Link->Y + 32;
                SomariaBlockX = Link->X;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }

        }
        else if (Link->Dir == 2)
        {
            int BlockCheckY = Link->Y;
            int BlockCheckX = Link->X - 32;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockX = Link->X - 32;
                SomariaBlockY = Link->Y;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        else if (Link->Dir == 3)
        {
            int BlockCheckY = Link->Y;
            int BlockCheckX = Link->X + 32;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if ( BlockRmndrY <= 8 )
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockX = Link->X + 32;
                SomariaBlockY = Link->Y;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        LastScreen = CurScreen;
        LastMap = CurMap;
        SomariaCheck = 1;
    }
}

Replace "A" with the number of the combo the Cane will "spawn". If you wish to have a poof, use the "poof" animation as the starting combo and have it cycle to the pushable block. Just... Be careful. This script places the block on layer 0, so try to put the ground on Layers 1 or 2, okay? And give the poof the push flag, too. icon_smile.gif "B" is the Cset of the starting combo. "C" is its Secret Flag. I have it set to 79 because in OoA, hitting the block with your Sword made it vanish. icon_wink.gif You can replace that with anything else if you want, EXCEPT THE PUSH FLAG. Unless you LIKE pushing non-solid ground. No fun, is it? That's why every pushable combo in the cycle MUST HAVE THE PUSH FLAG AS AN INHERENT COMBO. That way it vanishes. Since trigger flags remove themselves when you trigger them (even as normal flags), it's perfectly fine to use the Sword flag as a normal flag. However, no singular flags can be put on them this way. May I suggst 2.11's Slash->Next combo? Seriously, that'd be MUCH better (WHY DIDN'T I THINK OF THAT UNTIL JUST NOW?! XD). So, you can just leave "C" at 0 if you wish. "D" is the combo that is used to "remove" the Block if one is on the screen. Set it like you would Cmb, but remember, this one HAS to cycle back to normal, walkable ground! "E" is the CSet the combo uses when it "resets" to normal ground. Simple, no? Finally, "F" is, as you'd expect, the Secret Flag of the combo when "reset".

Oh no! Triple-post! Sorry, but I ran out of room on my last post. You understand, right? icon_smile.gif

If you create a block but leave the screen, SomariaCheck (the Variable that tells if a Block is on the screen or not) will stay at 1 (Block is on the screen). Thus, you'd expect the script to try to remove a Block that isn't there anymore, right? That's what the CurScreen, LastScreen, CurMap, and LastMap variables are for. If CurScreen doesn't equal LastScreen, SomariaCheck is set to 0. If it does, then if CurMap and LastMap don't equal each other, SomariaCheck is set to 0. If all are equal to their Last counterparts, nothing happens.

But what if you make a Block, leave the screen, and come back without making a block on the other screen? The Block will be gone, but SomariaCheck is still 1! Wouldn't that make the script try to "remove" a Block that isn't there? Not a chance! I figured that in case something went wrong in the checking of the value of SomariaCheck, another check would be needed just in case. I never knew that THIS is what it'd be for. After checking the value of SomariaCheck, if it's 1, the script ALSO checks for Total Solidity (Screen->ComboS[] == 15) at the SomariaBlock's last location. If total solidity is there, the values of CmbR, CmbRC, and CmbRS are placed there. If not, it obviously means you switched screens and came back, so there's no Block there. And it actually works. It then resets SomariaCheck back to 0 (Just for completeness and because of common sense- It's not really needed, but SomariaCheck is 1 if there IS a block on the screen, so common sense says that it doesn't need to be 1 anymore if a block isn't there. icon_wink.gif).

The rest places the block onto the screen. Now... I'd suggest you leave the script alone after this point, but just in case you wish to make the block spawn one tile in front of you instead, here you go:

CODE
// Cane of Somaria (OoA version)- When used, this item will create a block in front of Link if the block in front of him isn't solid.
// If the combo is solid, this script does nothing.
// Variables:
// Cmb- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
// CmbC- The CSet of the new combo. Only use 0-11 for best results.
// CmbS- Secret Flag of the new combo.
// CmbI- Inherent Flag of the new combo.
// CmbT- Combo type of the new combo.
// CmbS- Solidity of the new combo. Note: SOLIDITY USES THE BINARY SYSTEM. 1111 is total solidity, which is 15 in decimal.
// SomariaCheck- A special variable used only for checking if a Somaria Block is already on-screen. Creating a Block
// sets this Variable to 1. Destroying one sets it to 0. This variable is checked only by one function. DO NOT MESS WITH IT!!!!
// CmbR- The combo the Block resets to when SomariaCheck is set to 1 when you use this item.
// CmbRC- CSet the of the reset combo.
// CmbRS- Secret Flag of the reset combo.

import "std.zh"
item script CaneSomariaOoA
{
    int SomariaBlockX = 0;
    int SomariaBlockY = 0;
    int SomariaCheck = 0;
    int SomariaBlockPosition = 0;
    int CurScreen = 0;
    int LastScreen = 0;
    int CurMap = 0;
    int LastMap = 0;
    int Cmb = 2123;
    int CmbC = 10;
    int CmbS = 79;
    int CmbR = 0;
    int CmbRC = 2;
    int CmbRS = 0;

    void run()
    {
        CurScreen = Game->GetCurScreen();
        CurMap = Game->GetCurMap();
        if (CurScreen != LastScreen)
        {
            SomariaCheck = 0;
        }
        else if (CurMap != LastMap)
        {
            SomariaCheck = 0;
        }
        if (SomariaCheck == 1)
        {
            SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
            if (Screen->ComboS [SomariaBlockPosition] == 15)
            {
                Screen->ComboD [SomariaBlockPosition] = CmbR;
                Screen->ComboC [SomariaBlockPosition] = CmbRC;
                Screen->ComboF [SomariaBlockPosition] = CmbRS;
                SomariaCheck = 0;
            }
        }
        if (Link->Dir == 0)
        {
            int BlockCheckY = Link->Y - 16;
            int BlockCheckX = Link->X;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockY = Link->Y - 16;
                SomariaBlockX = Link->X;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        else if (Link->Dir == 1)
        {
            int BlockCheckY = Link->Y + 16;
            int BlockCheckX = Link->X;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockY = Link->Y + 16;
                SomariaBlockX = Link->X;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }

        }
        else if (Link->Dir == 2)
        {
            int BlockCheckY = Link->Y;
            int BlockCheckX = Link->X - 16;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if (BlockRmndrY <= 8)
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockX = Link->X - 16;
                SomariaBlockY = Link->Y;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        else if (Link->Dir == 3)
        {
            int BlockCheckY = Link->Y;
            int BlockCheckX = Link->X + 16;
            float BlockRmndrX = BlockCheckX % 16;
            if (BlockRmndrX <= 8)
            {
                BlockCheckX = BlockCheckX - BlockRmndrX;
            }
            else
            {
                BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
            }
            float BlockRmndrY = BlockCheckY % 16;
            if ( BlockRmndrY <= 8 )
            {
                BlockCheckY = BlockCheckY - BlockRmndrY;
            }
            else
            {
                BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
            }
            int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
            if (Screen->ComboS [BlockPosition] == 0)
            {
                SomariaBlockX = Link->X + 16;
                SomariaBlockY = Link->Y;
                float remainder = SomariaBlockX % 16;
                if (remainder <= 8)
                {
                    SomariaBlockX = SomariaBlockX - remainder;
                }
                else
                {
                    SomariaBlockX = SomariaBlockX + 16 - remainder;
                }
                float remainderY = SomariaBlockY % 16;
                if (remainderY <= 8)
                {
                    SomariaBlockY = SomariaBlockY - remainderY;
                }
                else
                {
                    SomariaBlockY = SomariaBlockY + 16 - remainderY;
                }
                SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
                Screen->ComboD [SomariaBlockPosition] = Cmb;
                Screen->ComboC [SomariaBlockPosition] = CmbC;
                Screen->ComboF [SomariaBlockPosition] = CmbS;
            }
        }
        LastScreen = CurScreen;
        LastMap = CurMap;
        SomariaCheck = 1;
    }
}


Same stuff as before, but all instances of the number "32" have been replaced with "16". icon_wink.gif Have fun, and a special demo will come soon featuring the Cane of Somaria and many things you can do with it! icon_biggrin.gif

Oh yeah, and as for the LttP/FSA-style Cane, I'm planning on doing that next. I'll most likely wait a ew betas, though. I've been working on this for about 5 or 6 days, and my parents are mad at me for being on all day everyday. Now that I finished this, I won't have to stay on all dang day! icon_lol.gif

#35 Limzo

Limzo

    _

  • Members

Posted 18 January 2007 - 01:51 PM

Matthew: THANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOU!!!!!!


I think that this is teh greatest thing evah!

#36 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 18 January 2007 - 01:59 PM

QUOTE(Limzo @ Jan 18 2007, 01:51 PM) View Post

Matthew: THANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOU!!!!!!
I think that this is teh greatest thing evah!

Wait until my Showcase Demo for the Cane- I'll show a ton of ways to use it, and not just as the normal Cane of Somaria we all know and love.... icon_wink.gif

#37 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 18 January 2007 - 03:18 PM

I'm still writing my own version of the script that does not require the map and screen checking and that can make the block disappear when the item is used twice in a row for learning purposes.

#38 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 18 January 2007 - 04:03 PM

QUOTE(Fire Wizzrobe @ Jan 18 2007, 03:18 PM) View Post

I'm still writing my own version of the script that does not require the map and screen checking and that can make the block disappear when the item is used twice in a row for learning purposes.

Okay. I only did map-and-screen checking because Saffith suggested it. icon_wink.gif He said that SomariaCheck would still be 1 if you left the current screen since I had to declare SomariaCheck and a few other variables as Golbal Variables so they wouldn't get reset. Though, if you look carefully, you'll see not one, but TWO lines that say "SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);". This is because when I tested it without that first command, SomariaBlockPosition was put at 0,0, for some reason unknown to me. So, I copied that line (since it was what I used for positioning the blok in the end), and wham, it worked! The code was complete! Now I have a few more things left to do:

-Make LttP/FSA Cane of Somaria, complete with magic going in four directions when the block is destroyed.
-Make some special modifications to the code for more Canes, as examples.
-Make short example quest to show some things you could do with this script.

...Yep. You get to explore a secret, hidden Cove, packed with Canes! The first one is a simple Cane of Somaria, but after that.... Well, I'll leave that as a secret. icon_wink.gif

Okay, here's a good question:

My example quest will be, of course, in a cave-like area (Take a look at Pirate's Cove in Paper Mario: The Thousand-Year Door. That place was a giant cave system!). Thus, nothing but cave walls. I want to use the DoR Tileset for this (I knew it was a good idea to keep it! icon_biggrin.gif), but... The cave wall tiles are the LttP cave tiles. XD There will be no real overworld, just a giant cave, a ton of Canes, and a few bosses. So, should I use the LttP Tileset because it's aready got Cane of Somaria and Somaria Block tiles in it, or should I use DoR because of the looks? I don't care about simplicity or anything- I want the place to look like it's a giant, PEACEFUL cavern, much like Pirate's Cove from PM:TTYD (Take out the enemies and traps (spikes and whirlpools), and it IS peaceful). I don't want it to look like one of LttP's dark caves.

#39 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 18 January 2007 - 04:20 PM

Looking at it again... it seems those screen checks are required. My bad. What does yours do when the item is used twice?

Edited by Fire Wizzrobe, 18 January 2007 - 04:20 PM.


#40 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 18 January 2007 - 04:30 PM

QUOTE(Fire Wizzrobe @ Jan 18 2007, 04:20 PM) View Post

Looking at it again... it seems those screen checks are required. My bad. What does yours do when the item is used twice?

It sets the features of the combo at the location of the SomariaBlock to the values of CmbR (For the combo's looks), CmbRC (For the Combo's CSet), and CmbRS (For the combo's Secret Flag). Then it sets SomariaCheck to 0 as per my common sense. It's not REQUIRED, but it just seems right when 0 means "No Block" and 1 means "Block on the screen". Why would I leave it at 1 if the block is no longer there? Oh, and then it finishes the rest of the script normally. icon_smile.gif And yes, I tested it before I released it, and it WORKS.

Oh drat. I forgot something. A sound is supposed to play when you create a Block. I FORGOT TO DO THAT. O_o

#41 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 18 January 2007 - 09:59 PM

QUOTE
Oh drat. I forgot something. A sound is supposed to play when you create a Block. I FORGOT TO DO THAT. O_o


...Well, it still works, right? Sound effects aren't that important. It's still an awesome script, believe me. icon_razz.gif One thing this could be used for, is for secrets. You could make the block, and push it onto a special tile so it activates a secret. You could do that for secret dungeons if you don't have to get the Cane in your quest, or if your quest includes the Cane as a main item, it could be a non-secret dungeon. icon_lol.gif But remember, who said the combo you spawn with the Cane has to be a pushable one? You could make it spawn (or un-spawn) a hole in ice, or... Land on lava... Or... Ah, well, some other stuff! icon_razz.gif

#42 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 18 January 2007 - 10:13 PM

QUOTE(Beta Link @ Jan 18 2007, 09:59 PM) View Post

...Well, it still works, right? Sound effects aren't that important. It's still an awesome script, believe me. icon_razz.gif One thing this could be used for, is for secrets. You could make the block, and push it onto a special tile so it activates a secret. You could do that for secret dungeons if you don't have to get the Cane in your quest, or if your quest includes the Cane as a main item, it could be a non-secret dungeon. icon_lol.gif But remember, who said the combo you spawn with the Cane has to be a pushable one? You could make it spawn (or un-spawn) a hole in ice, or... Land on lava... Or... Ah, well, some other stuff! icon_razz.gif

Right. And here's the thing: MY MODIFICATIONS TO THE SCRIPT WILL MAINLY BE THAT FOR NO SECRETS. icon_razz.gif Remember, this script is modular, so you could do VARIOUS things with it, like only spawn a combo if it spawns on a solid combo, like for a cave or something, or make it spawn only on a certain combo type, like for dive warps or swim warps. OR EVEN MAKE RANDOM EFFECTS! Speaking of which, I'm going to try to make a cool little hammer. It's called "Mystery Mallet". I set a value to a random number, and depending on what that number is, different things happen! Water could freeze! A Somaria Block could be formed! The Hammer could do nothing but its normal effect! It's all up to luck (or, if you prefer, probability)! icon_biggrin.gif I have no other ideas, though. icon_unsettled.gif

#43 MarioBrosCom

MarioBrosCom

    Adept

  • Members
  • Real Name:Stylianos
  • Location:Canada

Posted 19 January 2007 - 12:18 PM

If I had any interest in scripts at all, I would be happy...

#44 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 20 January 2007 - 12:41 PM

Oh noes!!! I tried to compile it in beta 119, but it didn't work! I did everything right. I made sure it had a .z file extension thingy, I put it into Z-Quest using "Compile Z-Script", and it didn't work. I think it's a bug in 119, but I'm not 100% sure. icon_confused.gif

#45 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 20 January 2007 - 12:45 PM

QUOTE(Beta Link @ Jan 20 2007, 12:41 PM) View Post

Oh noes!!! I tried to compile it in beta 119, but it didn't work! I did everything right. I made sure it had a .z file extension thingy, I put it into Z-Quest using "Compile Z-Script", and it didn't work. I think it's a bug in 119, but I'm not 100% sure. icon_confused.gif

What errors did it give you? I compiled it just fine in beta 16c. icon_razz.gif


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users