Jump to content

Photo

Smashing Triforce


  • Please log in to reply
8 replies to this topic

#1 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 27 January 2011 - 05:48 PM

Hi! I'm requesting an item script and I hope someone is willing to take the time for making it.
The Smashing Triforce is an equipable item that can only be used if link has one triforce power (counter 9)!

-How it works-
1: Sound effect 71 plays
2: An increasing equilateral triangle will appear over link (flashes between color 86 and 87) (increasing speed: normal), for 3 seconds (Link and enemies can't move)
3: Sound effect 72 plays, It stops increasing and stays at this for 1,5 seconds
4: Sound effect 73 plays, triangle vanishes. Kill all enemies (maybe with this killallenemy item)

If you don't understand what I wrote, just post. If it's not possible (beta 18), just post. icon_cheese.gif
Is this going to be an Item/Global script, or will it need also ffc?

#2 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 05 February 2011 - 12:45 AM

I'll cover this one. Just give me some time...

EDIT: It'll either be item/global or item.... no ffc needed...

EDITWO: I'll do this this weekend. I'm kinda busy right now...

Edited by Purplemandown, 08 February 2011 - 09:40 PM.


#3 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 15 February 2011 - 04:56 PM

Just bumping the thread..
Do you still wan't to make the script? Thanks for answering the ffc question! Can it really be just an item script without global? That would be great!
Though it's not so bad if it needs global icon_smile.gif

#4 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 15 February 2011 - 05:08 PM

Item scripts can't run for more than one frame, so I can't do an animation on the screen without a global script...

But first, I have a question. I've done all but the animation, and I need the number of a combo that is the color you want the triangle (because of the stupid way Zscript does triangles...

And yes, I've just got caught up in school and stuff... I'll have it done soon, really just after I get that combo number.

#5 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 16 February 2011 - 01:31 AM

Combo 28 has the right color. (Would it be possible to animate the combo, so that the color flashes between yellow and a lighter yellow?)

#6 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 16 February 2011 - 05:38 PM

Sure, that should work.

(I don't see why not...)

Also, which CSet is the combo you want?

CODE
import "std.zh"

        
global script slot_2{
    void run(){
        while(true){
            if(Screen->D[7] == 1){
                TriangleGrow();
            }
        Waitframe();
        }
    }
    void TriangleGrow(){
        int tx1 = (Link->X + 8);
        int ty1 = (Link->Y + 8);
        int tx2 = (Link->X + 8);
        int ty2 = (Link->Y + 8);
        int tx3 = (Link->X + 8);
        int ty3 = (Link->Y + 8);
        int timer = 0;
        item stunner = Screen->CreateItem(I_CLOCK);
        stunner->X = Link->X;
        stunner->Y = Link->Y;
        while(timer < 90){
            Link->InputStart = false;
            Link->InputMap = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputL = false;
            Link->InputR = false;
            Link->InputEx1 = false;
            Link->InputEx2 = false;
            Link->InputEx3 = false;
            Link->InputEx4 = false;
            Link->InputAxisUp = false;
            Link->InputAxisDown = false;
            Link->InputAxisLeft = false;
            Link->InputAxisRight = false;
            Screen->Triangle(6, tx1, ty1, tx2, ty2, tx3, ty3, 8, 8, 7, 0, -28, PT_TRANSTEXTURE);
            ty1--;
            tx2--;
            ty2++;
            tx3++;
            ty3++;
            timer++;
            Waitframe();
        }
        while(timer < 180){
            
            Game->PlaySound(72);
            Link->InputStart = false;
            Link->InputMap = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputL = false;
            Link->InputR = false;
            Link->InputEx1 = false;
            Link->InputEx2 = false;
            Link->InputEx3 = false;
            Link->InputEx4 = false;
            Link->InputAxisUp = false;
            Link->InputAxisDown = false;
            Link->InputAxisLeft = false;
            Link->InputAxisRight = false;
            Screen->Triangle(6, tx1, ty1, tx2, ty2, tx3, ty3, 8, 8, 7, 0, -28, PT_TRANSTEXTURE);
            timer++;
            Waitframe();
        }
        Game->PlaySound(73);
        item killer = Screen->CreateItem(I_KILLALL);
        killer->X = Link->X;
        killer->Y = Link->Y;
        Screen->D[7] = 0;
    }
}

item script SmashingTriforce{
    void run(){
        Game->PlaySound(71);
        Screen->D[7] = 1;
    }
}


Some things about this...

It is both global and item script.

I'm not sure if it tiles combo 28, or if it makes a block of combos starting with 28, but if it does the latter, you'll have to make the block of combos.

If, for whatever reason you need to change the combo, find where the combo reference is (-28 in the Triangle routines. THERE ARE 2, IF YOU CHANGE ONE, CHANGE THEM BOTH!!!). Keep it negative if you do need to change it.

Right now, the CSet is CSet 7. If you want to change that, find the 7 in the triangle routines, like above. There are 2.

Also, I had to change the timing of it (to make it easier on me to make). It increases for 1.5 seconds, and pauses for 1.5 seconds.

Well, there you go.

Edited by Purplemandown, 16 February 2011 - 09:53 PM.


#7 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 17 February 2011 - 09:22 AM

Wow, it works really good.
The combos aren't right, though. It does not start with combo 28. It uses 208-219 and 244-251 and about 10 more combos I can't define..

Works right, looks wrong. Great job with the enemy stun and kill thing! ;D
Do you know wich combos I need to change yellow now?

#8 Purplemandown

Purplemandown

    The Old Guard

  • Members
  • Real Name:Nathan
  • Location:Milwaukee, WI

Posted 17 February 2011 - 05:32 PM

I'm sorry, no. I haven't used the triangle function before, and I'm using it as the documentation says I should...

#9 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 18 February 2011 - 03:41 PM

Well, I finally found out wich combos it uses icon_biggrin.gif! I made them flashing yellow, and now it works perfectly. Thanks!! You have created an awesome item, and it works, how I planned it! icon_smile.gif

1 more request:
Can someone combine the script above with the Deku Nut Script?
I tried to combine it myself using the global script combining guide, but then I got compile errors.

CODE
const int DN_SPRITE = 18; //The sprite for the nut. This is the index found in Weapons/Misc
const int DN_THROW = 1; //Sound of throwing the deku nut
const int DN_EXPLODE = 3; //Sound of the next exploding
const int DN_STUN = 11; //Sound of enemies getting stunned
const int DN_TIME = 100; //Amount of time enemies are stunned for (in frames)
const int DN_RADIUS = 48; //The radius of the range of the nut (in pixels)
const int DN_SPEED = 250; //How fast the nut will go
const int DN_COUNTER = 7; //Which counter to use for the ammo

//Changing these will cause the script to not work
bool DN_dekuNutUse = false;
bool DN_active = false;
bool DN_explode = false;

global script slot_2{
    void run(){
        eweapon DN_NUT;
        while(true){
            if(Screen->D[7] == 1){
                TriangleGrow();
            }
        Waitframe();
        }
    }
    void TriangleGrow(){
        int tx1 = (Link->X + 8);
        int ty1 = (Link->Y + 8);
        int tx2 = (Link->X + 8);
        int ty2 = (Link->Y + 8);
        int tx3 = (Link->X + 8);
        int ty3 = (Link->Y + 8);
        int timer = 0;
        item stunner = Screen->CreateItem(I_CLOCK);
        stunner->X = Link->X;
        stunner->Y = Link->Y;
        while(timer < 90){
            Link->InputStart = false;
            Link->InputMap = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputL = false;
            Link->InputR = false;
            Link->InputEx1 = false;
            Link->InputEx2 = false;
            Link->InputEx3 = false;
            Link->InputEx4 = false;
            Link->InputAxisUp = false;
            Link->InputAxisDown = false;
            Link->InputAxisLeft = false;
            Link->InputAxisRight = false;
            Screen->Triangle(6, tx1, ty1, tx2, ty2, tx3, ty3, 8, 8, 7, 0, -28, PT_TRANSTEXTURE);
            ty1--;
            tx2--;
            ty2++;
            tx3++;
            ty3++;
            timer++;
            Waitframe();
        }
        while(timer < 180){
            
            Game->PlaySound(72);
            Link->InputStart = false;
            Link->InputMap = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputL = false;
            Link->InputR = false;
            Link->InputEx1 = false;
            Link->InputEx2 = false;
            Link->InputEx3 = false;
            Link->InputEx4 = false;
            Link->InputAxisUp = false;
            Link->InputAxisDown = false;
            Link->InputAxisLeft = false;
            Link->InputAxisRight = false;
            Screen->Triangle(6, tx1, ty1, tx2, ty2, tx3, ty3, 8, 8, 7, 0, -28, PT_TRANSTEXTURE);
            timer++;
            Waitframe();
        }
        Game->PlaySound(73);
        item killer = Screen->CreateItem(I_KILLALL);
        killer->X = Link->X;
        killer->Y = Link->Y;
        Screen->D[7] = 0;
    }
}
            if(Game->Counter[DN_COUNTER] > 0 && DN_dekuNutUse){
                Game->Counter[DN_COUNTER] --;
                Link->Action = LA_ATTACKING;
                Game->PlaySound(DN_THROW);
                DN_NUT = Screen->CreateEWeapon(LW_SCRIPT1);
                DN_NUT->X = Link->X;
                DN_NUT->Y = Link->Y;
                DN_NUT->Dir = Link->Dir;
                DN_NUT->Step = DN_SPEED;
                DN_NUT->CollDetection = false;
                DN_NUT->UseSprite(DN_SPRITE);        
                DN_active = true;
            }
            if(DN_active){DN_NUT = dekuNutCheck(DN_NUT);}
            if(DN_explode){dekuNutExplode(DN_NUT);}
            DN_dekuNutUse = false;
        }
    }
}

//Check to see if it hit a solid object or enemy. If it has, it explodes on contact.
eweapon dekuNutCheck(eweapon DN_NUT){
    npc e;
    //Check to see if it hit a solid combo
    if(!CanWalk(DN_NUT->X,DN_NUT->Y,DN_NUT->Dir,1, true)){
        DN_explode = true;
        DN_active = false;
    }
    //Scan through the enemies and see if it hit any of them
    for(int i = 1; i <= Screen->NumNPCs(); i++){
        Waitframe();
        e = Screen->LoadNPC(i);
        if(Collision(DN_NUT,e)){
            DN_explode = true;
            DN_active = false;            
        }
    }
    return DN_NUT;
}

//Because of how the above is set-up, it'd be easier to make this a seperate function
void dekuNutExplode(eweapon DN_NUT){
    int x = DN_NUT->X;
    int y = DN_NUT->Y;
    eweapon bomb;
    bomb = Screen->CreateEWeapon(EW_SBOMBBLAST);
    bomb->X = DN_NUT->X;
    bomb->Y = DN_NUT->Y;
    bomb->CollDetection = false;
    Game->PlaySound(DN_EXPLODE);
    Remove(DN_NUT);
    bool hit;
    npc e;
    //Check all the enemies to see if they are within the radius of the nut's explosion    
    for(int i = 1; i <= Screen->NumNPCs(); i++){
        Waitframe();
        e = Screen->LoadNPC(i);
        //Using a circular collision makes this easier to work with
        if(CircleCollision(x,y,DN_RADIUS,e->X,e->Y,8)){
            hit = true;
            e->Stun = DN_TIME;
        }
    }    
    if(hit){Game->PlaySound(DN_STUN);}
    DN_explode = false;    
}
item script SmashingTriforce{
    void run(){
        Game->PlaySound(71);
        Screen->D[7] = 1;
    }
}
item script DekuNutItem {
    void run(){
        DN_dekuNutUse = true;
    }
}



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users