PDA

View Full Version : Rapid-fire enemy script.



Gleeok
08-03-2007, 08:49 PM
Anybody wan't to walk me through this?
*Note* I am a scripting retard. ;D

OK, this is where i'm at thus far:


const int WPN_ENEMYFIREBALL = 33;

const int NPC_PATRABS = 103;
..and not much more....X(

So you can guess what i'm trying to do here, and I know that's not much, but any help with A) A script that gives an npc(patraBS in this case) a rapid fire fireball script, or B) teaching me how to make this script, would be greatly appreciated. ;)

ShadowMancer
08-03-2007, 08:59 PM
Sorry this is not possible yet, as zscript does not have control of spawned weapons (enemy fireballs, links lit bombs, fired arrows, etc)
Although you could mock this effect with FFC's as damage combos, but it would take an amount of FFC's each fireball would have to be an FFC. I might write up a quick script for you later, I got some stuff to do right now..

Gleeok
08-03-2007, 09:14 PM
Well that's a bummer.

So you would create an FCC that behaved like a fireball....hmm...well thanks.
I wish I could figure out how this stuff works.

ShadowMancer
08-03-2007, 09:39 PM
Yea, that is pretty much it, I am working on the script now. My best advice to learn scripting is to look at as many scripts as possible, watch how they work start by modifiying small things (number values etc.) It will make sense after awhile. Its all a matter of logic, once you understand the logic you just need to learn the language, most languages work pretty much the same just different key words (there is more to it than that but the basic logic is the same) Anyways, back to the script, you won't be able to block the fireballs with any sheild (it may be possible to mock the behivior of a sheild, but kind of complex for me right now, as I am still learning zscript myself) But besides that it will act exactly like an enemy fireball. Do you want them to fire stright or be aimed at link, and how many fireballs do you want the be fired in succision (I was thinking 6 or 7 fireballs a short pause and then enemy will fire again, but hey its your script you decide :D )

Gleeok
08-03-2007, 10:13 PM
you won't be able to block the fireballs with any sheild

Who wants to block them? :D XD


Yeah Since this is kind of a boss type enemy script, 6-10 fireballs with short pause would be awesome.

-Also would it be possible to break up this one script to many, each one with different graphic-damage-etc. I might learn alot from that just trying to create variants myself. Thanks alot for the help!


EDIT: Oh yeah, they'd be fired at link, right?

C-Dawg
08-04-2007, 12:34 AM
Download the latest version of my Zodiac quest. There's a script in there for rapid-fire enemy guns. The only part of it that isnt currently working is the "omnidirectional" part - it fires in four directions just fine.

Feel free to grab it and get it fully functional.

ShadowMancer
08-04-2007, 03:20 AM
okay here it is:



int fire_boss_alive = 1;

ffc script fireball_ctrl {
void run() {
//setup vars
ffc fball_1 = Screen->LoadFFC(2);
ffc fball_2 = Screen->LoadFFC(3);
ffc fball_3 = Screen->LoadFFC(4);
ffc fball_4 = Screen->LoadFFC(5);
ffc fball_5 = Screen->LoadFFC(6);
ffc fball_6 = Screen->LoadFFC(7);
ffc fball_7 = Screen->LoadFFC(8);
npc fboss = Screen->LoadNPC(1);
int fball_cnt = 0;

while(true) {

if (fire_boss_alive == 1)
{

this->X = fboss->X;
this->Y = fboss->Y;
if (fball_1->CSet == 0) {
fball_1->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_2->CSet == 0) {
fball_2->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_3->CSet == 0) {
fball_3->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_4->CSet == 0) {
fball_4->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_5->CSet == 0) {
fball_5->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_6->CSet == 0) {
fball_6->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_7->CSet == 0) {
fball_7->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_cnt >= 7) {
fball_cnt = 0;
Waitframes(30);
}
if (fboss->HP < 100) { fire_boss_alive = 0; }
}
else {
fboss->Tile = 65500;
fboss->X = -16;
fboss->Y = -16;
fboss->Weapon = 0;
}
Waitframe();
}
}
}


ffc script boss_fball {
void run (int tnum, int spd) {
//setup vars
npc boss = Screen->LoadNPC(1);
this->CSet = 0;
this->Data = 0;
int shoot = 0;
int dx = 0;
int dy = 0;
int dist = 0;
int rnd_x = 0;
int rnd_y = 0;
while (true) {
if (this->CSet == 0) {
this->X = boss->X;
this->Y = boss->Y;
}
if (this->CSet != 0 && shoot == 0) {
this->Data = tnum;
shoot = 1;
dx = (Link->X+8) - (this->X+8);
dy = (Link->Y+8) - (this->Y+8);
dist = Sqrt(dx*dx + dy*dy);
rnd_x = Rand(4)-2;
rnd_y = Rand(4)-2;
}
if (this->CSet != 0 && shoot == 1) {
this->X += rnd_x + (dx / dist) * spd;
this->Y += rnd_y + (dy / dist) * spd;

}
if(this->X <0 || this->X > 240 || this->Y <0 || this->Y >160) {
this->CSet = 0;
this->Data = 0;
shoot = 0;
}
Waitframe();
}
}
}


It is currently set up to use 7 fireballs, so you will need 8 FFC's in the room make the first FFC the controler, and then make the next 7 the fireballs. you don't need to change the graphic in the FFC editor, but set the combo type to damage combo. make sure the fireball you want to use is a combo, then put the combo ID number in the first argument of the fireball FFC's (you can use different combos for each one this way, as you requested, and damage is controled by what type of damage combo you make each FFC) The secound argument of the fireball FFC's is the speed (about 5 or 6 seemed to work good on my tests) Then all you need is an enemy in the room (the first enemy on the list will shoot the fireballs) make sure to add 100 HPs to the enemy as the script will 'kill' the enemy when he goes below 100 HPs, once 'killed' he will never return. Let me know how it works for you


EDIT: oops almost forgot, the script is setup to put the fireball in Cset 8, you can change that if you like. use any cset execpt 0, as cset 0 is used to 'deactivate' the fireball

Gleeok
08-04-2007, 03:38 AM
Wow, that's awesome Shadowmancer. Friggin awesome...

I will now quoth: *Note* I am a scripting retard. ;D

I have questions. ;)

[
so you will need 8 FFC's in the room make the first FFC the controler, and then make the next 7 the fireballs. you don't need to change the graphic in the FFC editor
...i'm not sure how to set this up.....sorry


then put the combo ID number in the first argument of the fireball FFC's (you can use different combos for each one this way, as you requested, and damage is controled by what type of damage combo you make each FFC) The secound argument of the fireball FFC's is the speed (about 5 or 6 seemed to work good on my tests)
so the * is where i put in the numbers i'm assuming.


Then all you need is an enemy in the room (the first enemy on the list will shoot the fireballs) make sure to add 100 HPs to the enemy as the script will 'kill' the enemy when he goes below 100 HPs, once 'killed' he will never return. Let me know how it works for you

So I use the F9 screen flags to set the fcc script, right?

Also, just wondering...why add 100 hp? ..sorry if it's a stupid question. thanks in advance. ;p

EDIT: is there a copy/paste function for zscript currently?.

ShadowMancer
08-04-2007, 03:57 AM
okay, goto data>freeform combos select 2 in the drop down box, click edit, go to the arguments tab, in D0 change to number to the ID of the combo (not tile) you want the fireball to be (you will most likely have to add it in the combo editor, setup the tile, animation and combo type [damage] all in the combo editor) in the combo editor the number at the bottom under Combo: is the number you put in D0. In D1 put a number for the speed of the fireball (5 or 6 is good, or use 9 or 10 for 'killer fast' fireballs :D )
Repeat this for all 7 fireballs useing FFC numbers 2 - 8. oh and you need to set the script number for each FFC also
In FFC #1 just set the script number
As for the extra 100 HPs its just the way I setup the script, Its one of C_Dawg's techniques for custom bosses, bassically if the enemy were to actually die the script would not have a refrence point and would probley do some strange stuff, but by not actually killing the enemy (just hideing him offscreen) the script just won't do anything but still technally run so its completly transparent to the player. i don't think you can use copy/paste from outside of zquest into zquest, but if you take the script and save it in notepad as a .z you can import it. tools>scripts>compile zscript hit the improt button and grab the .z file you created. one more thing add this line to the very top of the script:

import std.zh

I don't useally post it with scripts because it is pretty much standard practice to put it in. Hummm. did I forget anything..
hope this helped

Gleeok
08-04-2007, 04:26 AM
OK, I have FINALLY managed to import and compile this stuff. Yay!

But nothings happening on the screens where it's suppose to?!?

This is what i've done:

'Assigned Boss_thingy to script 1, and Boss_Fball to slot 2.

'Edited the freeform combos on the screens I wanted them at using your instructions. (D0, D1, set 2-8 to use script2, and 1 to use script1.

Did I miss something?


This is the way it looks when I imported it:

import "std.zh"

int fire_boss_alive = 1;

ffc script fireball_ctrl {
void run() {
//setup vars
ffc fball_1 = Screen->LoadFFC(2);
ffc fball_2 = Screen->LoadFFC(3);
ffc fball_3 = Screen->LoadFFC(4);
ffc fball_4 = Screen->LoadFFC(5);
ffc fball_5 = Screen->LoadFFC(6);
ffc fball_6 = Screen->LoadFFC(7);
ffc fball_7 = Screen->LoadFFC(8);
npc fboss = Screen->LoadNPC(1);
int fball_cnt = 0;

while(true) {

if (fire_boss_alive == 1)
{

this->X = fboss->X;
this->Y = fboss->Y;
if (fball_1->CSet == 0) {
fball_1->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_2->CSet == 0) {
fball_2->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_3->CSet == 0) {
fball_3->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_4->CSet == 0) {
fball_4->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_5->CSet == 0) {
fball_5->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_6->CSet == 0) {
fball_6->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_7->CSet == 0) {
fball_7->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_cnt >= 7) {
fball_cnt = 0;
Waitframes(30);
}
if (fboss->HP < 100) { fire_boss_alive = 0; }
}
else {
fboss->Tile = 65500;
fboss->X = -16;
fboss->Y = -16;
fboss->Weapon = 0;
}
Waitframe();
}
}
}




ffc script boss_fball {
void run (int tnum, int spd) {
//setup vars
npc boss = Screen->LoadNPC(1);
this->CSet = 0;
this->Data = 0;
int shoot = 0;
int dx = 0;
int dy = 0;
int dist = 0;
int rnd_x = 0;
int rnd_y = 0;
while (true) {
if (this->CSet == 0) {
this->X = boss->X;
this->Y = boss->Y;
}
if (this->CSet != 0 && shoot == 0) {
this->Data = tnum;
shoot = 1;
dx = (Link->X+8) - (this->X+8);
dy = (Link->Y+8) - (this->Y+8);
dist = Sqrt(dx*dx + dy*dy);
rnd_x = Rand(4)-2;
rnd_y = Rand(4)-2;
}
if (this->CSet != 0 && shoot == 1) {
this->X += rnd_x + (dx / dist) * spd;
this->Y += rnd_y + (dy / dist) * spd;

}
if(this->X <0 || this->X > 240 || this->Y <0 || this->Y >160) {
this->CSet = 0;
this->Data = 0;
shoot = 0;
}
Waitframe();
}
}
}
any help?


WTFH! I opened the quest and there was nothing set up under data-Freeform combo......M***** F****** S***
ANOTHER EDIT: So in screen #1 where I set this up nothing happens exept when I kill the boss and it leaves a stationary fireball on the ground that does 8 damage. (yep I set it to 8 ;p) ......!?

And on screen 2 nothing happens at all!? ..I tried different combinations of run script on screen init. , linkt to script or ffc, but nothing??
It worked for you, right?

C-Dawg
08-04-2007, 09:49 AM
Change the combo assigned to the FCC. Leaving it at combo 0 is code for
not in use" and Zquset will ignore your data.

Gleeok
08-04-2007, 10:24 AM
Yes, i've done that.


goto data>freeform combos select 2 in the drop down box, click edit, go to the arguments tab, in D0 change to number to the ID of the combo (not tile) you want the fireball to be (you will most likely have to add it in the combo editor, setup the tile, animation and combo type [damage] all in the combo editor) in the combo editor the number at the bottom under Combo: is the number you put in D0. In D1 put a number for the speed of the fireball

What ffc 2-8 look like on mine are DO-795, and D1-8. I saw combo 795 after i killed the boss, which is weird.


I don't know?

ShadowMancer
08-04-2007, 10:49 AM
that is weird, so what exactly did the script do, I mean do the fireballs shoot at Link as they should (they should aim roughly at Link I added a slight random factor for a spread effect) dissapear when they hit the edge of the screen. Does the boss work corectly (do the fireballs originate from the boss, and when you do n-100 damage does the boss dissapear)

Gleeok
08-04-2007, 11:13 AM
Well like I said, after I kill the boss there is a fireball (combo 795, cset8, on the ground.) I have know idea.

Is there anyway I could of possibly set this up wrong? I've been messing with it for many hours.

It might be something really stupid. I'd send you the quest if you want.

ShadowMancer
08-04-2007, 11:18 AM
Yea send me the quest and I'll see if I can get it working right for you. My tests worked fine execpt a minor problem with killing the enemy (but I think that was the enemy editor not my script) this may be a similar problem but I will see what I can do for ya

ShadowMancer
08-04-2007, 11:24 AM
Quick revision, add one line to the fireball script:



ffc script boss_fball {
void run (int tnum, int spd) {
//setup vars
npc boss = Screen->LoadNPC(1);
this->CSet = 0;
this->Data = 0;
int shoot = 0;
int dx = 0;
int dy = 0;
int dist = 0;
int rnd_x = 0;
int rnd_y = 0;
while (true) {
///**Add the folling line to the script and see if it fixes the problem***\\\
if (fire_boss_alive == 0) {this->CSet = 0;}
if (this->CSet == 0) {
this->X = boss->X;
this->Y = boss->Y;
}
if (this->CSet != 0 && shoot == 0) {
this->Data = tnum;
shoot = 1;
dx = (Link->X+8) - (this->X+8);
dy = (Link->Y+8) - (this->Y+8);
dist = Sqrt(dx*dx + dy*dy);
rnd_x = Rand(4)-2;
rnd_y = Rand(4)-2;
}
if (this->CSet != 0 && shoot == 1) {
this->X += rnd_x + (dx / dist) * spd;
this->Y += rnd_y + (dy / dist) * spd;

}
if(this->X <0 || this->X > 240 || this->Y <0 || this->Y >160) {
this->CSet = 0;
this->Data = 0;
shoot = 0;
}
Waitframe();
}
}
}


try that out, let me know if it fixes the problem

Gleeok
08-04-2007, 11:25 AM
Alrighty then. Setting co-ordinates. Preparing for beam up.

OK then I'll try that first ;)

Gleeok
08-04-2007, 11:46 AM
Nope. Nada. Zilth.

I already know whats gonna happen though. Your gonna look at it and say "That idiot forgot to set the watchamacallit doohicky" ;)

ShadowMancer
08-04-2007, 11:49 AM
Alright beam it up captin, I'll reconfiger the dilithem matrix and beam it back to you..

Gleeok
08-04-2007, 11:54 AM
for b509 Feel free to poke around. not much has been imported because of the corruption bug. It's still got about 80&#37; of the tiles though.

ShadowMancer
08-04-2007, 12:11 PM
okay, now what room is the boss in (searching through 15+ maps of stuff makes Shadowmancer something, something.. 'go crazy?' don't mind if I do :googly::googly::googly:)

Gleeok
08-04-2007, 12:15 PM
Oh right Hahaha.... It's the first 2 screens on map 15. (from 73 i believe.)

ShadowMancer
08-04-2007, 01:48 PM
Alright I altered the code a bit and it seems to be working okay, except 2 really unexpected issues.

1. the fireballs originate from -16,-16 (probley an oversight on my part)

2. sometimes the fireballs 'bounce' off the walls. which is pretty cool but not what I programmed, you don't have any odd combos or flags on the walls do you? (can't think of what would cause this problem)

I am going to hack away at it some more and see what happens.

Also I think there may be a bug with enemy HP checking, any other scripter experience this at all???

ShadowMancer
08-04-2007, 05:52 PM
Alright, final update, it works like a charm now :)



import "std.zh"

int fire_boss_alive = 1;

ffc script fireball_ctrl {
void run() {
//setup vars
npc fboss;
ffc fball_1 = Screen->LoadFFC(2);
ffc fball_2 = Screen->LoadFFC(3);
ffc fball_3 = Screen->LoadFFC(4);
ffc fball_4 = Screen->LoadFFC(5);
ffc fball_5 = Screen->LoadFFC(6);
ffc fball_6 = Screen->LoadFFC(7);
ffc fball_7 = Screen->LoadFFC(8);
int fball_cnt = 0;
Waitframes(110);

while(true) {

if (fire_boss_alive == 1)
{
fboss = Screen->LoadNPC(1);
this->X = fboss->X;
this->Y = fboss->Y;
if (fball_1->CSet == 0) {
fball_1->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_2->CSet == 0) {
fball_2->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_3->CSet == 0) {
fball_3->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_4->CSet == 0) {
fball_4->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_5->CSet == 0) {
fball_5->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_6->CSet == 0) {
fball_6->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_7->CSet == 0) {
fball_7->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_cnt >= 7) {
fball_cnt = 0;
Waitframes(30);
}
if (Screen->NumNPCs() < 1) { fire_boss_alive = 0; }
}
else {
fboss->Tile = 65000;
fboss->X = -32;
fboss->Y = -32;
fboss->Weapon = 0;
}
Waitframe();
}
}
}




ffc script boss_fball {
void run (int tnum, int spd) {
//setup vars
npc boss;
this->CSet = 0;
this->Data = 49;
int shoot = 0;
int dx = 0;
int dy = 0;
int dist = 0;
int rnd_x = 0;
int rnd_y = 0;
Waitframes(110);
while (true) {
if (fire_boss_alive == 1) {
boss = Screen->LoadNPC(1);
if (this->CSet == 0) {
this->X = boss->X+12;
this->Y = boss->Y+12;
}
if (this->CSet != 0 && shoot == 0) {
this->Data = tnum;
shoot = 1;
dx = (Link->X+8) - (this->X+8);
dy = (Link->Y+8) - (this->Y+8);
dist = Sqrt(dx*dx + dy*dy);
rnd_x = Rand(4)-2;
rnd_y = Rand(4)-2;
}
if (this->CSet != 0 && shoot == 1) {
this->X += rnd_x + (dx / dist) * spd;
this->Y += rnd_y + (dy / dist) * spd;

}
if(this->X <0 || this->X > 240 || this->Y <0 || this->Y >160) {
this->CSet = 0;
this->Data = 49;
shoot = 0;
}
}
else {
this->Data = 49;
this->CSet = 0;
this->X = -16;
this->Y = -16;
}
Waitframe();
}
}
}


A couple of things, when you recompile the script switch the script slots
put fireball_ctrl in slot 1 and boss_fball in slot 2
go into the flags for each FFC and check 'run script at screen init'
that should do it.
Thanks for the script request I had fun writeing it and I learned a few things in the process :)

Gleeok
08-04-2007, 11:24 PM
Sweet. Got it working. Couple neat things hehe..:

Setting speed to 6 produces some crazy fast unblockable fireballs, while 3 is a mix of slow and fast. And the bouncing off walls part is kinda cool. :cool:

Also the script carries over from big dig to lil' dig after you blow the whistle which is neat also.

And is it just me or did you do away with the +100 HP thing?!

Minor quirk- killing one boss with the fcc script, then going to an adjescent room with another boss somehow cancels out the fcc?! A bug?

Also run script at screen init; I had not set this...So should it always be set, or only for script 1?

You gonna put it in script showcase? It's good work.

Thanks a bunch.

ShadowMancer
08-05-2007, 09:54 AM
Yea, forgot to metion that, I did do away with the +100HP thing, now the boss actually does die and never returns (with 'never returns' flag set)

In my tests the bounceing had stopped but I only tested a few times, I have a theroy that setting the FFC fireballs flag to 'carryover' will fix this (if you want it fixed :) )



Minor quirk- killing one boss with the fcc script, then going to an adjescent room with another boss somehow cancels out the fcc?! A bug?


do you mean you put the same script in two ajacent boss rooms, and killing one boss makes the next one not work? if so its not a bug, its a global varible, if you want to use this more than once in the game use this revision:



import "std.zh"
ffc script fireball_ctrl {
void run() {
//setup vars
npc fboss;
ffc fball_1 = Screen->LoadFFC(2);
ffc fball_2 = Screen->LoadFFC(3);
ffc fball_3 = Screen->LoadFFC(4);
ffc fball_4 = Screen->LoadFFC(5);
ffc fball_5 = Screen->LoadFFC(6);
ffc fball_6 = Screen->LoadFFC(7);
ffc fball_7 = Screen->LoadFFC(8);
int fball_cnt = 0;
Waitframes(110);

while(true) {
fboss = Screen->LoadNPC(1);
if (fboss->HP > 0)
{

this->X = fboss->X;
this->Y = fboss->Y;
if (fball_1->CSet == 0) {
fball_1->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_2->CSet == 0) {
fball_2->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_3->CSet == 0) {
fball_3->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_4->CSet == 0) {
fball_4->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_5->CSet == 0) {
fball_5->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_6->CSet == 0) {
fball_6->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_7->CSet == 0) {
fball_7->CSet = 8;
fball_cnt += 1;
Waitframes(6);
}
if (fball_cnt >= 7) {
fball_cnt = 0;
Waitframes(30);
}
}
Waitframe();
}
}
}




ffc script boss_fball {
void run (int tnum, int spd) {
//setup vars
npc boss;
this->CSet = 0;
this->Data = 49;
int shoot = 0;
int dx = 0;
int dy = 0;
int dist = 0;
int rnd_x = 0;
int rnd_y = 0;
Waitframes(110);
while (true) {
boss = Screen->LoadNPC(1);
if (boss->HP > 0) {

if (this->CSet == 0) {
this->X = boss->X+12;
this->Y = boss->Y+12;
}
if (this->CSet != 0 && shoot == 0) {
this->Data = tnum;
shoot = 1;
dx = (Link->X+8) - (this->X+8);
dy = (Link->Y+8) - (this->Y+8);
dist = Sqrt(dx*dx + dy*dy);
rnd_x = Rand(4)-2;
rnd_y = Rand(4)-2;
}
if (this->CSet != 0 && shoot == 1) {
this->X += rnd_x + (dx / dist) * spd;
this->Y += rnd_y + (dy / dist) * spd;

}
if(this->X <0 || this->X > 240 || this->Y <0 || this->Y >160) {
this->CSet = 0;
this->Data = 49;
shoot = 0;
}
}
else {
this->Data = 49;
this->CSet = 0;
this->X = -16;
this->Y = -16;
}
Waitframe();
}
}
}


Okay, now the only quirk in this revision is that you can only have one enemy per room you use it in, otherwise when you kill one enemy the script will transfer to the next enemy in the room. its because of this line:

fboss = Screen->LoadNPC(1);

which loads the first enemy in the room into the varible fboss.
(at least I think it will transfer to the next enemy, DD just changed to way pointers work and I have not experminted much yet)

Setting 'run script at screen init' for the control FFC (FFC 1 in this case) should be all you need because the fireballs lie dormant until activated by the controler script.

Gleeok
08-05-2007, 10:04 AM
Why would I want to use this awesome script only once? :confused::scared::googly:

I plan on using it a bunch of times. ;)

...Silly.

Gleeok
10-02-2007, 03:22 AM
Alrighty, guess who's gonna make a rapid fire2, 3, and 4 script....yeah, you guessed it. anyway, questions!


*...uses for *?


dist = Sqrt(dx*dx + dy*dy);

Could you explain this part please? :)

also || one more time is what key?
-I plan on condensing this into only one script and by adding more variables, making 4 scripts out of it. :D

Also adding in this, fball_7->data = combodata. And for example: if(D7 == 2){ // homing fireballs, or fireballs that reflect off walls and such...you get the idea. Pretty sweet, huh?

ShadowMancer
10-10-2007, 09:35 PM
dist = Sqrt(dx*dx + dy*dy); --> Caculates the distance between Link and the FFC
dx = (Link->X+8) - (this->X+8); --> the X only distance
dy = (Link->Y+8) - (this->Y+8); --> the Y only distance
| is on the same key as \ the the right of += on my keyboard anyway


homing fireballs, or fireballs that reflect off walls and such...you get the idea. Pretty sweet, huh? Sounds like a nifty idea, be sure to post it in showcase when its done, since I never bothered posting the original script :shrug: