The Daily Click ::. Forums ::. Klik Coding Help ::. Simple AI Question
 

Post Reply  Post Oekaki 
 

Posted By Message

Metal Maiden



Registered
  10/09/2002
Points
  900
7th May, 2004 at 02:10:17 -

lol, how embarassing. Oh well, I guess if you don't know it's worth asking..

I have my badguy, Skeleton. He's going to run amuck on the ground, and will look in the direction of the player. I basically want him to stay on the ground, and he'll stay put until his detector is overlapped by the player. How do I go about this feat?

 
Death in the air
Strapped in the electric chair
This can't be happening to me
Who made you God to say
"I'll take your life from you!!"

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
7th May, 2004 at 05:06:04 -

Hmmm what kind of game are you making here?
I can't be sure what the problem is. And how does this detector work?

 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!

Metal Maiden



Registered
  10/09/2002
Points
  900
7th May, 2004 at 10:11:57 -

maybe that was confusingly written. This is a platform game. The Skeleton is supposed to stay put on the ground, just standing in place. He has a invisible circle that acts a detector, and once the playuer overlaps it, he chases him. The things is, I don't want to skeleton to be able to bounce aROUND, like with ball movemtn, I want himto stay on the ground.

 
Death in the air
Strapped in the electric chair
This can't be happening to me
Who made you God to say
"I'll take your life from you!!"

Kramy



Registered
  08/06/2002
Points
  1888
7th May, 2004 at 18:47:11 -

Scrap the collider.

radius = 200

X pos of skeleton < Player+radius
+X pos of skeleton > Player
-- add -1 to xpos of skelly

X pos of skeleton < Player
+X pos of skeleton > Player-radius
-- add 1 to xpos of skelly

Now if you want you can add a collider to the bottom of the skelly, and use that to raise/lower Y as he moves over hills.

 
Kramy

- Yelnek -



Registered
  03/05/2003
Points
  1016

VIP MemberI am an April Fool
8th May, 2004 at 01:30:53 -

Ummm... may I ask what the radius is and how do you set it... or is it just a invisable circle thingy...? Thankxs

 
"I have dreamed a dream... But now that dream is gone from me."








Kramy



Registered
  08/06/2002
Points
  1888
8th May, 2004 at 17:40:55 -

Yes, and that number directly changes the zone the monster will walk toward you in.

If I wanted I could have just wrote 200 out twice...but it seemed more descriptive that way.

 
Kramy

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
9th May, 2004 at 04:20:52 -

I take it your skeleton has bouncy ball movement to move around...basically what you need is gravity of some sort if you want him to stay on the ground.

So i'll just do a few events you could use...with your invisible circle method detection method.


BASIC GRAVITY EVENTS
- Skeleton is overlapping background
Set Y of Skeleton to Y("Skeleton") - 8
doesn't have to be 8

- NEGATE Skeleton is overlapping background
Set Y of Skeleton to Y("Skeleton") + 8
has to be the same number as the event above
EVENTS FOR DETECTION CIRCLE(S)...you probably have these events anyway though, but i'm bored
- Always
Set position of Detection Circle to 0,0 of Skeleton
Make Detection Circle Invisible

- Number of Detection Circles is greater than Skeleton
Destroy Detection Circle

- Number of Detection Circles is less than Skeleton
Create Detection Circle at -32, -32
or somewhere offscreen

- Detection Circle is overlapping Skeleton
+ Detection Circle is overlapping Player
Skeleton look in direction of 0,0 Player
or alternatively use the Direction Calculator to rotate the Skeleton towards Player for more 'realistic' chasing'

And that's pretty much it...should work, although the invisible detector method isn't the best method I reckon... I could always make an example if needed

Peace out and Rawk awn! \m/ MASTER! hehe


 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!
   

Post Reply



 



Advertisement

Worth A Click