The Daily Click ::. Forums ::. Klik Coding Help ::. AI AI interacts with AI
 

Post Reply  Post Oekaki 
 

Posted By Message

Deleted User
12th January, 2009 at 05:58:20 -

On one of my projects, I have it set up so that every person in the game uses the same 2 active objects, a detector and a sprite. So far it's working very well, I have it set up so that one is the player, and the rest are divied up between other people and enemies based on variables. BUT the major problem I seem to be having now is they need to interact with one another. The usual method I was planning on using was to not have to use actives for line of sight, but I might be having to do that because using the usuall distance between two points doesn't work if the two points are the same object between the same object. I don't want to go back to having each catagory a separate object, because it's essential to this particular concept. I'm going to fiddle with it some more, but I'm problably going to need some hardcore help.

BTW I'm using MMF2.

 

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
12th January, 2009 at 15:15:40 -

yeah, that's a tricky one....

Since every object has a detector AND a sprite, try this logic: (this is a complete guess, by the way)

when an object must compare its distance between another, compare DETECTOR to SPRITE. As far as coordinates are concerned, it's purely academic which one you choose as each Detector will be in the same place as its Sprit. But it enables you to isolate the Detector and Sprite as distinct elements, so it's perfect if you need to compare two individuals of the same kind.

I can't imagine a way of doing this for all objects without fast looping, however.

Edited by DeadmanDines

 
191 / 9999 * 7 + 191 * 7

Deleted User
12th January, 2009 at 15:51:10 -

That's actually kind of a good idea, I might try maybe
Pick one
Det=player
Not overlapping sprite
Sprite<>player

I'll give it a try and come back. If not I just might have to end up using an active that labels them as each. It might be a good excuse to try that character editor idea. Does visibility make a difference when it comes to cluttering up the frame?

I just got another idea, what if I did something like XY <> XY?

 
   

Post Reply



 



Advertisement

Worth A Click