Brain 10 - target?
Is there any way a brain 10 (vertical and horizontal walk) creature can come after Dink? Target doesn't work, but I really want a vertical/horizontal walking creature to go after Dink.
EDIT: Well, I noticed it works when you just give a vertical/horizontal animated creature brain 9, but then it, sometimes, just hangs around without an animation, and at others it walks in perfect animation.
EDIT: Well, I noticed it works when you just give a vertical/horizontal animated creature brain 9, but then it, sometimes, just hangs around without an animation, and at others it walks in perfect animation.
I researched this for the DinkC Reference v4.0. It was much fun figuring out which commands affect which brains.
It seems sp_follow should work.
It seems sp_follow should work.
sp_follow(¤t_sprite, 1); would do the trick?
No.
sp_follow(¤t_sprite, 1);
Edit: Hey, no fair, before you just had sp_follow(1);
sp_follow(¤t_sprite, 1);
Edit: Hey, no fair, before you just had sp_follow(1);

dang. You're a fast clicker. How many fingers you said you got?
Yeah, I modified it right after I saw my own message, and thought "hey, let's correct that".
Then, you already noticed it, so I thought "that's unfair indeed, let's change it back". But Dan "swift as the wind" Walma (that must be your indian name, right?) was too quick, again.
Bottomline: I'll post a nice EDIT next time.
Yeah, I modified it right after I saw my own message, and thought "hey, let's correct that".
Then, you already noticed it, so I thought "that's unfair indeed, let's change it back". But Dan "swift as the wind" Walma (that must be your indian name, right?) was too quick, again.
Bottomline: I'll post a nice EDIT next time.

Hmm. sp_follow is a fun function indeed. However, I want the creatures to run into Dink as well. So that would mean I must use a brain 9, right?
Or you can compute the distance between the sprite and it's target (with math_sqrt() this should be possible, if it's not broken
) and change the brain to 9 if the distance is smaller than... some arcane value.

In case you can't use math_sqrt(), you can calculate the square of that distance and compare it to 100(if you want the distance to be <10)
To calculate the distance, do this:
&distance1 = &dinkx;
&distance1 -= &spritex;
&distance1 *= &distace1;
&distance2 = &dinky;
&distance2 -= &spritey;
&distance2 *= &distace2;
&distance1 += &distance2;
To calculate the distance, do this:
&distance1 = &dinkx;
&distance1 -= &spritex;
&distance1 *= &distace1;
&distance2 = &dinky;
&distance2 -= &spritey;
&distance2 *= &distace2;
&distance1 += &distance2;