Jump to content

Photo

Bombchus =D


  • Please log in to reply
55 replies to this topic

#16 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 06 August 2008 - 10:05 AM

Technically it was Schwa's idea, since he suggested I make the prinnies movable in my quest, which would essentially be the same as a bombchu. icon_wink.gif

I'll have to give this a try, since I'm the one who requested it. icon_razz.gif Great job, as usual, Joe123! icon_biggrin.gif

#17 Joe123

Joe123

    Retired

  • Members

Posted 06 August 2008 - 04:15 PM

Ah ok.
I have no idea what a 'Prinnie' is, but fair enough.

And thanks.
'twould be great if the flags triggered properly >_<

#18 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 07 August 2008 - 11:30 AM

QUOTE(Joe123)
I have no idea what a 'Prinnie' is, but fair enough.

Dood!
(They're creatures in a game called Disgaea. They blow up when thrown.)

I tried out the script, and that is really awsome! icon_biggrin.gif I've got a question though;
Since it takes two global slots up, and I'm already using one for something else, is it possible to slip the script of one of the global scripts needed at the end of the one in my quest and import it like that? (SOrry if that sounds confusing. I can't think of a good way to put it.)

#19 Joe123

Joe123

    Retired

  • Members

Posted 07 August 2008 - 11:39 AM

No.
Global scripts don't work like that.
You can only have two, and they both have different functions, which is why they're named, 'slot 2' and 'slot 3'.
If you send your global script to me, I'll compile both of the scripts into one and then you can have both.

#20 SpacemanDan

SpacemanDan

  • Members
  • Location:Ontario, Canada

Posted 07 August 2008 - 11:51 AM

That's what I ment. I couldn't think of the right way to explain it. Sorry.

CODE
// Script to Manage Character Sprites During Cutscenes
// By LinktheMaster

import "std.zh"

// Int for the cset in which sprites use
int charCSet[50];

// Script to initialize the csets
global script init
{

    void run()
    {    
        // Sets the cset of the sprites
        charCSet[0] = 7;
        charCSet[1] = 8;
        charCSet[2] = 7;
        charCSet[3] = 2;
    }

}


It's the show speaker script LinkTheMaster made. At least, it's the global part of it.

#21 Joe123

Joe123

    Retired

  • Members

Posted 07 August 2008 - 02:07 PM

Oh sorry urm, can you also post up my bombchu script from the file?
I don't have access to it currently.

EDIT: Oh, and there are also a few other things I should point out about the script really.

You can't have superbombs, bombs and bombchus, only two of the three.
(well, currently you can't have bombchus and superbombs, but I could edit the script quite easily to do that)
Which isn't really a problem I shouldn't think, I mean, who really uses superbombs these days anyway?
They suck.

Anyway, so what you have to do is:
Go to your superbomb item in the item editor, and set it's fuse duration to three (not one, not two, but three (or longer if you really want)).
Make a new custom item with a custom itemclass that you can put on your subscreen instead of the superbomb itemclass, and give it the bombchu item pickup graphics, and it's action script should be the bombchu script.
Then, make another item called bombchu ammo or summat, and make that item so that it looks like a small number of bombchus or whatever, and set up it's pickup information so it increases your number of superbombs by whatever (counter reference 6).
Cause you see, bombchus use the superbomb counter.
So what you do is replace superbombs with bombchus.
Then, when you pick up the bombchu item, it'll add bombchus to your inventory, but it'll only work whilst you have superbombs in the counter (duh).
So if you make an ammo pickup item (you could model it on the 'bomb ammunition' item and replace the counter reference number with 6 if you so desired), Link wil then acquire more 'bombchus' when he gets that item.

That's about it I think.

Edited by Joe123, 07 August 2008 - 02:12 PM.


#22 Joe123

Joe123

    Retired

  • Members

Posted 16 August 2008 - 06:12 PM

Right then!
They're now fixed, and they trigger flags just like you'd want 'em to!
Turns out it wasn't a ZC bug, I'd just got them exploding slightly too early.

But enough of that, and more of the script!

CODE
import "std.zh"

const int bombchuflag = 98; //Flag the bombchu can pass through (even if solid)

bool bombchuattack;
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8) mask&=0011b;
else mask&=1100b;
if(y%16<8) mask&=0101b;
else mask&=1010b;
return (!(Screen->ComboS[ComboAt(x,y)]&mask)==0);
}

bool bombchucheck(int x, int y){
    if((isSolid(x,y) && Screen->ComboF[ComboAt(x,y)] != bombchuflag && Screen->ComboI[ComboAt(x,y)] != bombchuflag)
     || (Screen->ComboF[ComboAt(x,y)] == 6 || Screen->ComboI[ComboAt(x,y)] == 6 ||Screen->ComboF[ComboAt(x,y)] == 11 || Screen->ComboI[ComboAt(x,y)] == 11)) return true;
}

void noaction(){
    Link->InputR = false;
    Link->InputL = false;
    Link->InputA = false;
    Link->InputB = false;
    Link->InputUp = false;
    Link->InputDown = false;
    Link->InputRight = false;
    Link->InputLeft = false;
}
global script slot_2{
    void run(){
    int bombchutile = 20; //Set the tile for your weapon here. Up, Down, Left, Right it should be on the tilepage.
    int bombchuframes = 2; //Set the number of animation frames here.
    int bombchuaspeed = 10;//Set the animation speed here
    int bombchucset = 8; //Set the CSet here
    
    int bombchudmg = 2;  //Set the damage here
    int bombchuspeed = 1; //Set the speed of the bombchu here

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;

        while(true){
            if(bombchuattack){
                if(Link->X > 15 && Link->X < 241 && Link->Y > 15 && Link->Y < 153){
                lweapon bombchu = Screen->CreateLWeapon(31);
                    bdir = Link->Dir;
                    bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchu->Tile = bombchutile+(bdir*bombchuframes);
                    bombchu->NumFrames = bombchuframes;
                    bombchu->ASpeed = bombchuaspeed;
                    bombchu->CSet = bombchucset;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    bombchu->X = Link->X+bombchux;
                    bombchu->Y = Link->Y+bombchuy;
                    bombchu->Step = bombchuspeed;
                    Link->Action = LA_ATTACKING;
                    Game->Counter[6]--;
                    Waitframe();

                    while(bombchu->isValid()){
                        HP = Link->HP;
                        if(Link->InputUp) bdir = 0;
                        if(Link->InputDown) bdir = 1;
                        if(Link->InputLeft) bdir = 2;
                        if(Link->InputRight) bdir = 3;
                        if(bdir == 0 && bombchucheck(bombchu->X+8,bombchu->Y+4)
                        || (bdir == 1 && bombchucheck(bombchu->X+8,bombchu->Y+12))
                        || (bdir == 2 && bombchucheck(bombchu->X+4,bombchu->Y+8))
                        || (bdir == 3 && bombchucheck(bombchu->X+12,bombchu->Y+8))) bombchu->DeadState = 0;
                        bombchu->Dir = bdir;
                        bombchu->Tile = bombchutile+(bdir*bombchuframes);
                        bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchux = bombchu->X;
                    bombchuy = bombchu->Y;
                    noaction();
                    Waitframe();
                    if(Link->HP < HP) bombchu->DeadState = 0;
                    }
                
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->Damage = bombchudmg;
                    explosion->X = bombchux;
                    explosion->Y = bombchuy;
                }else{
                    bdir = Link->Dir;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->X = Link->X+bombchux;
                    explosion->Y = Link->Y+bombchuy;
                    explosion->Damage = bombchudmg;
                }
            Link->Action = 0;
            bombchuattack = false;
            }
        Waitframe();
        }
    }
}

global script slot_3{
    void run(){
        bombchuattack = false;
    }
}

item script bombchu{
    void run(){
        if(Game->Counter[6] > 0) bombchuattack = true;
    }
}


Here we go.
I've also updated with a new link, so here's the file: bombchu.qst

Is there anyone who'd take that file and make a video of it for me?
I'd really appreciate that.

Anyway, here we go for the tutorial!

How to use the Bombchu script
By Joe123

Contents
  1. The Tiles
  2. Setting up the Superbombs
  3. The Script
  4. The Items
  5. The Subscreen
  6. Notes
A. The Tiles
Firstly, find yourself some nice Bombchu tiles.
They should be able to face in four directions.
The Classic tileset has some as default, and EZGBZ may have some (cause they're in the gameboy zeldas), but I haven't checked.
  • Rip them on to your tilepage, and arrange them in this order:
    Up, Down, Left, Right.
  • If you want them to animate, place the animations after the first one (ie; Up1, Up2, Down1, Down2 etc.).
  • Write down the number of the first tile (so the up facing one).
B. Setting up the Superbombs
Now, you won't be using superbombs in your quest if you want bombchus, so we first have to sabotage our superbomb item.
  • Go to Quest->Items->Superbombs.
  • Change the fuse duration of your superbomb to '3'
C. The Script
  • Now go to the lines in the script that are noted (have '//' before them), and change the inputs to suit your needs (putting in the number you wrote down earlier for the bombchutile input).
  • Make sure to set up the number of animation frames properly here, otherwise it just won't work.
  • Compile the script, and put the script called 'slot_2' into global script slot 2, the script called 'slot_3' into global slot 3, and write down the number of the slot you assign the item script to.
D. The Items
This is the complicated part.
  • Make a new custom item with a custom itemclass, give it the bombchu item pickup graphics, and set it's action script to the bombchu script (and call it 'bombchu' or something).
  • Make sure to tick the 'Equipment Item' box, and then go to your subscreen editor.
  • Make another custom item called 'Bombchu Ammo' (or simmilar).
  • Open up the 'Bomb Ammunition' item, and copy everything about this item over into your new 'Bombchu Ammo' item.
  • On the pick-up tab, change the 'counter reference' box to '6'.
  • Change its graphics to be that of a bombchu, rather than a bomb.
E. The Subscreen
  • On the subscreen, add a space for this new itemclass (probably over the top of your superbombs, as you won't be needing them anymore).
  • Change the graphics of your super-bomb counter to be that of a bombchu.
F. Notes
It is not possible to have superbombs, bombs and bombchus; only two of the three(well, currently you can't have bombchus and superbombs, but no bombs, however I could edit the script quite easily to do that).
When giving the player the bombchus in the first place, give him the first item you made (the one with the entry on the subscreen).
Then, when you want him to pick up more bombchus, place a 'bombchu ammunition' item on the screen, which will then increase Link's number of bombchus by however much you like.
Link can now be damaged while using the bombchus!
The bomb will explode when Link is hurt.




And there we have it.
If anyone would like to have any parts of the tutorial better explained, let me know and I'll be happy to do it.

#23 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 17 August 2008 - 11:29 AM

QUOTE(Joe123 @ Aug 17 2008, 12:12 AM) View Post

Here we go.
I've also updated with a new link, so here's the file: bombchu.qst

Is there anyone who'd take that file and make a video of it for me?
I'd really appreciate that.

Anyway, here we go for the tutorial!

hows this for a veido
http://www.youtube.c...h?v=7NiNeR0hTVk




#24 Marco

Marco

  • Banned

Posted 17 August 2008 - 11:42 AM

That video was great billy icon_smile.gif

#25 Shoelace

Shoelace

    The Shaman of Sexy!

  • Members
  • Real Name:Michael
  • Pronouns:He / Him
  • Location:Arizona

Posted 17 August 2008 - 05:47 PM

This is a real kick ass item. I am definitely going in my game for damn sure, I already have some great puzzle items. One thing though, when Link gets hit by an enemy he doesn't get hurt while using the item. So he is invincible. Is there any word on if you are going to change that, because I can see this being a huge limitation. For example, when fighting a boss or something like that, you can use the bombchu and be invincible and therefore not getting hit, making the boss easy, especially if it was weak to bombs. So just wondering, is that going to be fixed?

Edit: What I had in mind is that if it hits Link it will just cancel out of the bombchu, making it blow up on spot. That would be the best way to go in my opinion.

#26 Joe123

Joe123

    Retired

  • Members

Posted 19 August 2008 - 01:20 PM

That video is excellent thanks a lot Billy =D




Yah well, that was by far the easiest way of it doing it more than anything I'm afraid.
I might have a go at re-writing it so that they explode after you're damaged, but I tried doing something like that before and it didn't go so well.

I'll post a new script in here if I do get round to that.

EDIT:
OK, well that was significantly easier than I expected.

The bombchu now explodes if Link is damaged whilst he is controlling it!

So there'ya go guys!
Fully-functional bombchus for you all!

I've updated the script in the thread with the instructions, so just use that one instead =)

#27 Purplemandown

Purplemandown

    The Old Guard

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

Posted 03 September 2008 - 07:40 PM

I need you to either-

A. compile these 2 scripts together, or

B. compile one of my quest's global scripts (you actually wrote it-L-button straffe) with one of these.

but this does look prommesing!

#28 Joe123

Joe123

    Retired

  • Members

Posted 04 September 2008 - 06:35 AM

Yes I can.
If you post the l-strafe script in here, then I can compile them together.

#29 Purplemandown

Purplemandown

    The Old Guard

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

Posted 06 September 2008 - 08:57 PM

CODE
global script slot_2{
    void run(){
    int lastd;
        while(true){
            if(Link->InputL){
                Waitdraw();
                Link->Dir = lastd;
            }
        lastd = Link->Dir;
        Waitframe();
        }
    }
}

Edited by Purplemandown, 06 September 2008 - 08:59 PM.


#30 Joe123

Joe123

    Retired

  • Members

Posted 07 September 2008 - 05:32 AM

Oh.
I didn't realise it was such a simple script.
CODE
import "std.zh"

const int bombchuflag = 98; //Flag the bombchu can pass through (even if solid)

bool bombchuattack;
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x%16<8) mask&=0011b;
else mask&=1100b;
if(y%16<8) mask&=0101b;
else mask&=1010b;
return (!(Screen->ComboS[ComboAt(x,y)]&mask)==0);
}

bool bombchucheck(int x, int y){
    if((isSolid(x,y) && Screen->ComboF[ComboAt(x,y)] != bombchuflag && Screen->ComboI[ComboAt(x,y)] != bombchuflag)
     || (Screen->ComboF[ComboAt(x,y)] == 6 || Screen->ComboI[ComboAt(x,y)] == 6 ||Screen->ComboF[ComboAt(x,y)] == 11 || Screen->ComboI[ComboAt(x,y)] == 11)) return true;
}

void noaction(){
    Link->InputR = false;
    Link->InputL = false;
    Link->InputA = false;
    Link->InputB = false;
    Link->InputUp = false;
    Link->InputDown = false;
    Link->InputRight = false;
    Link->InputLeft = false;
}
global script slot_2{
    void run(){
    int lastDir;
    int bombchutile = 20; //Set the tile for your weapon here. Up, Down, Left, Right it should be on the tilepage.
    int bombchuframes = 2; //Set the number of animation frames here.
    int bombchuaspeed = 10;//Set the animation speed here
    int bombchucset = 8; //Set the CSet here
    
    int bombchudmg = 2;  //Set the damage here
    int bombchuspeed = 1; //Set the speed of the bombchu here

    int HP;
    int bdir;
    int bombchux; int bombchuy;
    lweapon explosion;

        while(true){
            if(bombchuattack){
                if(Link->X > 15 && Link->X < 241 && Link->Y > 15 && Link->Y < 153){
                lweapon bombchu = Screen->CreateLWeapon(31);
                    bdir = Link->Dir;
                    bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchu->Tile = bombchutile+(bdir*bombchuframes);
                    bombchu->NumFrames = bombchuframes;
                    bombchu->ASpeed = bombchuaspeed;
                    bombchu->CSet = bombchucset;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    bombchu->X = Link->X+bombchux;
                    bombchu->Y = Link->Y+bombchuy;
                    bombchu->Step = bombchuspeed;
                    Link->Action = LA_ATTACKING;
                    Game->Counter[6]--;
                    Waitframe();

                    while(bombchu->isValid()){
                        HP = Link->HP;
                        if(Link->InputUp) bdir = 0;
                        if(Link->InputDown) bdir = 1;
                        if(Link->InputLeft) bdir = 2;
                        if(Link->InputRight) bdir = 3;
                        if(bdir == 0 && bombchucheck(bombchu->X+8,bombchu->Y+4)
                        || (bdir == 1 && bombchucheck(bombchu->X+8,bombchu->Y+12))
                        || (bdir == 2 && bombchucheck(bombchu->X+4,bombchu->Y+8))
                        || (bdir == 3 && bombchucheck(bombchu->X+12,bombchu->Y+8))) bombchu->DeadState = 0;
                        bombchu->Dir = bdir;
                        bombchu->Tile = bombchutile+(bdir*bombchuframes);
                        bombchu->OriginalTile = bombchutile+(bdir*bombchuframes);
                    bombchux = bombchu->X;
                    bombchuy = bombchu->Y;
                    noaction();
                    Waitframe();
                    if(Link->HP < HP) bombchu->DeadState = 0;
                    }
                
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->Damage = bombchudmg;
                    explosion->X = bombchux;
                    explosion->Y = bombchuy;
                }else{
                    bdir = Link->Dir;
                    bombchux = 0; bombchuy = 0;
                    if(bdir>1) bombchux = (((bdir-2)*2)-1)*16;
                    if(bdir<2) bombchuy = ((bdir*2)-1)*16;
                    explosion = Screen->CreateLWeapon(LW_SBOMB);
                    explosion->X = Link->X+bombchux;
                    explosion->Y = Link->Y+bombchuy;
                    explosion->Damage = bombchudmg;
                }
            Link->Action = 0;
            bombchuattack = false;
            }
            lastDir = Link->Dir;
        Waitdraw();
        if(Link->InputL) Link->Dir = lastDir;
        Waitframe();
        }
    }
}

global script slot_3{
    void run(){
        bombchuattack = false;
    }
}

item script bombchu{
    void run(){
        if(Game->Counter[6] > 0) bombchuattack = true;
    }
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users