Jump to content

Photo

Twilight princess wolf link in zquest


  • Please log in to reply
4 replies to this topic

#1 Nightmeres

Nightmeres

    Defender

  • Members

Posted 01 April 2010 - 05:38 PM

im using 2.5

is there a script in the database if not can some one write a script for this please.

what im looking for is link warps to a curtain dmap say "Twilight realm" and then a second from entering link transforms with an animation into a wolf or something. also i only want link to use wolf atacks like in twilight princess.

thanks in advance.

i actualy need this now that other way failded

Edited by Nightmeres, 05 April 2010 - 08:19 PM.


#2 TheFierceDeity

TheFierceDeity

    Newbie

  • Members

Posted 17 May 2010 - 11:28 PM

Well I remember seeing something similar to what you are looking for on another forum I cannot remember the name though
I don't think it would be too hard to script except maybe Link only using Wolf attacks Hope you find someone who can help If you don't I know a guy I could ask who might help

#3 Zim

Zim

    Freelance Nobody

  • Members
  • Real Name:Zim
  • Location:Washington

Posted 18 May 2010 - 03:31 AM

Actually, I pretty much already did this without the wolf graphics though.. I'll modify. Be back in just a few.

#4 Daemon

Daemon

    Apprentice

  • Members
  • Real Name:Sabbastian
  • Location:United States

Posted 18 May 2010 - 07:33 AM

Yeah, I was going to try my hand at it, but it looks like Zim has it covered.

Also, it's not very hard to make alternate attacks. You can simply disable A and B (possibly L and R too) and assign the different attacks to them. The only real problems you'll face are if the attacks are too complicated. If you can make a scripted attack, you'll be able to give Link an alternate attack.

#5 Zim

Zim

    Freelance Nobody

  • Members
  • Real Name:Zim
  • Location:Washington

Posted 18 May 2010 - 11:33 PM

CODE

import "std.zh"
const int BITE_HURT=8; //Damage amount. Multiples of 4 for quarter hearts.
const int BITE_SPRITE=100;//Here goes Sprite #
const int LUNGE_DIST=8; //Distance Link will Lunge for a bite.
const int LUNGE_SPEED=8; //speed of Lunges, DON'T SET TO NEGATIVE!
const int LUNGE_DAMAGE=8;
const int WOLFDAT=20; //set the UP combo number here.
const int WOLFFC=1;//this FFC should not be used for anything else in the same
//screen as wolf Link
const int LUNGEFFC=2;
const int LUNGEFFCB=3;
const int BITE_SOUND=100; //Set to a sound
const int CURSOR_COMBO=36; //set this to a nice cursor/target combo,
//maybe even spinning and animated.
int UseBite; int rebound;
int tick;
int ruff; int UseLunge; int linkx; int linky;
int npcA;
int triA; int triB; int tri;
int WOLFMOD;
const int WOLF=145; //Set the item number here.
int tic;
int hold;
int LINKX; int LINKY;
int npcX; int npcY;
int HPLAST;
global script Slot_2    
{
    void run()
    {
    int tic=0;
    bool WOLFLINK=false;
    WOLFMOD=0;
    while(true)
    {
    HPLAST=Link->HP;
    tic=5;
    ffc wolf=Screen->LoadFFC(WOLFFC);
    wolf->X=Link->X-8; wolf->Y=Link->Y-8;
    Link->HitXOffset=8; Link->HitYOffset=8;
    if(!Link->InputEx1 && Link->InputEx2 && tic==5){hold=0; tic=10; Link->Item[WOLF]=false;}
    if(Link->InputEx1 && !Link->InputEx2 && tic==5){hold=0; tic=1; Link->Item[WOLF]=true;}
    if(tic<5 && hold==0 && tic>=1){wolf->Data=WOLFDAT-1; tic+=1;}
    if(tic==5 && Link->Item[WOLF]==true){WOLFLINK=true; hold=1;}
    if(tic==5 && Link->Item[WOLF]==false){WOLFLINK=false; wolf->Data=0;}
    if(tic>5 && hold==0 && tic<=10){wolf->Data=WOLFDAT-2; tic-=1;}
    lweapon BITE=Bitey();
    wolf->TileHeight=2; wolf->TileWidth=2;
    if(WOLFLINK==true && hold==1)
        {
        wolf->Data=WOLFDAT+Link->Dir;
        if(Link->InputUp || Link->InputDown || Link->InputLeft || Link->InputRight)
            {wolf->Data=WOLFDAT+Link->Dir+4;}
        if(WOLFMOD==1){wolf->Data+8;}
        if(Link->InputA && !Link->InputB && UseBite==0){UseBite+=1;}
        if(Link->InputB && !Link->InputA && UseLunge==0)
            {linkx=Link->X; linky=Link->Y; UseLunge+=1;}

        if(UseBite==1)
            {
            if(Link->Dir==0){Link->Y -=LUNGE_DIST; rebound=0;}                                        
            if(Link->Dir==1){Link->Y +=LUNGE_DIST; rebound=1;}
            if(Link->Dir==2){Link->X -=LUNGE_DIST; rebound=2;}
            if(Link->Dir==3){Link->X +=LUNGE_DIST; rebound=3;}
            }
        Attack(rebound, BITE); Lunge();
        }
        Waitframe();
    }
    }
    lweapon Bitey()
    {
    lweapon f;
    for(int i=1;i<=Screen->NumLWeapons();i++)
        {
        f = Screen->LoadLWeapon(i);
        if(f->ID == LW_SCRIPT1) return f;
        }
    f = Screen->CreateLWeapon(LW_SCRIPT1);
    f->Damage = BITE_HURT;
    f->UseSprite(BITE_SPRITE);
    return f;
    }        

    void Attack(int r, lweapon F)
        {
        while(UseBite==0)
            {F->DeadState=WDS_DEAD; return;}
        if(UseBite>=1 && UseBite<LUNGE_DIST+1)
        {
        UseBite+=1;
        if(Link->Dir==0){F->X=Link->X; F->Y=Link->Y-1;}
        if(Link->Dir==1){F->X=Link->X; F->Y=Link->Y+1;}
        if(Link->Dir==2){F->X=Link->X-1; F->Y=Link->Y;}
        if(Link->Dir==3){F->X=Link->X+1; F->Y=Link->Y;}
        if(Link->Dir==4){F->X=Link->X-1; F->Y=Link->Y-1;}
        if(Link->Dir==5){F->X=Link->X+1; F->Y=Link->Y-1;}
        if(Link->Dir==6){F->X=Link->X-1; F->Y=Link->Y+1;}
        if(Link->Dir==7){F->X=Link->X+1; F->Y=Link->Y+1;}
        if(UseBite==LUNGE_DIST+1)
        {
        if(r==0){Link->Y+=LUNGE_DIST; rebound=-1; UseBite=0;}
        if(r==1){Link->Y-=LUNGE_DIST; rebound=-1; UseBite=0;}    
        if(r==2){Link->X+=LUNGE_DIST; rebound=-1; UseBite=0;}    
        if(r==3){Link->X-=LUNGE_DIST; rebound=-1; UseBite=0;}
        }
        }
        }
    void Lunge()
        {
    if(UseLunge==0){return;}
    if(UseLunge>0)
        {if(Screen->NumNPCs()==0){UseLunge=0; return;}
        if(ruff<1){ruff=1;}
        lweapon hu=Screen->CreateLWeapon(LW_SCRIPT2);
        ffc TT=Screen->LoadFFC(LUNGEFFC);
        ffc SS=Screen->LoadFFC(LUNGEFFCB);
        SS->Data=1;
        npc AA=Screen->LoadNPC(ruff);
        TT->Flags[0]=true;
        
        while(tick>0){tick-=1; return;}
        if(Link->InputB && triA==0)
            {
            Link->X=linkx; Link->Y=linky;
            TT->Data=CURSOR_COMBO; TT->X=AA->X; TT->Y=AA->Y;
            if(Link->InputL)
                {
                ruff-=1;
                if(ruff==0)
                    {ruff=Screen->NumNPCs();}
                tick=5; return;
                }
            if(Link->InputR)
                {
                ruff+=1;
                if(ruff==Screen->NumNPCs()+1)
                    {ruff=1;}
                tick=5; return;    
                }
            }
        if(!AA->isValid() && ruff>1){ruff-=1;}
        if(!AA->isValid() && triA==1){TT->Data=1; triA=0; UseLunge=0;}
        if(!Link->InputB && triA==0)
            {triA=1; TT->Data=1; SS->X=Link->X; SS->Y=Link->Y;}
        if(triA==1)
            {
            if(Collision(SS, AA)==false)
                {WOLFMOD=1; Link->HP=HPLAST;
            SS->Vx=(AA->X-SS->X)/Distance(AA->X, SS->X, AA->Y, SS->Y)*LUNGE_SPEED;
            SS->Vy=(AA->Y-SS->Y)/Distance(AA->X, SS->X, AA->Y, SS->Y)*LUNGE_SPEED;
                Link->X=SS->X; Link->Y=SS->Y;
                }
            if(Collision(SS, AA)==true)
                {
                Link->HP=HPLAST; WOLFMOD=0; Game->PlaySound(BITE_SOUND);
                hu; hu->Damage=LUNGE_DAMAGE;
                hu->X=AA->X; hu->Y=AA->Y; hu->UseSprite(100); tick+=2; triA=2;}
            }
        if(triA==2)
            {TT->Data=0; UseLunge=0; triA=0; hu->DeadState=WDS_DEAD;}
        }
    }
        
}    

    



Here's all the basic code for it. It takes a bit of setting up.
Set the combo for the Wolf, a 2x2 tile, starting with up, then down, left, and right, then animated ones, up, down left and right, for the first 8, then up, down, left, right, jumping in air combos, could be animated or not.
Then also -1 from the first up combo is an animation of X frames settable at the top of the script for link turning into the wolf, -2 from the up combo is wolf into Link combo.
Most of the other constants that can be explained are set up top.
The WOLFFC, CURSORFFC, and the ffc that makes up the wolf itself are set to 1, 2, and 3, and they can be set to other numbers and shouldn't be used at all for anything else while the wolf form is being used, although you can use them anytime on any screen where the wolf form is unavailable altogether without a problem while using the ffc numbers assigned to the wolf form script.
I tried to get Link to attack at the end of the Lunge, but after a few hours of failure I gave up because I don't know why it wasn't working. I'll try some more later unless someone wants on this wagon and help finish this script, because it's pretty good.

the attacks are regular A attack, lunges forward, goes back.
Will add biting animation frames and combo assignments also soon.
The B button attack works much like Twilight Princess, but I haven't played that game since it came out and I played it through. icon_smile.gif
So the scheme is press B, hold B, select baddie with cursor with L and R, release B, or just press/release to select first npc and lunge.
Doesn't attack while lunging. But Link can attack with A while mid-lunge and after/anytime, and Link can get hurt when he's lunging towards the target also.

So there ya go!

Let me know how it works out for ya eh?


Oh yeah! And I forgot to mention, but I was going to post it last night..
Link->Equipment is disabled, so either you only use this script on a DMap with all items disabled but the WOLF item, OR myself or someone else could script a function that takes all possible items away, stores an equivelant 'fake item' integer for each one, then puts them all back on command when the WOLF item is swapped. It would have the same effect.
Good Luck.

Edited by Zim, 19 May 2010 - 12:01 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users