SRL Archive - OSR Help

What's the formula for searching X,Y zone's Around your player?


Sir Ducksworthy

2012-03-15 03:23:30

That is searching 100 zones of the main Screen, problem is its from top left to bottom right, I need it to go around my player but not being so good at math I'm not sure how to go about it unless, I could be bothered making the zone's by hand which would be a complete ad utter mess in my script.

I'm going to use this to find Chicken's accurately so it moves from Chicken to Chicken instead of just at the same one, this is how I plan on getting around most color detection mess ups also moving to the next npc if their is a hp bar etc

Case times of
2..10: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
11..11: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
12..20: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
21..21: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
22..30: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
31..31: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
32..40: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
41..41: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
42..50: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
51..51: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2}end;
52..60: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
61..61: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
62..70: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
71..71: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
72..80: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
81..81: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
82..90: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
91..91: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
92..100: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
End;

Daniel

2012-03-15 04:10:42

MakeSpiralPath for a circle around your character. But, you could just use a repeat and a for loop incrementing by a factor 1 to do what you want :)

Sir Ducksworthy

2012-03-15 04:21:41

Hmmm kool, but I don't think the area's would be small enough for chicken's if two chicken's are in the same area circle it wont check the first one and then check the second one if the first ones in combat, I need multiple zones seperated from eachother

RISK

2012-03-15 05:42:31

Learn TPAs/ATPAs. With those you can get each chicken in to their own 'Box' that can be 'Seen' by the script. Along with min and max pixel checking to completely ignore anything that isn't a chicken. The same goes with a distance checker to see if the distance between the chicken and the player is over or under X amount of pixels, do so and so.

That would be your best bet, anyway.

Sir Ducksworthy

2012-03-16 03:39:16

Cheers man