Jump to content

Photo

Moving combo?


  • Please log in to reply
12 replies to this topic

#1 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 07:10 PM

CODE

const int BirdData=1;
ffc script movingcombo
{
    void run()
    {
        int x;int y;
        while (x<=248)
        {
            Screen->DrawCombo(3,x,y,BirdData,1, 1,7, 1, 0, 0, 0,0, 0, true, 128);
            x+2;
            Waitframe();
        }
    }
}


Well, I wanted to move a combo horizontally to the right, but it just get stuck at the initial position...

Oh, and I don't want to use ffcs though, because this is for a global script so I don't want to reserve a place for a ffc on every screen of the game... icon_unsettled.gif

Help anyone?

Edited by lucas92, 07 December 2008 - 08:51 PM.


#2 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 06 December 2008 - 07:21 PM

You can just do a FFC with the Carry Over thing checked, can't you?

#3 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 07:35 PM

Nah, I don't want to make it that way. I don't want to use any ffc... icon_frown.gif

Is there a way to do it?

#4 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 06 December 2008 - 07:35 PM

Hmmm....you want this as a global script? Would'nt be to hard to make. Ill give a go at it. But how would the combo move without having any velocity or delay functions.

#5 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 06 December 2008 - 07:39 PM

Lemme guess, you want a bird flying over multiple screens... If you want that, you indeed need a script for it.
Unfortunately I can't script it...

O, now I notice a constant integer in the script is called birddata. Seems I was right without reading it.

#6 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 07:46 PM

I think I'll post the full script:
EDIT-Finally not because it just seems too messy right now for you to understand it anyway.

Edited by lucas92, 06 December 2008 - 08:09 PM.


#7 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 06 December 2008 - 07:50 PM

Is it so hard to use FFCs for this?
Add the SFX with scripts or such, place teh FFC, make it stop by using a changer. Then make a screen with Link being picked up, then a bird holding Link and flying away.
Seems easy to me.

#8 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 07:57 PM

Well, I thought it would be easier just to use a global script instead of putting a ffc on almost every screen....

But if this is the only way to make it work, I'll do it.

Edited by lucas92, 06 December 2008 - 08:02 PM.


#9 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 06 December 2008 - 08:02 PM

Thats a pretty messy way to do your global scripts. You need to check when the is a links position, change link's graphics using LA_DROWNING for a few frames. Or why dont you just edit the zelda 1 whistle? And replace the whirlwind with the bird? But yea you need to do what i suggested.

#10 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 08:08 PM

The part with the Link's animation isn't finished too... Meh...

The point is: is it possible to move a combo that way?
CODE
const int BirdData=1;
ffc script movingcombo
{
    void run()
    {
        int x;int y;
        while (x<=248)
        {
            Screen->DrawCombo(3,x,y,BirdData,1, 1,7, 1, 0, 0, 0,0, 0, true, 128);
            x+2;
            Waitframe();
        }
    }
}


#11 Elmensajero

Elmensajero

    Doyen(ne)

  • Members
  • Real Name:John
  • Location:Raleigh, North Carolina

Posted 06 December 2008 - 08:14 PM

CODE
x+2;

This is the main problem I see. You want the x variable to be increased by two right? Then you need to use either "x+=2;" or "x=x+2;". Same goes for the birdy variable. I didn't look closely at the large portion of the script, so let us know if there are still any problems after fixing that.

#12 lucas92

lucas92

    Defender

  • Members

Posted 06 December 2008 - 08:47 PM

Wow. It works great now. Thanks. icon_smile.gif

#13 lucas92

lucas92

    Defender

  • Members

Posted 07 December 2008 - 06:14 PM

Alright, I've got a little demo of the script I have done...

http://www.mediafire...a32dffbb74db43d

The problem is that, after warping to the forbidden forest and changing screen, the item cursor seems to disappear so we can't use any more item! It doesn't do that when warping to the town...

It seems like a bug... Well, the quest is unlocked anyway, so you can check out the code...

btw, use the flute to see the script, obviously.

EDIT-Might even show the full script:

CODE
import "std.zh"
/////////////LTTP Wistle Script Constants//////
const int BirdDataRight=23718;
const int BirdDataLeft=23720;
const int LinkOcarinaData=23801;
const int LinkShadow=632;
int warpx;
int warpy;
bool wistle;
bool bird1;
bool bird2;
bool bird4;

void ScreenIsWavy(int numframes)
{
    while(numframes>0)
    {
        Screen->Wavy=50;
        numframes-=numframes;
        Waitframe();
    }
}
ffc script WistleWorldSelection
{
    void run(int maxworlds)
    {
        int cursor;
        while(true)
        {
            Link->InputStart=false;
            if(Link->InputUp)
            {
                Game->PlaySound(64);
                Link->InputUp=false;
                Waitframe();
                cursor-=1;
            }
            if(Link->InputDown)
            {
                Game->PlaySound(64);
                Link->InputDown=false;
                Waitframe();
                cursor+=1;
            }
            if(cursor<0)cursor=0;
            if(cursor>maxworlds)cursor=maxworlds;
            if(cursor==0)this->Y=0;
            if(cursor==1)this->Y=48;
            if(Link->InputA)
            {
                Link->InputA=false;
                Waitframe();
                if(cursor==0)
                {
                    bird4=true;
                    warpx=40;
                    warpy=112;
                    Link->Warp(0,66);
                    Quit();
                }
                if(cursor==1)
                {
                    bird4=true;
                    warpx=120;
                    warpy=112;
                    Link->Warp(3,81);
                    Quit();
                }
            }
        Waitframe();
        }
    }
}

ffc script LinkIsFrozen
{
    void run()
    {
        while(true)
        {
            Link->Action=3;
            Waitframe();
        }
    }
}
item script LTTP_Wistle_Action
{
    void run()
    {
        wistle=true;
    }
}

global script slot2
{
    void run()
    {
        int birdy;
        int birdx;
        int rate;
        int shadowy;
        int ratex;
        int ratey;
        int realratex;
        int realratey;
        bool IsTaken;
        while(true)
        {
            int x=Link->X;int y=Link->Y;
            int currentScreen=Game->GetCurScreen();
            int currentDScreen=Game->GetCurDMapScreen();
            int currentMap=Game->GetCurMap();
            int currentDmap=Game->GetCurDMap();
            ////////////LTTP Wistle Script//////////
            if(wistle)
            {
                Game->PlaySound(33);
                int i;
                while(i<40)
                {
                    Link->Action=LA_DROWNING;
                    Screen->DrawCombo(3,x,y, LinkOcarinaData, 1, 1,6, 1, 0, 0, 0,0, 0, true, 128);
                    i++;
                    Waitframe();
                }
                Link->Action=3;
                wistle=false;
                bird1=true;
            }
            if(bird1)
            {
                birdy=y-16;
                while(birdx<=Link->X)
                {
                    Screen->DrawTile(1,birdx, birdy+16,LinkShadow, 1, 1,7, 1,0, 0, 0,0, true, 64);
                    Screen->DrawCombo(3,birdx,birdy,BirdDataRight,1, 1,7, 1, 0, 0, 0,0, 0, true, 128);
                    birdx+=2;
                    Waitframe();
                }
                Link->Action=LA_NONE;
                bird1=false;
                bird2=true;
            }
            if(bird2)
            {
                birdx=Link->X;birdy=Link->Y-16;
                IsTaken=true;
                rate=1;
                shadowy=Link->Y;
                while(IsTaken)
                {
                    Link->Action=LA_HOLD1LAND;
                    birdx+=2;
                    birdy+=rate*-2;
                    Screen->DrawCombo(3,birdx,birdy,BirdDataRight,1, 1,7, 1, 0, 0, 0,0, 0, true, 128);
                    Screen->DrawTile(1,birdx, shadowy,LinkShadow, 1, 1,7, 1,0, 0, 0,0, true, 64);
                    Link->X=birdx;Link->Y=birdy+16;
                    if (birdx>=232||birdy<=0)IsTaken=false;
                    Waitframe();
                }
                bird2=false;
                ScreenIsWavy(120);
                Link->Warp(4,7);
            }
            if(bird4)
            {
                ScreenIsWavy(120);
                birdx=warpx;
                birdy=warpy;
                shadowy=warpy+16;
                Link->Action=0;
                while(bird4)
                {
                    birdx-=2;
                    Screen->DrawCombo(3,birdx,birdy,BirdDataLeft,1, 1,7, 1, 0, 0, 0,0, 1, true, 128);
                    Screen->DrawTile(1,birdx, shadowy,LinkShadow, 1, 1,7, 1,0, 0, 0,0, true, 64);
                    if(birdx<0)bird4=false;
                    Waitframe();
                }
            }
            //////////END//////////////
            Waitframe();
        }
    }
}

Edited by lucas92, 07 December 2008 - 08:58 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users