PDA

View Full Version : Help with my fire breathing zora script...



Archangel
04-30-2009, 08:56 PM
ffc script Zora2{
void run(int count){
npc zora = Screen->CreateNPC(191);
while(zora->isValid()){
if(zora->Tile >= 2220){
for(count = 1; count >= 20; count++){
eweapon fs = Screen->CreateEWeapon(139);
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 = 200;
PlaySound(13);
Waitframes(6);
}
}
}
}
}


Won't even compile, keep getting T21 error on PlaySound(13); saying it can't match the signature of PlaySound(Float)?

I changed playsound(13); to a comment and ZC freezes... :(

I change CreateNPC to LoadNPC and now it freezes when I try to load my game...

FFC combo starts on screen init moving continue screen to 67, started find but when I went to screen 7 link walked off the screen and the game froze.

EDIT: You know what... Fuck it, I'll just make them dive faster and shoot stronger projectiles. :angry: damn critical bugs...

pkmnfrk
04-30-2009, 10:00 PM
I think you should stick a Waitframe() somewhere outside of the if block, just in case it is ever false, which would then freeze the game (that's the freeze you got).

Also, PlaySound is a method of the Game object. Eg, Game->PlaySound

I'm not sure what you're talking about in the "walking off screen" line, but it's probably the same freeze bug as above.

Archangel
05-01-2009, 05:26 PM
I managed to get the script working with a few bugs. Is there a way to tell if the Zora has it's head above water?

Joe123
05-01-2009, 06:56 PM
Check for what tile it's using?

Archangel
05-01-2009, 09:32 PM
ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(191);
while(zora->isValid()){
if(zora->Tile >= 2180){
for(int count = 1; count >= 20; 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();
}
}
}No luck, it breathes constantly? Perhaps I'm doing something wrong then. Is their another way of making it breathe a stream of 10 flames but only if it's head is above water?

pkmnfrk
05-02-2009, 12:47 AM
ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(191);
while(zora->isValid()){
if(zora->Tile >= 2500){
for(int count = 0; 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();
}
}
}

Try that. The big issue was that by default, the zora tiles are ALL >= 2180. You want them to be >= 2500 (unless you've moved them around).

Also, I fixed the for loop. You should always do it like that, unless you have reason to do so otherwise.

Joe123
05-02-2009, 04:33 AM
Heh, I had to have a little chuckle when I read that.


(int count = 1; count >= 20; count++)
Set count to 1, loop while count is greater than or equal to 20?

Archangel
05-02-2009, 09:10 PM
Well, I'm actually using different tiles for my new enemies, you'll like the new robie graphics. But when I checked the tiles, I wasn't even close... I got confused you see, it's 7000 more then that at 9180, I double checked the thousands place and read the tile for the normal Zora.

Anyways, thanks for help guys?

Fire Breathing Zora2s now were talking, die link die! :sly:
http://www.armageddongames.net/forums/showthread.php?p=1221710#post1221710