sign post script add-on request
#1
Posted 27 February 2008 - 06:32 PM
In the D1 box:
0=north
1=east
2=south
3=west
4=every direction
Thanks!
#2
Posted 27 February 2008 - 07:00 PM
Why?
#4
Posted 27 February 2008 - 07:23 PM
You want this on the signpost script and not the NPC script?
Why?
I want this script because... Because... Well, I was going to say because I already have NPCs set up as eyeballs, but now that I think about it, I will use the NPC script. Could you post it here? I don't know where to find it.
#5
Posted 27 February 2008 - 11:50 PM
I want this script because... Because... Well, I was going to say because I already have NPCs set up as eyeballs, but now that I think about it, I will use the NPC script. Could you post it here? I don't know where to find it.
You can find many scripts at AGN's script showcase forum: http://www.armageddo...play.php?f=1159
Here is the script itself:
void run(int m, int s, int f, int d, int def_dir) {
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;
d_y = this->Y - Link->Y;
a_x = Abs(d_x);
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 + DIR_UP;
} else {
this->Data = orig_d + DIR_DOWN;
}
} else {
if(d_x >= 0) {
this->Data = orig_d + DIR_LEFT;
} else {
this->Data = orig_d + DIR_RIGHT;
}
}
} else {
this->Data = orig_d + def_dir;
}
}
if(Link->InputA && a_x < 24 && a_y < 24) {
if(s != 0) Game->PlaySound(s);
Link->InputA = false;
Screen->Message(m);
}
Waitframe();
}
}
}
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.
Tips:
Like the Sign post, you should put a solid combo on the same square as the NPC, so Link can't move through it.
If you use the facing feature, then you must use the FFC as a sprite, you can't have it invisible on top of an NPC combo. If you're just using a plain NPC, then it doesn't matter which you do.
It works best with the "Messages freeze all action" and "Messages disappear" rules.
Edited by russadwan, 27 February 2008 - 11:51 PM.
#6
Posted 28 February 2008 - 12:03 PM
void run(int m, int s, int f, int d, int def_dir){
int d_x;
int d_y;
int a_x;
int a_y;
int orig_d = this->Data;
bool play;
if(d == 0) d = 48;
while(true){
play = false;
d_x = this->X - Link->X;
d_y = this->Y - Link->Y;
a_x = Abs(d_x);
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 + DIR_UP;
else this->Data = orig_d + DIR_DOWN;
}else{
if(d_x >= 0) this->Data = orig_d + DIR_LEFT;
else this->Data = orig_d + DIR_RIGHT;
}
}else{
this->Data = orig_d + def_dir;
}
}
if(Link->InputA && a_x < 24 && a_y < 24){
if(d_y >= 0 && Link->Dir == 1) play = true;
else if(d_y <= 0 && Link->Dir == 0) play = true;
else if(d_x >= 0 && Link->Dir == 3) play = true;
else if(d_x <= 0 && Link->Dir == 2) play = true;
}
if(play){
if(s != 0) Game->PlaySound(s);
Link->InputA = false;
Screen->Message(m);
}
Waitframe();
}
}
}
Give that one a try.
#7
Posted 28 February 2008 - 06:54 PM
#8
Posted 28 February 2008 - 06:55 PM
If Link is to the left of the person, he has to look right to talk to them, etc.
Should work like that anyway.
#9
Posted 28 February 2008 - 06:57 PM
edit: where can I find the Minish Cap Hylian voices? They aren't at the helpthewretched site.
Edited by ZebraStallion, 28 February 2008 - 07:13 PM.
#11
Posted 28 February 2008 - 09:21 PM
#12
Posted 29 February 2008 - 02:39 AM
#13
Posted 29 February 2008 - 07:08 PM
#14
Posted 29 February 2008 - 07:16 PM
I probably still have them around somewhere.
Does the script work by the way?
#15
Posted 29 February 2008 - 07:17 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users