Jump to content

Photo

Stronger Wizrobe


  • Please log in to reply
14 replies to this topic

#1 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 03 April 2010 - 08:25 AM

can someone make a script for me that uses a wizzrobe
im using a custom wizzrobe right ow which shoots 8 rising fireballs
but i want it to attack 3 times and shoot 8 fireballs in 2 seconds.
if someone could make me this it would be great icon_smile.gif

Edited by shucke, 03 April 2010 - 08:52 AM.


#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 03 April 2010 - 09:01 AM

Okey Dokie, sounds easy enough.

...Alright I gotta jet. Just add in the weapon code ..or maybe someone who feels like it could put it in there. Should be a fairly simple script.


CODE



const int SINGLE_DIRECT_SHOT = 0;
const int s36_SHOT = 1;



void addAngleShot(ffc f, int angle, int speed, int tile, int cset){

    eweapon laser;
    laser = Screen->CreateEWeapon(EW_SCRIPT1);
    laser->HitWidth=5;laser->HitHeight=5;laser->HitXOffset=4;laser->HitYOffset=4;
    laser->X=f->X;laser->Y=f->Y;laser->Step=speed;laser->Damage=2;laser->CSet=cset;laser->Tile=tile;
    laser->Angular=true;laser->Angle=angle*(PI/180);
}


void doDirectShot(ffc f,  int speed, int tile, int cset )
{
  addAngleShot( f,RadtoDeg(ArcTan(f->X-Link->X,f->Y-Link->Y)),  speed,  tile,  cset);
}


void do36Shot(ffc f,  int speed, int tile, int cset )
{
     for(int i;i<36;i++)
    {
         addAngleShot( f, i*10,speed,tile, cset);
    }
}


void fire_stuff( int type,  ffc f, int tile, int cset )
{
  if(type == SINGLE_DIRECT_SHOT) doDirectShot( f, 300,  tile, cset );
  if(type == s36_SHOT ) do36Shot( f, 200, tile, cset );

}


ffc script Instill_Energy //mkII 0.1 -will finish later;)
{
    void run(  int screen_enemy_number, int enemyHP, int delay, int burst, int burst_speed, int shot_type, int regen, int tile, int cset )
    {
        int d = 0; int b = 0;
        Waitframes(4);
        npc enemy = Screen->LoadNPC(screen_enemy_number);
        enemy->HP = enemyHP;

        while(true)
        {
            if(enemy->isValid())
            {
                d++;
                this->X = enemy->X;
                this->Y = enemy->Y;
                if(d > delay)
                {
                    if(b < burst)
                    {
                        d -= burst_speed; b++;
                
                        fire_stuff( shot_type, this, tile, cset );
                    }
                    else
                    {
                        b = 0; d = 0; enemy->HP += regen;
                    }
                }
            }
            else
            {
                this->X = 0; this->Y = 0; this->Data = 0; Quit();
            }
        Waitframe();
        }
    }
}


edit: ok try that.

These are your D[] arguments.
0-enemy number.
1-HP of enemy
2-delay between shots
3-how many shots are fired at interval D[4] of type 'shot_type;.
4-shot type (plug in system - If you want different projectile patterns just request one. ) see constants.
5-how much HP enemy will regenerate at 'delay' [NOT capped].
6-tile of weapon
7-cset of weapon
void run( int screen_enemy_number, int enemyHP, int delay, int burst, int burst_speed, int shot_type, int regen,int tile, int cset )


Untested but should work.

#3 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 03 April 2010 - 11:36 AM

uhm i got one question
i don't know how to put it into my game.
because when i use it as ffc it still don't work
and i got another question that have nothing to do with this script:
when i load another ffc script with Quest->scripts->compile Zscript and i load a ffc script the other ffc scripts i load before don't work anymore.

Edited by shucke, 03 April 2010 - 03:09 PM.


#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 03 April 2010 - 03:51 PM

I can answer your second file. When you load scripts, they all have to be in the same file. For example:

CODE

import "std.zh"

ffc script1{
(code goes here)
}

ffc script2{
(code goes here)
}


#5 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 04 April 2010 - 12:34 AM

OK that should work. The main nice thing here is that you can add in new weapon patterns with a few lines of code. Also I ran out of D[] args... >_>..




#6 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 04 April 2010 - 02:04 AM

now it gives a error:
line 16 unexpected indentifier on token f

#7 Joe123

Joe123

    Retired

  • Members

Posted 04 April 2010 - 04:15 AM

I edited Gleeok's post, try grabbing it again.

#8 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 04 April 2010 - 04:42 AM

it says now: line 19 unexpected rbrace, expecting semicolon or or, token on }

#9 Joe123

Joe123

    Retired

  • Members

Posted 04 April 2010 - 05:10 AM

Ok I edited it again.

#10 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 04 April 2010 - 06:07 AM

it compiles now but when i load it into a ffc slot it gives another error:

unable to parse instruction 9 from script stronger wiz
the error was: parameter 1 invalid!
the command was (PUSH) (d8,)

#11 Joe123

Joe123

    Retired

  • Members

Posted 04 April 2010 - 06:14 AM

What build are you using?

#12 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 04 April 2010 - 07:09 AM

build 1204

#13 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 04 April 2010 - 09:12 AM

Yeah, I suck at browser coding. Sue me. =p


I'm not sure about that error though. Did you change the script at all?

#14 shucke

shucke

    Junior

  • Members
  • Real Name:Robin
  • Location:Nederland

Posted 04 April 2010 - 09:18 AM

joe123 edited the script.
it compile now but as a said before it gives an error when i load it into a ffc slot

#15 Joe123

Joe123

    Retired

  • Members

Posted 04 April 2010 - 03:12 PM

Yeah, I added an ffc type identifier in a function declaration and put in a missing semicolon, I didn't break anything to do with ASM.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users