Jump to content

Photo

Introducing the newest script in ZC....


  • Please log in to reply
54 replies to this topic

#16 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 12:12 PM

QUOTE(Limzo @ Jan 15 2007, 11:55 AM) View Post

I absolutely love this thing, and cannot wait to try it out Matthew.
Why not make it only useable once per screen?

I especially like your ideas in the bottom post, and might end up using one of them. Here's a new one to go along with your Block all enemies barrier thing though, what if it follows Link around, and stays there for 30 seconds (1,800 tics) or something before dissapearing, and looks like a fairy. INSTANT NAVI THING MONSTER!

EDIT: Sorry, I am a n00B whom doesn't know how to attatch a script to an item.

Limzo, there's no way to box the player in with this script. You weren't listening. THE FFC MOVES EVERYTIME YOU USE THE CANE. IT DOES NOT CREATE A NEW ONE WHEN YOU USE THE CANE AND LEAVE THE OLD ONE BEHIND. I'll give an example later. And no, I won't make it useable only once per screen. For one, I don't think it's possible yet, and two, there's no point!

Oh wait, you got confused by my questions. icon_lol.gif Here's the questions from Radien I answered:

1: "So it's a FFC?"
2: "Does that mean it doesn't override the combo it lands on?"
3: "And does that mean it doesn't leave an undercombo?"
4: "Also, if the old block stays where it is when you create a new block (does it?), it'd be possible for the player to box themselves in."

Number 5 was obvious. It was a reply to Radien's statement that it isn't very useable. But I'm working on that! I decided to just make a seperate script for the "solidity" of the block (it's still part of the "CaneSomaria" file, but it's placed after the "CaneSomaria" script ends. icon_wink.gif). I'm going to test it in a little bit. It's a modification of C-Dawg's pseudo-solidity for his multiblock trigger. icon_wink.gif

Edit: Here's how you attach a script to an item:

1: When you compile the script, instead of using "ffc script script_name", replace "ffc" with "item".
2: Place it in one of the slots in the Item tab.
3: Edit an item and give it that script.

Done. It'll take on the characteristics of the item you gave the script to, though!

Edited by Matthew, 15 January 2007 - 12:14 PM.


#17 Limzo

Limzo

    _

  • Members

Posted 15 January 2007 - 12:15 PM

Hey, thanks Matthew, I read it a bit quickly to take all the info in properly the first time, but I get it now, thanks.

But still, how do I attatch a script to an item? And do you like my fairy idea?

#18 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 12:32 PM

QUOTE(Limzo @ Jan 15 2007, 12:15 PM) View Post

Hey, thanks Matthew, I read it a bit quickly to take all the info in properly the first time, but I get it now, thanks.

But still, how do I attatch a script to an item? And do you like my fairy idea?

I just told you how to attach a script to an item. And your Fairy idea is nice, but... You'd have to modify the block EVEN MORE! And I mean in the script.... icon_razz.gif

Okay, I'm getting irritated. I copy some solidity code from C-Dawg's script, and I modify it so when like it right next to it, he can't walk into it. Problem is, ZC completely ignores the script. However, this gives me the chance to test out my theory... Heh heh heh...

#19 Limzo

Limzo

    _

  • Members

Posted 15 January 2007 - 12:35 PM

QUOTE(Matthew @ Jan 15 2007, 05:32 PM) View Post

I just told you how to attach a script to an item. And your Fairy idea is nice, but... You'd have to modify the block EVEN MORE! And I mean in the script.... icon_razz.gif

Okay, I'm getting irritated. I copy some solidity code from C-Dawg's script, and I modify it so when like it right next to it, he can't walk into it. Problem is, ZC completely ignores the script. However, this gives me the chance to test out my theory... Heh heh heh...

Hey, I saw what you did you cheeky post editor. icon_wink.gif

Thanks, and I would find it easy to make the script follow link though, scripts for that already existé.

But sorry, I can't really help you with the solidity, it was supposed to be added in Beta 12.

EDIT: So I have to manually type the script out into the editor? Man that sucks! *spends forever*
EDIT AGAIN: Never mind, I found out how to do it now.

EDIT EDIT EDIT: Gah! How can I use this if I can't add it to the subscreen? What is it's item class number and class level?

Edited by Limzo, 15 January 2007 - 12:59 PM.


#20 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 01:11 PM

If you want to use the item, replace one of the items you can use AND see in the subscreen. I chose the Wand. DON'T MODIFY ANYTHING BUT THE SCRIPT NUMBER AND SFX NUMBER. The SFX is optional, by the way.

#21 Limzo

Limzo

    _

  • Members

Posted 15 January 2007 - 01:19 PM

What do you mean, "replace"? How the heck?

#22 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 01:24 PM

QUOTE(Limzo @ Jan 15 2007, 01:19 PM) View Post

What do you mean, "replace"? How the heck?

Sigh... Find an item you don't plan on using normally in your quest (make sure that if it has other levels that you don't use THEM, either). Open its editor and go to the Action tab. Put the number of the slot you put the Item script in. Click okay. How hard is that to understand?

#23 Limzo

Limzo

    _

  • Members

Posted 15 January 2007 - 01:25 PM

Oooh. I'm dumb, I tried something so different

#24 Limzo

Limzo

    _

  • Members

Posted 16 January 2007 - 12:17 PM

Ahar! Now I can see why you need solidity!

#25 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 16 January 2007 - 01:57 PM

I have good news and bad news. The good news is, I believe a piece of code I have for solidity is actually working. The bad news? I can't test my theory, because of a bug in Beta 16c that resets any script attached to an FFC to 0, which is "No Script". That means that no matter what, the FFC won't work until that bug is fixed. But have no fear! I reported it, and even if it's NOT a bug, I'm sure the devs will take a look at it. icon_smile.gif So if the devs tackle this quickly, you could expect this code to at least make the FFC solid by the end of this day. icon_wink.gif

#26 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 16 January 2007 - 05:53 PM

It was unnecessary to intergrate your two scripts anyways.

Edited by Fire Wizzrobe, 16 January 2007 - 06:00 PM.


#27 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 16 January 2007 - 09:53 PM

Okay, update time! Please join me in welcoming.... Cane of Somaria v2.0!

CODE
// Cane of Somaria- Changes attributes of combo 2 tiles in front of Link if it is not solid.
// If the combo is solid, this script does nothing.
// Variables:
// d0- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
// d1- The CSet of the new combo. Only use 0-11 for best results.
// d2- Secret Flag of the new combo.
// d3- Inherent Flag of the new combo.
// d4- Combo type of the new combo.
// d5- Solidity of the new combo. Note: SOLIDITY USES THE BINARY SYSTEM. 1111 is total solidity, which is 15 in decimal.

import "std.zh"
item script CaneSomaria
{
    void run()
    {
        int SomariaBlockX = Link->X;
        int SomariaBlockY = Link->Y;
        int d0 = 2123;
        int d1 = 10;
        int d2 = 61;
        int d3 = 79;
        int d4 = 0;
        int d5 = 15;
        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 = SomariaBlockY - 32;
                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] = d0;
                Screen->ComboC [SomariaBlockPosition] = d1;
                Screen->ComboF [SomariaBlockPosition] = d2;
                Screen->ComboI [SomariaBlockPosition] = d3;
                Screen->ComboT [SomariaBlockPosition] = d4;
                Screen->ComboS [SomariaBlockPosition] = d5;
            }
        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 = SomariaBlockY + 32;
                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] = d0;
                Screen->ComboC [SomariaBlockPosition] = d1;
                Screen->ComboF [SomariaBlockPosition] = d2;
                Screen->ComboI [SomariaBlockPosition] = d3;
                Screen->ComboT [SomariaBlockPosition] = d4;
                Screen->ComboS [SomariaBlockPosition] = d5;
            }

        }
        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 = SomariaBlockX - 32;
                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] = d0;
                Screen->ComboC [SomariaBlockPosition] = d1;
                Screen->ComboF [SomariaBlockPosition] = d2;
                Screen->ComboI [SomariaBlockPosition] = d3;
                Screen->ComboT [SomariaBlockPosition] = d4;
                Screen->ComboS [SomariaBlockPosition] = d5;
            }
        }
        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 = SomariaBlockX + 32;
                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] = d0;
                Screen->ComboC [SomariaBlockPosition] = d1;
                Screen->ComboF [SomariaBlockPosition] = d2;
                Screen->ComboI [SomariaBlockPosition] = d3;
                Screen->ComboT [SomariaBlockPosition] = d4;
                Screen->ComboS [SomariaBlockPosition] = d5;
            }
        }
    }
}
}


Instead of an FFC, this script instead uses an actual combo. It currently can't "spawn" one unless you're facing north, though. I can't fix it. If you can, please fix it. I'm baffled. O_o Anyways.... Enjoy. There's not much you need to know, 'cept with variable d3. The value is binary converted to decimal, so 0 is no solidity and 15 is total solidity. Experiment, why dontcha! icon_lol.gif Oh yeah, and the block won't spawn on a solid combo. icon_biggrin.gif I made the code for that by modifying other code in the script, so it's technically something I made by myself. icon_heh.gif

Uses:

-Average Cane of Somaria.
-Modify some code that handles when a block can or can't spawn (I.e., the parts that say "if(Screen->ComboS (BlockPosition) == 0"), the solidity of the combo itself, and the combo type (and flags, if you wish), and you can make an item that "spawns" a Cave onto a fully-solid block. icon_wink.gif
-Wanna make a Whirlpool? icon_razz.gif You'd probably need to also add a code to check for a certain combo type, though.
-Ummm.... Applesauce? icon_biggrin.gif icon_lol.gif Just kidding. Try adding the No Enemies flag to a walkable combo and see what happens! icon_razz.gif
-Much, much, much, much more! icon_biggrin.gif

So experiment with my script already! This is what you've been waiting for! It's basically complete as-is! Just... give me the code if you manage to make it work no matter what direction you're facing, okay? icon_wink.gif

By the way, to all you scripting n00bs out there, if you wanna use this code, copy it, paste it into notepad, and save it as a .z file, okay? icon_smile.gif

#28 Revfan9

Revfan9

    Hero of Time

  • Banned
  • Real Name:Dr. Pajamas
  • Location:In front of a screen

Posted 16 January 2007 - 10:18 PM

To fix the direction thing, add something in there about checking LINKDIR, not sure what the Zscript equivilant of that is.

#29 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 16 January 2007 - 10:20 PM

QUOTE(Revfan9 @ Jan 16 2007, 10:18 PM) View Post

To fix the direction thing, add something in there about checking LINKDIR, not sure what the Zscript equivilant of that is.

That'd obviously be Link->Dir, which is used FOUR TIMES IN MY SCRIPT. Just look at it!

#30 Bayta

Bayta

    Follower of Destiny

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

Posted 16 January 2007 - 10:53 PM

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!!!

Oh, btw, is this an ffc script, or an item script?

Edited by Beta Link, 16 January 2007 - 10:58 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users