The Daily Click ::. Forums ::. Klik Coding Help ::. Enemy AI
 

Post Reply  Post Oekaki 
 

Posted By Message

Shawn Wolfram



Registered
  15/08/2003
Points
  435
3rd April, 2004 at 14:50:01 -

I have a problem in my platform game. It seems that when enemies do certain things, all of them do the same. How can I stop this from happening?

 
http://www.myspace.com/gidek = Myspace is for fags.

<fag?

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
3rd April, 2004 at 15:12:10 -

You can use the pick one of command. It's under pick or count in the condition editor. Alternatively, you can use a value of the enemy object to trigger AI states.
EXample-
Enemy is close to player - set enemy.value to 1
Enemy value = 1 And Player Running animation is playing - Shoot, set enemy.value to 2

This is how the AI was handled for most of my games, and it's never given me any problems.

 
Craps, I'm an old man!

Shawn Wolfram



Registered
  15/08/2003
Points
  435
3rd April, 2004 at 15:26:14 -

Yeah, that's not the problem I'm having, sorry, I should have been more specific. I'm having a problem with the enemies direction. Okay, I have two enimies, right? Then I have 2 arrows, one that tells the enemy to face right, and the other left, when one enemy touches an arrow, the other one turns too, so how can I fix that?

 
http://www.myspace.com/gidek = Myspace is for fags.

<fag?

Cybermaze



Registered
  03/04/2003
Points
  853
3rd April, 2004 at 15:29:46 -

Yeah ... what you need to do is give your actions focus.

Its because you create instances (objects) of the same active object. Then if you use a condition like always, every x or time is equal etc the focus is on all the instances, meaning the action will be applied to all the instances.

You can change focus a lot of ways. Collision is one way or making conditions with alterable values ...

 
If you knew, I would have to kill you...

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
3rd April, 2004 at 15:30:12 -

That's really strange man, only the one that collides with the object should turn. If you want, you can take the problem area of code and upload it somewhere and I'll take a look at it, and see if we can't get that problem squashed.

 
Craps, I'm an old man!

Cybermaze



Registered
  03/04/2003
Points
  853
3rd April, 2004 at 15:33:46 -

Baaaaahhhh ... stupid double post ... had a nervous finger and hit "Reply" twice ... cannot edit any of the two posts either ...

As to the problem ... I asume you use a condition like: "badguy" collision with "left" -> Set direction of "badguy" to right ??? and vice versa for right.

If so ... its an odd problem ...

Image Edited by the Author.

Image Edited by the Author.

 
If you knew, I would have to kill you...

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
3rd April, 2004 at 15:39:38 -

Try adding a "Only one action when event loops" it's under the wrench in TGF.

 
Craps, I'm an old man!

Shawn Wolfram



Registered
  15/08/2003
Points
  435
3rd April, 2004 at 15:51:13 -

I'm using MMF, so you know. Anyways, Upon further inspection, only the upper enemy does it, and he only does it when he sees me.

Can I email it to you?

 
http://www.myspace.com/gidek = Myspace is for fags.

<fag?

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
3rd April, 2004 at 15:54:13 -

shabadage@japan.com

I have to open it when I get home, as I don't have MMF at work. I'll let you know tomorrow.

 
Craps, I'm an old man!

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
4th April, 2004 at 06:26:48 -

I've done alot of work on platform Ai recently, particularly on a game i'm currently working on. I've pretty much got the whole object seperation thing down to a fine art, so I could offer my help if you need it.

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

Shawn Wolfram



Registered
  15/08/2003
Points
  435
4th April, 2004 at 06:32:45 -

Would you be willing to look at some code muggus? I know how hard it is to read other peoples code, especially mine (I don't use comments). But what ever the problem is, I'm sure it's just a stupid mistake. Unfortuanatly it's smarter than me.

 
http://www.myspace.com/gidek = Myspace is for fags.

<fag?

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
4th April, 2004 at 06:46:57 -

Yeah i'll have a look if ya want.
Send us a PM or email me Muggus69@hotmail.com...if it's 'reasonably small' that is.

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

Post Reply



 



Advertisement

Worth A Click