Jump to content

Photo

Boss script


  • Please log in to reply
8 replies to this topic

#1 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 20 December 2008 - 07:36 AM

hey scripters

Can I have a script that moves a fcc around in a circle and fires fireballs at you and ghosts an emeny to it to act as it's HP.

Thanks

~William Ronald


#2 Joe123

Joe123

    Retired

  • Members

Posted 20 December 2008 - 09:18 AM

I like nice simple ones like this.
Just cause it's a custom boss, doesn't mean it needs 500 different forms and have to have 10 different weapons used on it.
CODE
ffc script CircleBoss{
    void run(int enumber,int hp,int damage,int firerate,int radius,int speed){
        npc e = Screen->CreateNPC(enumber);
        e->HP = hp;
        int x = this->X; int y = this->Y;
        int counter;
        while(e->isValid()){
            this->X = x + Cos(counter*speed)*radius;
            this->Y = y + Sin(counter*speed)*radius;
            e->X = this->X;
            e->Y = this->Y;
            if(counter%firerate == 0){
                eweapon fball = Screen->CreateEWeapon(EW_FIREBALL);
                fball->X = this->X;
                fball->Y = this->Y;
                fball->Damage = damage;
            }
            
            counter = (counter+1)%360;
        Waitframe();
        }
        this->Data = 0;
    }
}

ffc's coordinates: centre of circle
D0: enemy to create
D1: HP of enemy
D2: damage for fireballs to deal
D3: rate for fireballs to fire
D4: radius
D5: speed of rotation

#3 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 20 December 2008 - 04:29 PM

Thanks joe I'll implat this straigt away,

Joe dose the FFC Have to be 2x2 beacsue I looked at the tiles I'm useing and they are 3x3 (but look 2.5x2.5)


#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 21 December 2008 - 04:27 AM

QUOTE(Joe123 @ Dec 20 2008, 06:18 AM) View Post

I like nice simple ones like this.
Just cause it's a custom boss, doesn't mean it needs 500 different forms and have to have 10 different weapons used on it.



icon_frown.gif Your logic makes my brain compiler sad. icon_frown.gif


Although, yeah. Keep on making these things and submitting them to the SDB. There's no reason for people not to use this stuff anymore. Good job! icon_thumbsup.gif

#5 Joe123

Joe123

    Retired

  • Members

Posted 21 December 2008 - 04:56 AM

Oh, currently it only works for a 1x1 ffc properly (if you use a larger ffc, it'll stick the enemy in the top left corner).
I'll set up a new version that works for larger ffcs.


And when was the last time you scripted one of those custom bosses for someone Gleeok? =P


EDIT:
CODE
ffc script CircleBoss{
    void run(int enumber,int hp,int damage,int firerate,int radius,int speed){
        npc e = Screen->CreateNPC(enumber);
        e->HP = hp;
        int x = this->X; int y = this->Y;
        int counter;
        while(e->isValid()){
            this->X = x + Cos(counter*speed)*radius;
            this->Y = y + Sin(counter*speed)*radius;
            e->X = this->X+8*(this->TileWidth-1);
            e->Y = this->Y+8*(this->TileHeight-1);
            if(counter%firerate == 0){
                eweapon fball = Screen->CreateEWeapon(EW_FIREBALL);
                fball->X = this->X+8*(this->TileWidth-1);
                fball->Y = this->Y+8*(this->TileHeight-1);
                fball->Damage = damage;
            }
            
            counter = (counter+1)%360;
        Waitframe();
        }
        this->Data = 0;
    }
}


Should work ok for bigger ffcs now.
If it does, I'll submit it to the database.

#6 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 21 December 2008 - 05:45 AM

QUOTE(Joe123 @ Dec 21 2008, 01:56 AM) View Post

And when was the last time you scripted one of those custom bosses for someone Gleeok? =P


Since like I posted about like 10 or so boss scripts, which to my knowlege, none have been used yet. Plus those enemy enhancement type scripts. Sure, they're outdated somewhat because back then we didn't have eweapons, but that doesn't mean anyone cannot combine them in various ways to produce all kinds of different custom bosses.

If you took all the scripts I've posted, put them in one .z file, you'd have enough custom bosses for 100 dungeons by interchanging them.

#7 Joe123

Joe123

    Retired

  • Members

Posted 21 December 2008 - 05:49 AM

Oh no, I meant when have you scripted a specific one for someone.

You know when they all post threads going 'ZOMGS I NEED TEH MOST EPIC CUXTOMS BOSS EVAAARRRR'?

That sort of thing.

#8 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 21 December 2008 - 06:13 AM

Oh yeah... @_@ Those ones.

I'm not sure people realize what a pain it is to make some of those. They require basic AI, multiple conditions, attacks, movement, it's like a bunch of scripts all into one really.

I will say this though, after working on a boss in cpp, I have to take my hat off to DD and jman for making zscript and ffcs that easy to use. People make to big a deal out of learning it, all you need is basic knowledge of c syntax, pointers, and expressions. Not that complicated really.

#9 Joe123

Joe123

    Retired

  • Members

Posted 21 December 2008 - 06:22 AM

You don't need any knowledge of pointers at all really.
Until about a month ago I thought the pointer was the little '->' operator =P

It points, doesn't it? =P


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users