The Daily Click ::. Forums ::. Klik Coding Help ::. Differentiating between several enemies
 

Post Reply  Post Oekaki 
 

Posted By Message

Matt Boothman

The Nissan Micra of forum members

Registered
  20/09/2002
Points
  108

Game of the Week Winner
31st December, 2006 at 07:49:19 -

I am making a platformer, with enemies that shoot you on sight. The only problem is that when I set one enemy to turn and shoot, all the others do too. I need a way so that the only enemy that turns is the one that the condition applies to, and not all. Is there a way to "pick" a certain enemy for the event, and have it only affect the one you picked? I don't really see how spreading a value would work.

I'm using MMF 1.5.

 
http://soundcloud.com/normbo - Listen to my music.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
31st December, 2006 at 09:44:14 -

Thanks for giving information on how your 'shooting on sight' works, noob. Anyway, whatever it is you just need to take advantage of the object focus. 'Pick one of' only applies to the subgroup of an object already selected in the event trigger, so try using that. Like;

[whatever it is that causes Enemy1 to sight you]
+Pick one of Enemy1
---Enemy1: [turn to face the player dude]

There are a bunch of other tricks to do what you're asking too, so if that doesn't work give use MORE INFORMATION and I will impart wisdoms.

 
n/a

Matt Boothman

The Nissan Micra of forum members

Registered
  20/09/2002
Points
  108

Game of the Week Winner
31st December, 2006 at 11:10:57 -

Basically, Mr Radix, the enemy shoots little invisible active objects, which are the triggers. Contrary to what I said before, the enemy does not turn and shoot, rather he stops and shoots (if you hit the invisible bullets). My bad. After that he shoots real bullets. More info below

I've probably done it the retard way, but I'm not too brilliant at the events stuff:

-------

[Movement Value = 0]
-- Move enemy]

[Movement Value = 1]
-- Don't Move Enemy
-- Shoot real bullets

[Player is overlapping with Detector Bullet]
-- Enemy: Set MovementValue to 1

[Player is not overlapping with Detector Bullet]
+ Movement Value =1
-- Set MovementValue = 0

-------

It's probably because the alterable value applies to all enemies. But say if I didn't use an alterable value or a flag, how would I be able to have stop and go? Unless flags are separate for each enemy. I'd be gutted if all I had to do was change the value into a flag and "pick one".

*Goes off to see if flag works*

 
http://soundcloud.com/normbo - Listen to my music.

Duncan

Thelonious Dunc

Registered
  18/05/2002
Points
  552

VIP Member
31st December, 2006 at 11:25:09 -

Um, yes, the alterable value is being applied to all enemies because there's nothing to associate the detector bullets with individual enemies. This is probably going to need a rethink with a less clumsy method.

 
n/a

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
31st December, 2006 at 14:07:15 -

Your best be is to have the detectors bounce back at the enemy and then have the enemy react to that rather than when the detector hits the player.

 
Craps, I'm an old man!

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
31st December, 2006 at 21:30:45 -

How is the game meant to know who shot the detector bullet?

Don't do what Shab says, thats silly. Spread a value in enemies, and when you create a detector bullet, set its value to that of the enemy, so when the bullet hits you, you can determine the value of the enemy that shot it. Ya get me?

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
1st January, 2007 at 03:51:52 -

Yeah, why would you make the enemies shoot detectors? Have the player character shoot detectors instead. It'll probably solve your problem and it's more elegant too.

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
1st January, 2007 at 07:38:42 -

Radix is the man

 
n/a

Matt Boothman

The Nissan Micra of forum members

Registered
  20/09/2002
Points
  108

Game of the Week Winner
1st January, 2007 at 15:39:36 -

But I have to know that the enemy can "see" the player (ie is in the line of sight).

That said, I probably have enough info here to do it now. Thanks for the help people.

 
http://soundcloud.com/normbo - Listen to my music.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
1st January, 2007 at 18:23:54 -

Um. There's no difference between the player's line of sight and the enemy's, is there? Think about it.

 
n/a

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
1st January, 2007 at 18:34:22 -

Providing they are facing the same direction yeah.. line of sight would be equidistant?!

Unless your character was a mole or something

 
http://www.SilverNova.co.uk


Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
2nd January, 2007 at 01:51:26 -

Which direction the player is facing is irrelevant. Which direction each individial enemy is facing is would obviously be handled on detector collision if that is important.

 
n/a

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
2nd January, 2007 at 10:40:06 -

*facing the right direction (and not the direction 'right') lol

 
http://www.SilverNova.co.uk


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 January, 2007 at 18:04:27 -

I have my enemies shoot detectors for multiple reasons. Granted, for something like a simple (Can I see that asshole) type AI it's probably overkill, but then you can add to what the detector actually does. (Example, tells the enemy how much distance to that wall in front of them, and things like that.)

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click