OoT Sword and Shield check
#1
Posted 12 November 2008 - 09:13 PM
#2
Posted 12 November 2008 - 09:39 PM
#3
Posted 12 November 2008 - 09:55 PM
#4
Posted 14 November 2008 - 08:42 PM
#5
Posted 14 November 2008 - 10:27 PM
#6
Posted 16 November 2008 - 10:18 AM
#7
Posted 16 November 2008 - 11:11 AM
#8
Posted 16 November 2008 - 11:37 PM
#9
Posted 17 November 2008 - 04:27 AM
ffc script mido{
void run(int Item, int Xdistance){
int o = this->X;
int l = o-Xdistance;
int r = o+Xdistance;
while(true){
Waitframe();
if(Abs(Link->Y-this->Y)<64){
if(Link->X < this->X && l < this->X)this->X--;
else if(Link->X > this->X && r > this->X)this->X++;
}
else{
if(this->X > o)this->X--;
else if(this->X < o)this->X++;
}
}
}
}
D0-does nada yet.
D1-distance to guard -16 / 2. So guarding an entrance of 48 pixels (3 tiles) wide would be 16.
See if that's what you had in mind. If so I'll add in the item/message bit and make him solid.
Edited by Gleeok, 17 November 2008 - 08:24 AM.
#10
Posted 17 November 2008 - 05:36 PM
#11
Posted 17 November 2008 - 08:39 PM
PS: How long is a jiffy anyway?
#12
Posted 17 November 2008 - 09:26 PM
#13
Posted 23 November 2008 - 07:41 AM
Anyways, here you go. Untested as usual, but should work fine.
Same D[] variables as before exept for message1 and 2, before and after Link has the item.
PS. Set D1 to at least 8 but no more than 48 for best results.
..will fix bugs for food.
ffc script mido{
void run(int Item, int Xdistance, int m1, int m2){
int o = this->X;
int l = o-Xdistance;
int r = o+Xdistance;
while(true){
Waitframe();
Solid(this->X,this->Y,1,1);
if(Link->Item[Item]){
if(Abs(Link->X-this->X)<=8 && Link->Y > this->Y
&& Link->Y < this->Y+18 && Link->InputA){
Screen->Message(m2);
for(int i=0;i<16;i++){
this->X++;Waitframe();Solid(this->X,this->Y,1,1);
}
for(int i=0;i<16;i++){
this->Y++;Waitframe();Solid(this->X,this->Y,1,1);
}
}
}
else{
if(Abs(Link->Y-this->Y)<64){
if(Link->X < this->X && l < this->X)this->X--;
else if(Link->X > this->X && r > this->X)this->X++;
}
else{
if(this->X > o)this->X--;
else if(this->X < o)this->X++;
}
if(Abs(Link->X-this->X)<=8 && Link->Y > this->Y
&& Link->Y < this->Y+18 && Link->InputA){
Screen->Message(m1);
}
}
}
}
}
void Solid(int x, int y, int width, int height){
int w = width*16; int center_x = x+(w/2);
int h = height*16; int center_y = y+(h/2);
int lx = Link->X; int ly = Link->Y;
if(ly<y && Abs(lx-center_x)<w/2 && ly>y-16){
Link->InputDown=false;
}
else if(ly>y+h-4 && Abs(lx-center_x)<w/2 && Abs(ly-center_y)<h/2){
Link->InputUp=false;
}
if(lx>x+w-4 && Abs(lx-center_x)<w/2 && Abs(ly-center_y)<h/2){
Link->InputLeft=false;
}
else if(lx<x && Abs(ly-center_y)<h/2 && lx>x-16){
Link->InputRight=false;
}
if(lx<x+w-4 && lx>x+4 && ly<y+h-4 && ly>y-4){ // Player is inside the tile!
Link->Y++;
}
}
#14
Posted 23 November 2008 - 03:31 PM
EDIT: joke was whack..sorry lol
but anyways what's D1 again? oh, ok never mind is the tile distance for guarding. thanks for your help gleeok
#15
Posted 23 November 2008 - 04:32 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users