however, i can't make heads or tails of this at the moment, so i would like to see if someone could make it 16x32 and even 32x32 sized NPC capatible please?
original script:
CODE
//===============//
//REAL NPC SCRIPT//
//===============//
//Instructions:
//Takes 5 parameters (!!):
//0: The message. Same as the sign post.
//1: S sound to play when activated.
//2: Whether to have the NPC turn to face Link when he's near. See below for details. (0 is off, anything else is on)
//3: If #2 is on, how close Link must be for the NPC to turn, in pixels (+ 16, because that's how wide Link is) (default is 48)
//4: If #2 is on, which direction is the "default" direction, when Link is far away (0 - Up, 1 - Down, 2 - Left, 3 - Right)
//To have an NPC that faces Link, you must put the combos for each direction in a certain order:
// Up, Down, Left, Right, AND! You must set
//the FFC to the UP facing combo. If you do that, you'll be fine.
ffc script real_npc{
void run(int m, int s, int f, int def_dir, int d){
int d_x; int d_y;
int a_x; int a_y;
int orig_d = this->Data;
if(d == 0) d = 48;
while(true){
d_x = this->X - Link->X; a_x = Abs(d_x);
d_y = this->Y - Link->Y; a_y = Abs(d_y);
if(f != 0){
if(a_x < d && a_y < d){
if(a_x <= a_y){
if(d_y >= 0) this->Data = orig_d;
else this->Data = orig_d+1;
}else{
if(d_x >= 0) this->Data = orig_d+2;
else this->Data = orig_d+3;
}
}else{this->Data = orig_d + def_dir;}
}
if(Link->InputL && a_x < 24 && a_y < 24 && Link->Z == 0){
if(s != 0) Game->PlaySound(s);
Link->InputL = false;
Screen->Message(m);
}
Waitframe();
}
}
}
//REAL NPC SCRIPT//
//===============//
//Instructions:
//Takes 5 parameters (!!):
//0: The message. Same as the sign post.
//1: S sound to play when activated.
//2: Whether to have the NPC turn to face Link when he's near. See below for details. (0 is off, anything else is on)
//3: If #2 is on, how close Link must be for the NPC to turn, in pixels (+ 16, because that's how wide Link is) (default is 48)
//4: If #2 is on, which direction is the "default" direction, when Link is far away (0 - Up, 1 - Down, 2 - Left, 3 - Right)
//To have an NPC that faces Link, you must put the combos for each direction in a certain order:
// Up, Down, Left, Right, AND! You must set
//the FFC to the UP facing combo. If you do that, you'll be fine.
ffc script real_npc{
void run(int m, int s, int f, int def_dir, int d){
int d_x; int d_y;
int a_x; int a_y;
int orig_d = this->Data;
if(d == 0) d = 48;
while(true){
d_x = this->X - Link->X; a_x = Abs(d_x);
d_y = this->Y - Link->Y; a_y = Abs(d_y);
if(f != 0){
if(a_x < d && a_y < d){
if(a_x <= a_y){
if(d_y >= 0) this->Data = orig_d;
else this->Data = orig_d+1;
}else{
if(d_x >= 0) this->Data = orig_d+2;
else this->Data = orig_d+3;
}
}else{this->Data = orig_d + def_dir;}
}
if(Link->InputL && a_x < 24 && a_y < 24 && Link->Z == 0){
if(s != 0) Game->PlaySound(s);
Link->InputL = false;
Screen->Message(m);
}
Waitframe();
}
}
}
joe wrote this one. (press L to speak, instead of A)
thanks!
Edited by Master Maniac, 13 July 2008 - 12:57 PM.