Jump to content

Photo

Item that floats.


  • Please log in to reply
22 replies to this topic

#16 caprontos

caprontos

    Recipient of Ways

  • Members

Posted 29 April 2010 - 02:41 PM

QUOTE(Joe123 @ Apr 29 2010, 03:26 PM) View Post

Well you'd hope that no-one'd get confused by it, it's just wrong.

CODE
ffc script SpawnItem{
    void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
        if(enemies != 0) dly = 4;
        Waitframes(dly);
        if(perm > 0 && GetScreenDBit(d,perm)) return;
        while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
        item i = CreateItemAt(itm,this->X,this->Y);
        if(holdup) i->Pickup |= IP_HOLDUP;
        while(i->isValid()){
            i->Z = z; i->Jump = 0;
            Screen->DrawTile(3,i->X,i->Y+2-i->Z,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
            Waitframe();
        }
       if(perm != 0) SetScreenDBit(d,perm,true);
    }
}


Drawing two sprites is intentional, I just got one of the in the wrong place. Try that, it might be one or two pixels out but I think it's right.



Yep it was 2pixels off but I figured out how to edit that much haha so

CODE
ffc script SpawnItem{
    void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
        if(enemies != 0) dly = 4;
        Waitframes(dly);
        if(perm > 0 && GetScreenDBit(d,perm)) return;
        while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
        item i = CreateItemAt(itm,this->X,this->Y);
        if(holdup) i->Pickup |= IP_HOLDUP;
        while(i->isValid()){
            i->Z = z; i->Jump = 0;
            Screen->DrawTile(3,i->X,i->Y-i->Z,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
            Waitframe();
        }
       if(perm != 0) SetScreenDBit(d,perm,true);
    }
}


that works, link will walk under it, and can jump and grab it and it returns each time, so all works as needed, thanks.


#17 Joe123

Joe123

    Retired

  • Members

Posted 29 April 2010 - 02:43 PM

Oh was that +2 wrong? I thought there was some strange offset that I had to accommodate for, obviously I was mistaken.

Glad it works, I might add this to the script in the database at some point. It probably needs some 'wings' to go at the side like LA though.

#18 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 29 April 2010 - 03:20 PM

Um, I have a question about the Z axis in ZC. What is the threshold for the Z axis?

... what I mean is, how much "Z" equates to a layer in ZC? If Z is set to 1, does that set the item (or player, or whatever) on layer 1, and so forth? Or, does Z have to be set to 16 or something for the item to be on layer 1?

Heh, I guess I'm the first one to be confused! icon_razz.gif

Oh, and Joe123, I think I get the D registers now! ^^' Took me a while, but I think I had an epiphany yesterday about them. (I kinda got them earlier, but I was confused how you could alter the value of the bit number without changing the number assigned to the given D register. ;P )

Edited by AgentLym, 29 April 2010 - 03:22 PM.


#19 caprontos

caprontos

    Recipient of Ways

  • Members

Posted 29 April 2010 - 03:21 PM

QUOTE(Joe123 @ Apr 29 2010, 03:43 PM) View Post

Oh was that +2 wrong? I thought there was some strange offset that I had to accommodate for, obviously I was mistaken.

Glad it works, I might add this to the script in the database at some point. It probably needs some 'wings' to go at the side like LA though.


I was just going to make special items with tiles for it but I suppose if you added two more "Draw tile's" one to the left and right could make any item one with out need of special tiles (well except for the wing tiles)? and disappear when gotten.

Edited by caprontos, 29 April 2010 - 03:25 PM.


#20 Joe123

Joe123

    Retired

  • Members

Posted 29 April 2010 - 03:29 PM

QUOTE(AgentLym @ Apr 29 2010, 09:20 PM) View Post

Um, I have a question about the Z axis in ZC. What is the threshold for the Z axis?

... what I mean is, how much "Z" equates to a layer in ZC? If Z is set to 1, does that set the item (or player, or whatever) on layer 1, and so forth? Or, does Z have to be set to 16 or something for the item to be on layer 1?

Heh, I guess I'm the first one to be confused! icon_razz.gif

Oh, and Joe123, I think I get the D registers now! ^^' Took me a while, but I think I had an epiphany yesterday about them. (I kinda got them earlier, but I was confused how you could alter the value of the bit number without changing the number assigned to the given D register. ;P )


Your question assumes that ZC was coded in a sensical fashion =P
No amount of Z equates to a layer in ZC, you have to draw it on the layer you want it on as well as setting the Z.

Oh well, glad you got it. You do alter the number assigned to the D register, the 'bit number' and the 'number' are the same thing. A bit string is a different way of looking at a number.



QUOTE(caprontos @ Apr 29 2010, 09:21 PM) View Post

I was just going to make special items with tiles for it but I suppose if you added two more "Draw tile's" one to the left and right could make any item one with out need of special tiles (well except for the wing tiles)? and disappear when gotten.

That was the intention. Might do it somepoint.

#21 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 29 April 2010 - 03:32 PM

I think that'd add some wings; just set D7 as anything besides 0 to enable the wings, and set the constant integer at the top to the combo of the left side (with the right side one tile to the right of it). And... I hope it works! Otherwise, I'd feel... not smart! lol

CODE
const int wings = 0;

ffc script SpawnItem{
    void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z, bool fly){
        if(enemies != 0) dly = 4;
        Waitframes(dly);
        if(perm > 0 && GetScreenDBit(d,perm)) return;
        while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
        item i = CreateItemAt(itm,this->X,this->Y);
        if(holdup) i->Pickup |= IP_HOLDUP;
        while(i->isValid()){
            i->Z = z; i->Jump = 0;
            Screen->DrawTile(3,i->X,i->Y-i->Z,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
            if(fly){
                 Screen->FastCombo(3,i->X-16,i->Y-i->Z,wings,i->CSet,128);
                 Screen->FastCombo(3,i->X+16,i->Y-i->Z,wings+1,i->CSet,128);
            }
            Waitframe();
        }
       if(perm != 0) SetScreenDBit(d,perm,true);
    }
}


But this doesn't null my last question. icon_wink.gif Nevermind, Joe got it. But, that brings up another question. How much "Z" does Link jump normally?

Edited by AgentLym, 29 April 2010 - 03:37 PM.


#22 Joe123

Joe123

    Retired

  • Members

Posted 29 April 2010 - 03:57 PM

Not quite how I'd do it but I think it should work.
QUOTE(AgentLym @ Apr 29 2010, 09:32 PM) View Post
But, that brings up another question. How much "Z" does Link jump normally?
CODE
ffc script LinkMaxZ{
    void run(){
        int z = 0;
        while(Link->Z == 0) Waitframe();
        while(Link->Z != 0){
            z = Max(z,Link->Z);
            Waitframe();
        }
        Trace(z);
    }
}
Jump and that'll trace Link's max Z, it's dependant on the height modifier of Roc's feather.
I think it's probably 16*height modifier, but it might be slightly different.

#23 caprontos

caprontos

    Recipient of Ways

  • Members

Posted 29 April 2010 - 03:58 PM

QUOTE(AgentLym @ Apr 29 2010, 04:32 PM) View Post

I think that'd add some wings; just set D7 as anything besides 0 to enable the wings, and set the constant integer at the top to the combo of the left side (with the right side one tile to the right of it). And... I hope it works! Otherwise, I'd feel... not smart! lol

CODE
const int wings = 0;

ffc script SpawnItem{
    void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z, bool fly){
        if(enemies != 0) dly = 4;
        Waitframes(dly);
        if(perm > 0 && GetScreenDBit(d,perm)) return;
        while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
        item i = CreateItemAt(itm,this->X,this->Y);
        if(holdup) i->Pickup |= IP_HOLDUP;
        while(i->isValid()){
            i->Z = z; i->Jump = 0;
            Screen->DrawTile(3,i->X,i->Y-i->Z,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
            if(fly){
                 Screen->FastCombo(3,i->X-16,i->Y-i->Z,wings,i->CSet,128);
                 Screen->FastCombo(3,i->X+16,i->Y-i->Z,wings+1,i->CSet,128);
            }
            Waitframe();
        }
       if(perm != 0) SetScreenDBit(d,perm,true);
    }
}


But this doesn't null my last question. icon_wink.gif Nevermind, Joe got it. But, that brings up another question. How much "Z" does Link jump normally?


it works yes thanks .. saves me the time of needing to make more tiles.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users