PDA

View Full Version : Fire Breathing Zoras



Archangel
05-02-2009, 09:43 PM
ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2520){
for(int count = 1; count <= 10; count++){
eweapon fs = Screen->CreateEWeapon();
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
Waitframe();
}
}
}

Okay, first of all... There is no way I could of done this without help from two very special people. Pkmnfrk and Joe123, thank you so much for helping me come this far on my scripting journey and for all your help and support. It's much appreciated. And thanks

Now let's get cracking shall we.


You must have new enemy tiles enabled under quest rules.
If you want it not to shoot fireballs, you'll have to disable them some how.

I changed the 33 under line 3 to a the ID of a enemy I made in the enemy editor that was a Zora clone with no weapon.
If you're using different tiles then default tiles, then make sure you use the shooting tiles for the number in line 5.

That's animation row 5 & 6 by the way.


I think that's pretty much everything you need to know. The Zora by itself won't breathe fire, so make sure you use the script under a ffc to place them and not the enemy editor.

Enjoy!

EDIT: Forgot to mention... You'll need to import advmath.zh from my sig by pkmnfrk to make it work.

Joe123
05-03-2009, 05:31 AM
two very special people.
I appreciate the mention, but it sounds like I'm your girlfriend or something.


Quite a nice script though.

Archangel
05-03-2009, 06:33 AM
:weird: That was the most awkward thing I've heard this morning...

Joe123
05-03-2009, 07:18 AM
Haha, don't worry about it =P

Gleeok
05-03-2009, 07:10 PM
Okay, first of all... There is no way I could of done this without help from two very special people. Pkmnfrk and Joe123, thank you so much for helping me come this far on my scripting journey and for all your help and support. It's much appreciated. And thanks

lol. I read it more of an "accepting an award speech", which, indecently, you also forgot to thank Jesus and your mom. :P

Christian
05-04-2009, 04:34 AM
you also forgot to thank Jesus and your mom. :P

lol , that was funny. Nice zora btw.

Archangel
05-07-2009, 02:29 PM
For those of those you would like proper deflection here you go...


import "std.zh"
import "advmath.zh"

ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2500){
for(int count = 1; count <= 10; count++){
eweapon fs = Screen->CreateEWeapon(140);
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
if(fs->Angle==-PI || fs->Angle==PI) fs->Dir=2;
else if(fs->Angle==-PI/2) fs->Dir=0;
else if(fs->Angle==PI/2) fs->Dir=1;
else if(fs->Angle==0) fs->Dir=3;
else if(fs->Angle<-PI/2) fs->Dir=4;
else if(fs->Angle<0) fs->Dir=5;
else if(fs->Angle>(PI/2)) fs->Dir=6;
else fs->Dir=7;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
Waitframe();
}
}
}

Same rules apply as above. And a techdemo!
test.qst (http://www.box.net/shared/dtexxbu6gn)

Pteryx
05-09-2009, 02:17 AM
Hm, I detect a slight oversight -- when I killed it, the fire breath in progress wasn't cancelled, but instead the remainder of it gushed from the upper left corner (though the now-dead Zora didn't breathe again). -- Pteryx

Archangel
05-09-2009, 04:00 PM
That should be easy to fix, I'll try to get around to it after I'm done moving. :)

Joe123
05-09-2009, 06:59 PM
if(!zora->isValid()) break;
Inside your for loop.

Archangel
05-11-2009, 05:37 PM
Alakazam your wishes are my command.


import "std.zh"
import "advmath.zh"

ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2500){
for(int count = 1; count <= 10; count++){
if(!zora->isValid() break;
eweapon fs = Screen->CreateEWeapon(140);
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
if(fs->Angle==-PI || fs->Angle==PI) fs->Dir=2;
else if(fs->Angle==-PI/2) fs->Dir=0;
else if(fs->Angle==PI/2) fs->Dir=1;
else if(fs->Angle==0) fs->Dir=3;
else if(fs->Angle<-PI/2) fs->Dir=4;
else if(fs->Angle<0) fs->Dir=5;
else if(fs->Angle>(PI/2)) fs->Dir=6;
else fs->Dir=7;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
while(zora->tile >= 2500){
Waitframe();
}
Waitframe();
}
}
}

I tested this one, and it seems to work as it should.
Enjoy!