Jump to content

Photo

I need two scripts for items already in the game, with some slightly d


  • Please log in to reply
7 replies to this topic

#1 HylianGlaceon

HylianGlaceon

    Magus

  • Members
  • Location:Whatever dimension is between Sinnoh and Hyrule...

Posted 08 January 2011 - 01:46 AM

For the first one, I need a regular Bomb, to work and sound exactly the same in the game except it uses Flag #100 (and also triggers flag #6 like normal bombs). It's for a Level 2 Bomb in my quest that will trigger flags regular bombs won't.

Next is the Magic Wand, with this what I really need is the Rod of Seasons from OoS, meaning Link swings the Rod and it triggers tile warp A. No magic cost, but it needs to only do this warp on places marked with flag #101. Also, no magic beam, fire or anything.

If you need exact tile numbers I can include those too where I'll likely be placing the tiles for these.

The Lv 2 Bombs will be replacing the original Bombs, the Rod of Seasons won't be replacing the Magic Wand though.

Anyone who might be able to make these? Thanks in advance...

#2 HylianGlaceon

HylianGlaceon

    Magus

  • Members
  • Location:Whatever dimension is between Sinnoh and Hyrule...

Posted 05 February 2011 - 01:23 AM

Bumping..

If it'd be easier... (I don't know how scripts work too well). But I've already created the Level 2 Bombs in my quest, if there's a script to set it so Flag #100 is triggered by a certain item being this one, that'll work too.

Nothing new with the wand.

Any help with these would be greatly appreciated..

#3 lucas92

lucas92

    Defender

  • Members

Posted 05 February 2011 - 06:42 PM

It's quite easy actually. Just edit an unused item and set the class to Bombs in the item editor, then attach this script to the action slot of the item:

EDIT- actually, it might be harder than I thought huh... icon_frown.gif

#4 HylianGlaceon

HylianGlaceon

    Magus

  • Members
  • Location:Whatever dimension is between Sinnoh and Hyrule...

Posted 05 February 2011 - 10:32 PM

QUOTE(lucas92 @ Feb 5 2011, 05:42 PM) View Post

It's quite easy actually. Just edit an unused item and set the class to Bombs in the item editor, then attach this script to the action slot of the item:

EDIT- actually, it might be harder than I thought huh... icon_frown.gif


Yeah, I don't know if there's a simple script or not to set the flag to be triggered or not. Like I mentioned above I have to exact item made already and working in the game, but it just needs to trigger Flag #100, so the player needs to find this type of bombs to continue in a dungeon.

Thanks for trying though!

#5 lucas92

lucas92

    Defender

  • Members

Posted 11 February 2011 - 08:03 PM

Ok, I've succeeded making your bomb script.
CODE
import "std.zh"


const int I_CUSTOMBOMB = 123;
const int CUSTOMBOMB_MISC = 0;
const int CUSTOMBOMB_SECRETFLAG = 100;
const int CWAND_SECRETFLAG = 101;

item script bombActionScript
{
    void run()
    {
        lweapon bomb = CreateLWeaponAt(LW_BOMB, Link->X, Link->Y);
        item dummybomb = Screen->CreateItem(I_CUSTOMBOMB);
        bomb->OriginalTile = dummybomb->OriginalTile;
        bomb->ASpeed = dummybomb->ASpeed;
        bomb->CSet = dummybomb->CSet;
        bomb->TileWidth = dummybomb->TileWidth;
        bomb->TileHeight = dummybomb->TileHeight;
        bomb->HitWidth = dummybomb->HitWidth;
        bomb->HitHeight = dummybomb->HitHeight;
        bomb->HitXOffset = dummybomb->HitXOffset;
        bomb->HitYOffset = dummybomb->HitYOffset;
        bomb->Misc[CUSTOMBOMB_MISC] = 1;
        
        //Deleting the dummybomb
        dummybomb->X = 1000;
    }
}
item script customWand
{
    void run()
    {
        if(Screen->ComboF[ComboAt(CenterLinkX(),CenterLinkY())] == CWAND_SECRETFLAG)
            Screen->TriggerSecrets();
    }
}
global script ActiveScript
{
    void run()
    {
        while(true)
        {
            for(int i = 1; i <= Screen->NumLWeapons(); i++)
            {
                lweapon lwp = Screen->LoadLWeapon(i);
                if(lwp->ID == LW_BOMBBLAST && lwp->Misc[CUSTOMBOMB_MISC] == 1 && Screen->ComboF[ComboAt(lwp->X,lwp->Y)] == CUSTOMBOMB_SECRETFLAG)
                    Screen->TriggerSecrets();
            }
            Waitframe();
        }
    }
}


It's actually difficult to set this up, but I'll try my best to explain what I did.

First, you create an exact copy of the bomb item in the item editor. Make sure under the action tabs, in the action tab, the sprites of the bomb and bomb explosion are blank (set it to zzxx item).

Secondly, change the value of the int I_CUSTOMBOMB constant in the script file to the item id of your custom bomb. You can modify the combo flag too. Right now it's set to 100.

Then it's pretty much ready to work. I'm not sure if that's what you wanted but I think it will be of a great use for many people. icon_smile.gif

EDIT- I have some free time so I can attempt to do your magic rod script.

EDIT2- There's no way actually to active a tile warp, but what I've done for the magic wand is basically checking if Link stands on the combo flag, then trigger the secrets. You must put a tilewarp just under the combo flag. To set the graphics, you should make a duplicate item of the cane of birma, then edit the slashing sprites.

#6 HylianGlaceon

HylianGlaceon

    Magus

  • Members
  • Location:Whatever dimension is between Sinnoh and Hyrule...

Posted 13 February 2011 - 02:57 PM

Well, I tried the bomb, but it doesn't appear to work correctly. I had to set it in the action tab for the item, without that, nothing changed at all.

With it set there, it doesn't trigger Flag 100 for some reason, it places it under Link instead of in front like with the regular bombs, it doesn't use the bomb counter after the first one, it ignores the bombs onscreen limit and it doesn't cause any damage to enemies. There's also two sprites that appear, one is of the zzxxx item and the other is the sprite of the bomb.

The wand doesn't have any sound when it's used, is there a way you can add a sound effect to it? The wand also triggers all types of secrets, including Bomb, Arrow, etc. It'd be nice if it just triggered the #16-#31 flags, but I can probably still use it anyhow.

I assume as there's no way to specifically set the secret tile for Flag #101, I just use #16 on another layer for it?

What slot should the global script go in btw? I tried combining it with the one I was using and it caused ZC to crash every time I loaded the quest. I think that one was in Slot 2. The global script works right now, but a bunch of my tiles are all goofy as well, like there's a layer above them that's partially transparent.

Edited by HylianGlaceon, 13 February 2011 - 03:01 PM.


#7 lucas92

lucas92

    Defender

  • Members

Posted 13 February 2011 - 04:41 PM

Do you have beta 18, the latest build? The global script should be put in the active slot.
Here's the updated script for the bomb:
CODE
import "std.zh"


const int I_CUSTOMBOMB = 123;
const int CUSTOMBOMB_MISC = 0;
const int CUSTOMBOMB_SECRETFLAG = 100;
const int CWAND_SECRETFLAG = 101;

item script bombActionScript
{
    void run()
    {
        lweapon bomb = CreateLWeaponAt(LW_BOMB, Link->X, Link->Y);
        if(Link->Dir == DIR_UP)
            bomb->Y -= Link->HitHeight;
        else if(Link->Dir == DIR_DOWN)
            bomb->Y += Link->HitHeight;
        else if(Link->Dir == DIR_LEFT)
            bomb->X -= Link->HitWidth;
        else if(Link->Dir == DIR_RIGHT)
            bomb->X += Link->HitWidth;
        item dummybomb = Screen->CreateItem(I_CUSTOMBOMB);
        bomb->OriginalTile = dummybomb->OriginalTile;
        bomb->ASpeed = dummybomb->ASpeed;
        bomb->CSet = dummybomb->CSet;
        bomb->TileWidth = dummybomb->TileWidth;
        bomb->TileHeight = dummybomb->TileHeight;
        bomb->HitWidth = dummybomb->HitWidth;
        bomb->HitHeight = dummybomb->HitHeight;
        bomb->HitXOffset = dummybomb->HitXOffset;
        bomb->HitYOffset = dummybomb->HitYOffset;
        bomb->Misc[CUSTOMBOMB_MISC] = 1;
        
        //Deleting the dummybomb
        dummybomb->X = 1000;
    }
}
global script ActiveScript
{
    void run()
    {
        while(true)
        {
            for(int i = 1; i <= Screen->NumLWeapons(); i++)
            {
                lweapon lwp = Screen->LoadLWeapon(i);
                if(lwp->Misc[CUSTOMBOMB_MISC] == 1)
                {
                    Link->InputB = false;
                    if(lwp->ID == LW_BOMBBLAST && Screen->ComboF[ComboAt(lwp->X,lwp->Y)] == CUSTOMBOMB_SECRETFLAG)
                        Screen->TriggerSecrets();
                }
            }
            Waitframe();
        }
    }
}


I got it working so here's the settings in the item editor:
http://img266.images...custombomb1.png

Make sure that the explosion sprite and bomb sprite are invisible under the item editor. The sound effects are also under the item editor. You need to put the secret flag under the combo settings and the combo flag where you want the bomb to explode.

EDIT2- Here's the quest file (in 7z format):
https://docs.google....2...5ZjUx&hl=en

#8 HylianGlaceon

HylianGlaceon

    Magus

  • Members
  • Location:Whatever dimension is between Sinnoh and Hyrule...

Posted 13 February 2011 - 10:19 PM

Yeah, I have Beta 18, still very glitchy it would seem, been crashing all day just from trying to open it.

It appears to work now, but it also triggers all other secrets again. I assume there's nothing to do about that?

Can the global script be combined with others? I tried combining it and it compiles, but the second I load the quest it crashes every time, so I haven't been able to test it in my actual quest, just a blank one.

This is my global script currently that works:

CODE
global script Slot_2{
    void run(){
        while(true){
            //Call Bombchu functions
            if(UseBChu > 0) Bombchu();
            if(UseBombArrow > 0) BombArrow();
                        if(PegasusDash) PegasusBoots();
            
            StoreHP = Link->HP;
        Waitframe();
        }
    }


This is what I got when I combined it:

CODE
global script Slot_2{
    void run(){
        while(true){
            //Call Bombchu functions
            if(UseBChu > 0) Bombchu();
            if(UseBombArrow > 0) BombArrow();
                        if(PegasusDash) PegasusBoots();
                        { for(int i = 1; i <= Screen->NumLWeapons(); i++)
            {                lweapon lwp = Screen->LoadLWeapon(i);
                if(lwp->ID == LW_BOMBBLAST && lwp->Misc[CUSTOMBOMB_MISC] == 1 && Screen->ComboF[ComboAt(lwp->X,lwp->Y)] == CUSTOMBOMB_SECRETFLAG)
                    Screen->TriggerSecrets();
            
            StoreHP = Link->HP;
        Waitframe();
        }
    }
}
}
}



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users