Phantom Hourglass Phantoms
#1
Posted 01 January 2010 - 11:20 AM
#2
Posted 04 January 2010 - 05:10 PM
#3
Posted 04 January 2010 - 06:01 PM
void run(int radius, int enemy, int spawn){
if(spawn == 0) spawn = this;
while(Distance(spawn->X,spawn->Y,Link->X,Link->Y) > radius) Waitframe();
CreateNPCAt(enemy,spawn->X,spawn->Y);
spawn->Data = 0;
}
}
While Link is further than D0 pixels away from the ffc, nothing happens. When he enters that area, an npc with ID D1 is spawned and the ffc is removed.
If you want the effect to apply to a different ffc than the one with the script attached, set D2 to the ffc you want to use (otherwise leave it as 0).
You will have to sort out your own movement routine.
#4
Posted 06 January 2010 - 08:18 PM
BTW, thanks for writing the script.
#5
Posted 07 January 2010 - 04:20 AM
I can add in a line so that the ffc's graphic is removed when the enemy spawns if you like?
#6
Posted 07 January 2010 - 07:39 PM
#7
Posted 08 January 2010 - 06:10 AM
Making the enemy go back to its path would require a completely different much more complicated script.
I explained in the post with the script how to set it up.
#8
Posted 08 January 2010 - 05:51 PM
#9
Posted 09 January 2010 - 10:33 AM
There's a flag, 'No Enemies'. It's at the bottom of the flag list, think it might be 96.
void run(int radius, int enemy, int spawn){
ffc f = this;
if(spawn != 0) f = Screen->LoadFFC(spawn);
while(Distance(f->X,f->Y,Link->X,Link->Y) > radius || ComboFI(Link->X+8,Link->Y+8,CF_NOENEMY)) Waitframe();
CreateNPCAt(enemy,f->X,f->Y);
f->Data = 0;
}
bool ComboFI(int x, int y, int flag){
int loc = ComboAt(x,y);
return (Screen->ComboF[loc] == flag || Screen->ComboI[loc] == flag);
}
}
It now won't spawn an enemy if he's on that flag.
#10
Posted 09 January 2010 - 05:32 PM
#11
Posted 09 January 2010 - 05:35 PM
#12
Posted 09 January 2010 - 06:37 PM
CANNOT CAST FFC TO FLOAT. How do you fix this?
#13
Posted 09 January 2010 - 06:41 PM
Grab it again now.
#14
Posted 10 January 2010 - 07:59 AM
#15
Posted 10 January 2010 - 08:02 AM
that's what it's supposed to do.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users