Jump to content

Photo

Introducing the newest script in ZC....


  • Please log in to reply
54 replies to this topic

#1 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 14 January 2007 - 09:48 PM

Ever want the Cane of Somaria to be added to ZC? Well, I'm sorry to say that...

THE FUTURE'S LOOKING BRIGHT FOR THAT ITEM

I have just completed what I believe is the greatest script I have evermade. It's also the ONLY script I've ever made. icon_lol.gif Take a look at my Cane of Somaria! (No joke- I really made it.)

CODE
// Cane of Somaria- Changes certain attributes of FFC 32 on the
// current screen "Player" is on. It modifies the combo used,
// combo type, flags, etc. In the end, it looks like a block.
// This item will also change the location of the FFC so it
// always "spawns" 2 tiles away from Link in the direction he
// is currently facing. Becuase of limited knowledge, this
// script currently does not prevent you from walking onto the
// block. Any mention of "SomariaBlock" in the script refers to
// Freeform Combo 32. Have fun.

import "std.zh"
item script CaneSomaria
{
    void run()
    {
        int sound=30;
        ffc SomariaBlock= Screen->LoadFFC(32);
        if(Link->Dir == 0)
        {
            SomariaBlock->X = Link->X;
            SomariaBlock->Y = Link->Y - 32;
        }
        else if(Link->Dir == 1)
        {
            SomariaBlock->X = Link->X;
            SomariaBlock->Y = Link->Y + 32;
        }
        else if(Link->Dir == 2)
        {
            SomariaBlock->X = Link->X - 32;
            SomariaBlock->Y = Link->Y;
        }
        else if(Link->Dir == 3)
        {
            SomariaBlock->X = Link->X + 32;
            SomariaBlock->Y = Link->Y;
        }
        float remainder = SomariaBlock->X % 16;
        if ( remainder <= 8 )
        {
            SomariaBlock->X = SomariaBlock->X - remainder;
        }
        else
        {
            SomariaBlock->X = SomariaBlock->X + 16 - remainder;
        }
        SomariaBlock->Data = A;
        SomariaBlock->CSet = B;
    }
}


Replace A with the combo number for the Block (FFC 32 will use that combo the moment you use the Cane), and B with the CSet it uses. This script SHOULD create the block 2 tiles away from Link. If it doesn't, just change everything that says 32 to 16. That'll make it appear directly in front of him. The only drawback to this is that the block isn't solid yet. Oh yeah, did I mention that the only way to push the block is to give the combo you use an inherent Push flag? And that works now? icon_lol.gif It's true! Thanks to C-Dawg for helping me learn ZScript and for helping me get this code together. Thanks to Fire Wizzrobe for telling me how to define "remainder" as a variable. icon_xd.gif

Enjoy, and if you can make the block solid, give me the modified script IMMIDEATELY so I may use it. That's the plan, you know. icon_wink.gif Oh yeah, the block appears the instant you use the Cane instead of after its animation, so.... beware.

#2 Koh

Koh

    Tamer Koh

  • Members
  • Real Name:Dominic
  • Location:Monsbaiya, Virginia

Posted 14 January 2007 - 10:13 PM

it looks perfect, good job icon_wink.gif.

#3 Bayta

Bayta

    Follower of Destiny

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

Posted 14 January 2007 - 10:16 PM

YAY!!!
THIS IS FREAKING AWESOME!!! I may not use it in my quest, except for extra secrets and stuff, but I'm sure that alot of people will find use for it. It was already on the ZC "todo list" though. (Which the devs seem to be ignoring <_<). Here's something though... If you're able to push it, then you shouldn't be going through the box anyway, right? Then again, not everyone will want to be able to push it.

#4 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 14 January 2007 - 10:17 PM

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

YAY!!!
THIS IS FREAKING AWESOME!!! I may not use it in my quest, except for extra secrets and stuff, but I'm sure that alot of people will find use for it. It was already on the ZC "todo list" though. (Which the devs seem to be ignoring <_<). Here's something though... If you're able to push it, then you shouldn't be going through the box anyway, right? Then again, not everyone will want to be able to push it.

I already told you, I don't know HOW to make it solid. The FFC Flag solid (only available by using scripts) doesn't work, thus YOU WALK THROUGH FFCS. If someone can fix that... Instant perfect Cane of Somaria, minus the "Hit Block with sword to make it vanish". I'll worry about that later.

#5 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 14 January 2007 - 11:27 PM

So it's a FFC? Does that mean it doesn't override the combo it lands on? And does that mean it doesn't leave an undercombo?

If it leaves an undercombo, that could be messy. Wherever the player placed it, it could wipe the combo on which it is placed. Also, it should be made impossible to place it on certain combos.

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.

I'm not criticizing you because I think it's worthless... on the contrary. It's pretty innovative and possibly revolutionary, depending on how you managed it. icon_smile.gif But instead of being usable in quests, it may end up primarily being a demonstration to the developers, if you're lucky, kinda how _L_ demonstrated how to make a primitive Roc's Feather with a script.

#6 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 14 January 2007 - 11:39 PM

QUOTE(Radien @ Jan 14 2007, 11:27 PM) View Post

So it's a FFC? Does that mean it doesn't override the combo it lands on? And does that mean it doesn't leave an undercombo?

If it leaves an undercombo, that could be messy. Wherever the player placed it, it could wipe the combo on which it is placed. Also, it should be made impossible to place it on certain combos.

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.

I'm not criticizing you because I think it's worthless... on the contrary. It's pretty innovative and possibly revolutionary, depending on how you managed it. icon_smile.gif But instead of being usable in quests, it may end up primarily being a demonstration to the developers, if you're lucky, kinda how _L_ demonstrated how to make a primitive Roc's Feather with a script.

So many questions! icon_dead.gif

1: The script itself is an Item, but it calls and modifies FFC #32 (since it's the last one, it'll be the least-used one, thus almost always free). I think it's attacking FFC #1, though. I'll have to experiment.
2: No , it doesn't.
3: Correct.
4: I tested it before I released it. This script doesn't CREATE the FFC, but merely alters its looks and position,, in actuality, each time you use the Cane, you move that FFC to its new position.
5: It's not exactly usable right now because I'm still waiting for some help in getting the FFC to simulate solidity, like with some of C-Dawg's scripts (like that multiblock puzzle). Seriously people, help me out here. If you can find a way to make this script make the FFC simulate solidity, be pushable, activate the Block Trigger flag, and not mess up the positioning, I'd REALLY appreciate it. Plus, it'd mean we'd all be one step closer to having a true Cane of Somaria. icon_wink.gif

#7 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 15 January 2007 - 04:08 AM

Hmm, well, sounds like you're doing well with it now. icon_smile.gif I don't know if it'll be possible to affect block trigger flags at all, though, as I think FFCs aren't made to affect flags that regular combos do.

At the moment it's probably good that it isn't totally solid, until you find a way to get rid of the block. From what I remember, the block(s) could be destroyed by hitting it with the cane.

I'd help you out, but I'm not planning on learning Zscript... good luck.

#8 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 15 January 2007 - 09:04 AM

you can always make it change the combo in front of the player to a block instead of using an ffc?

#9 Snarwin

Snarwin

    Still Lazy After All These Years

  • Members
  • Real Name:Paul
  • Location:New York

Posted 15 January 2007 - 09:39 AM

QUOTE(Radien @ Jan 15 2007, 04:08 AM) View Post

Hmm, well, sounds like you're doing well with it now. icon_smile.gif I don't know if it'll be possible to affect block trigger flags at all, though, as I think FFCs aren't made to affect flags that regular combos do.
I'm pretty sure it's possible to have the FFC check for a "Block Trigger" flag underneath it and take action accordingly, using Screen->ComboF[]. You could trigger secrets by killing a "Trigger" enemy.

QUOTE
you can always make it change the combo in front of the player to a block instead of using an ffc?
What if the quest designer doesn't want that particular combo to be changed?

#10 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 09:55 AM

QUOTE(Master_of_Power @ Jan 15 2007, 09:04 AM) View Post

you can always make it change the combo in front of the player to a block instead of using an ffc?

That's the problem. I don't know how yet, and I would rather create a combo instead. Less mess that way.

QUOTE(Snarwin)
I'm pretty sure it's possible to have the FFC check for a "Block Trigger" flag underneath it and take action accordingly, using Screen->ComboF[]. You could trigger secrets by killing a "Trigger" enemy.

Any idea how I'd do that, though? I'm about to check on AGN, though, so I might get my answer and/or help there. icon_biggrin.gif

Edit: Nope, no help from AGN. Oh well... I still need some help with this script to make it perfect. And also, how exactly DO I modify an FFC using Screen->ComboX()? (X is whatever function you need it to do.) I've tried replacing Screen with the pointer for my FFC, but hat doesn't work. Any help?

Edited by Matthew, 15 January 2007 - 10:06 AM.


#11 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 15 January 2007 - 10:08 AM

CODE
import "std.zh"
ffc script CaneSomaria
{
    void run(){

    
           While(true){
            int sound=30;
            int poof = combo of disapearing animation;
            ffc SomariaBlock= Screen->LoadFFC(32);
            bool rpress = false
            bool activate = false
    
            if(Link->inputR && !rpress)
            rpress = true;
                if(!activate){
            
                activate = true
                if(Link->Dir == 0)
                    {
                        SomariaBlock->X = Link->X;
                        SomariaBlock->Y = Link->Y - 32;
                    }
                    else if(Link->Dir == 1)
                    {
                        SomariaBlock->X = Link->X;
                        SomariaBlock->Y = Link->Y + 32;
                    }
                    else if(Link->Dir == 2)
                    {
                        SomariaBlock->X = Link->X - 32;
                        SomariaBlock->Y = Link->Y;
                    }
                    else if(Link->Dir == 3)
                    {
                        SomariaBlock->X = Link->X + 32;
                        SomariaBlock->Y = Link->Y;
                    }
                    float remainder = SomariaBlock->X % 16;
                    if ( remainder <= 8 )
                    {
                        SomariaBlock->X = SomariaBlock->X - remainder;
                    }
                    else
                    {
                        SomariaBlock->X = SomariaBlock->X + 16 - remainder;
                    }
                    SomariaBlock->Data = A;
                    SomariaBlock->CSet = B;
                }
            else{
            deactivate();
            }
            else{
            if (!Link->inputR){
            rpress = false;}

            } //End of if
        Waitframe();    
        } //End of While

    }//End of void run

    void deactivate(){
    activate = false;
    SomariaBlock->Data; = poof //Make a disapearing animation for it, and have it cycle after
                  //the animation is done to a tranparent combo next to it.
    if (SomariaBlock->data; == (poof + 1)){
    SomariaBlock->X = -16;
    SomariaBlock->Y = -16;}
    }

} //End FFC


I made a ffc script variation that makes the block appear and dissapear pressing R because item scripts can't loop. Before you compile it, read the directions at the bottom and replace the pointer poof with the combo # you want.

Edited by Fire Wizzrobe, 15 January 2007 - 10:13 AM.


#12 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 10:17 AM

QUOTE(Fire Wizzrobe @ Jan 15 2007, 10:08 AM) View Post

CODE
import "std.zh"
ffc script CaneSomaria
{
    void run(){

    
           While(true){
            int sound=30;
            int poof = combo of disapearing animation;
            ffc SomariaBlock= Screen->LoadFFC(32);
            bool rpress = false
            bool activate = false
    
            if(Link->inputR && !rpress)
            rpress = true;
                if(!activate){
            
                activate = true
                if(Link->Dir == 0)
                    {
                        SomariaBlock->X = Link->X;
                        SomariaBlock->Y = Link->Y - 32;
                    }
                    else if(Link->Dir == 1)
                    {
                        SomariaBlock->X = Link->X;
                        SomariaBlock->Y = Link->Y + 32;
                    }
                    else if(Link->Dir == 2)
                    {
                        SomariaBlock->X = Link->X - 32;
                        SomariaBlock->Y = Link->Y;
                    }
                    else if(Link->Dir == 3)
                    {
                        SomariaBlock->X = Link->X + 32;
                        SomariaBlock->Y = Link->Y;
                    }
                    float remainder = SomariaBlock->X % 16;
                    if ( remainder <= 8 )
                    {
                        SomariaBlock->X = SomariaBlock->X - remainder;
                    }
                    else
                    {
                        SomariaBlock->X = SomariaBlock->X + 16 - remainder;
                    }
                    SomariaBlock->Data = A;
                    SomariaBlock->CSet = B;
                }
            else{
            deactivate();
            }
            else{
            if (!Link->inputR){
            rpress = false;}

            } //End of if
        Waitframe();    
        } //End of While

    }//End of void run

    void deactivate(){
    activate = false;
    SomariaBlock->Data; = poof //Make a disapearing animation for it, and have it cycle after
                  //the animation is done to a tranparent combo next to it.
    if (SomariaBlock->data; == (poof + 1)){
    SomariaBlock->X = -16;
    SomariaBlock->Y = -16;}
    }

} //End FFC


I made a ffc script variation that makes the block appear and dissapear pressing R because item scripts can't loop. Before you compile it, read the directions at the bottom and replace the pointer poof with the combo # you want.

Well, I don't need it to loop. It only needs to work when you use the item. Remember, Cane of Somaria is an item! ;_; I told you, I need the block to be solid, pushable, and activate Block Triggers (and block holes), not poof into existance. You can do THAT with combo cycling, so I see no point in putting it in the script itself. icon_razz.gif

Edited by Matthew, 15 January 2007 - 10:18 AM.


#13 Fire Wizzrobe

Fire Wizzrobe

    Master

  • Members
  • Real Name:T

Posted 15 January 2007 - 10:38 AM

I did it for fun and practice. The purpose was to make it poof out of existance pressing the R button.

I'll see if I can come up with something for your specifications later today.

Edited by Fire Wizzrobe, 15 January 2007 - 10:48 AM.


#14 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

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

Posted 15 January 2007 - 10:52 AM

QUOTE(Fire Wizzrobe @ Jan 15 2007, 10:38 AM) View Post

I did it for fun. The purpose was to make it poof out of existance. icon_frown.gif

Oh, sorry. I didn't know. But you CAN use combo cycling to make it poof INTO existance. Poofing OUT of existance wouldn't work, though....

If you can figure out a way to make the FFC pseudo-solid, be pushable, and react to Block Trigger flags, will you let me know? Seriously, without all that, this script is USELESS...

Oh wait, it isn't. Here's a few examples of what you could do with this script the way it's set up:

-Use the combo it creates as a Warp type. Use it on certain screens, and you might get a secret! Call it Cane of Warping perhaps?
-Use the combo it creates as a Save Point. The Cane of Saving? Get outta here. icon_lol.gif
-Make it a Magic Prism combo to reflect Wizzrobe magic back at its owner. icon_razz.gif
-Block All + No Enemies Flag = Protective Barrier. Can that be any simpler? icon_lol.gif
-Low on Money? Make its combo a bush combo! Well, since it's not solid, it wouldn't work like a bush... Maybe Tall Grass instead. icon_wink.gif
-Messed up a puzzle but don't want to leave to room? Make the Cane's combo a Reset Room Combo! icon_biggrin.gif

See? Not so useless NOW, is it? However, MY end result will always be the same- Cane of Somaria. Nothing else will do. So, once I complete the Cane of Somaria script, I'll leave the previous version up so people won't have to take out any solidity to prevent the player from not being able to walk over it. I mean, to activate warps, you HAVE to stand on them!

#15 Limzo

Limzo

    _

  • Members

Posted 15 January 2007 - 11:55 AM

I absolutely love this thing, and cannot wait to try it out Matthew.

QUOTE(Radien)
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.

QUOTE(Matthew)
Correct.

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.

Edited by Limzo, 15 January 2007 - 11:56 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users