Jump to content

Photo

Item-M1: Stopwatch


  • Please log in to reply
7 replies to this topic

#1 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 17 February 2007 - 12:10 PM

Well, it wasn't hard to make, but I'm releasing it anyways, as a miniscript. Stopwatch creates a Clock item, moves it to your location, then sets a certain variable to the next-highest number. Once you use it 3 times..... Poof. It's gone before your very eyes. Now.... Since "Link->Item[]" requires an Item ID, and since you guys might put this script on a different item than I did (Hammer, since the subscreen editor crashes when you open it, though I wanted CoB. =/), I set a variable for the ID of the item. Set that variable to the ID of the item you put this item on! And no, I won't tell you what the IDs are, because they're in the file called "std.zh". Check them yourself, I'm not doing all the work for you (besides the script itself, mind you). Be grateful I even made this- I once never wanted to do this. And yes, it WAS a request... One of my first ones, I might add. icon_wink.gif

CODE
// Stopwatch- Just a simple script that creates a Clock at Link's position when used. 3 uses ONLY.
// Changable Variables:
// ID- This is the Item ID for the item this script is attached to. Please look it up in std.zh. It can't
// be predefined because you might give this script to a different item than I did. Sorry.

import "std.zh"
item script Stopwatch
{
    int ScrnItems = 0;
    int ModItem = 0;
    int Used = 0;
    int ID = 0;

    void run()
    {
        if (Used == 0)
        {
            Screen->CreateItem(4);
            ScrnItems = Screen->NumItems();
            item ModItem = Screen->LoadItem(ScrnItems);
            ModItem->X = Link->X;
            ModItem->Y = Link->Y;
            Used = 1;
        }
        else if (Used == 1)
        {
            Screen->CreateItem(4);
            ScrnItems = Screen->NumItems();
            item ModItem = Screen->LoadItem(ScrnItems);
            ModItem->X = Link->X;
            ModItem->Y = Link->Y;
            Used = 2;
        }
        else if (Used == 2)
        {
            Screen->CreateItem(4);
            ScrnItems = Screen->NumItems();
            item ModItem = Screen->LoadItem(ScrnItems);
            ModItem->X = Link->X;
            ModItem->Y = Link->Y;
            Used = 0;
            Link->Item[ID] = false;
        }
    }
}

Didn't take me that long at all. I only begun it just a few minutes ago, to tell you the truth. icon_razz.gif Have fun with this, and if you use it, make it either hard to get, or very expensive. This thing could make Bosses WAY too easy. Might want to disable this for boss fights, or, take out everything but "Link->Item[ID] = false", and just turn that into an FFC script that takes this item away from you permanently for Boss fights. :O It's a fun way to stop people from using this item to make bosses super-easy. Enjoy. (By the way, "Link->Item[ID]" returns true if Link has the item with the ID in the brackets. If you put "Link->Item[ID] = true", you'd give him the item instantly. Placing false in place of true takes it away. And no, using that to give him the Clock won't work, because, as far as I know, it's only for items you can KEEP, thus the "You have it or you don't". If you don't keep it, you never "have" it. icon_razz.gif)

#2 frankie

frankie

    Doyen(ne)

  • Members
  • Real Name:Frankie
  • Location:Why you want too know?

Posted 17 February 2007 - 01:20 PM

WOW! This could help alot of peaple!Thanks...

#3 TetriTek

TetriTek

    Wizard

  • Members
  • Real Name:Joshua Johnson
  • Location:Clinton

Posted 17 February 2007 - 04:23 PM

You know how scripting works? I tried some, but it always says the first command wont work or something like that, do you think you can tell me why, and teach me how? icon_unsettled.gif

#4 SpikeReynolds

SpikeReynolds

    Ironically bald furry

  • Members
  • Real Name:Spens
  • Location:Grand Rapids, Michigan

Posted 17 February 2007 - 04:58 PM

Cool, I got a question, was I your first request?

#5 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 17 February 2007 - 05:24 PM

QUOTE(¿Jishy-Zovhan-Narzak? @ Feb 17 2007, 04:23 PM) View Post

You know how scripting works? I tried some, but it always says the first command wont work or something like that, do you think you can tell me why, and teach me how? icon_unsettled.gif

PM me for that.

Daiv, no. My second script was the Shovel, remember? That script was requested by Beta Link. icon_wink.gif

#6 alfinchkid

alfinchkid

    Junior

  • Members
  • Real Name:Alex
  • Location:Pavillion Wyoming

Posted 17 February 2007 - 05:42 PM

I'm the one who requested it, I thouht an Item like this would make a good Time Elemental weapon for my quest. I'll definately use it, especially if there gets to be a point to put z### items on the subscreen. Good job, and thanks.

#7 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 17 February 2007 - 05:52 PM

Hehe, create a script and you get worshipped.

Jishy, you've read the pinned tutorial at the top of the forum right? I also recommend reading this for a good knowledge of C's structure, which is the programming language these scripts are based on:

http://einstein.drex...neral/C_basics/

But please read the pinned tutorial first or you'll start doing things your not allowed to do in Z-scripts from the link.

Edited by Fire Wizzrobe, 17 February 2007 - 05:58 PM.


#8 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 17 February 2007 - 10:30 PM

CODE
// Stopwatch- Just a simple script that creates a Clock at Link's position when used. 3 uses ONLY.
// Changable Variables:
// ID- This is the Item ID for the item this script is attached to. Please look it up in std.zh. It can't
// be predefined because you might give this script to a different item than I did. Sorry.
// Usage- How this script works. 0 = 3 uses only. 1 = Drains all magic. 2 = Drains Magic equal to variable Magic.

import "std.zh"
item script Stopwatch
{
    int ScrnItems = 0;
    int ModItem = 0;
    int Used = 0;
    int ID = 0;
    int Usage = 0;
    int Magic = 64;

    void run()
    {
        if (Usage == 0)
        {
            if (Used == 0)
            {
                Link->Item[4] = true;
                Used = 1;
            }
            else if (Used == 1)
            {
                Link->Item[4] = true;
                Used = 2;
            }
            else if (Used == 2)
            {
                Link->Item[4] = true;
                Used = 0;
                Link->Item[ID] = false;
            }
        }
        if (Usage == 1)
        {
            if (Link->MP > 0)
            {
                Link->Item[4] = true;
                Link->MP -= Link->MP;
            }
        }
        if (Usage == 2)
        {
            if (Link->MP >= Magic)
            {
                Link->Item[4] = true;
                Link->MP -= Magic;
            }
        }
    }
}

OH MY! (/End stupid YI joke.)

Heh, the script is now more efficient! I have set the script to simply give you a clock when you use the script! But ShadowTiger challenged me to do MORE! If Variable Usage is set to 0, you get the old method, 3 uses only! Set it 1, it drains whatever Magic you have so long as you have some! Set it 2, and whatever value you set variable Magic to be is how much magic you need to use the item and how much is taken away! Flexibility is the greatest thing with script! Come on, don't be shy! USE THIS SCRIPT IF YOU WISH! I don't mind! icon_biggrin.gif


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users