The Daily Click ::. Forums ::. Klik Coding Help ::. Distinguishing Objects Within Qualifiers
 

Post Reply  Post Oekaki 
 

Posted By Message

mastavasta



Registered
  27/07/2010
Points
  113
7th May, 2011 at 03:08:00 -

How would you program MMF to detect a "group.player" object colliding with another "group.player" object, without it sensing itself.

Confused? Me too. I'll try another situation. If I have two NPCs in a top-down, It wouldn't make sense for them to overlap at any time. To fix this, I want to use the group I already have applied to them (since they follow the same code). However, when I have: (Alterable Value A is a spread value, meant to signify an ID)

+"Player" collides with "group.NPC"
+Alterable Value A("Player") <>(different) Alterable Value A("group.NPC")
==>Stop "Player"

**"Player" is also in "Group.NPC"
...It just glitches out. Any way to solve this? I could use a lot of events or test each "Group.NPC" object individually, but that dang 20 event compo keeps me conscious of optimization.
Thanks in advance for the help!


 
Go into my head, then come back out and tell me I'm wrong.

vetmora120



Registered
  07/01/2010
Points
  273
7th May, 2011 at 03:42:45 -

Hey Mastavasta,

Forgive me if I'm not understanding you correctly, but if you want the Player to stop when colliding with group.NPC, then you don't need to compare the 'ID' values you would just detect for collision.

Let me know if that's what you mean

 
n/a

mastavasta



Registered
  27/07/2010
Points
  113
7th May, 2011 at 03:55:40 -

Well, I also want the player to have the same group qualifier. (basically the only thing the qualifier does in this instance is stop the player, or stop an NPC, I even have walls with the same qualifier) The way I have it working now, MMF2 thinks that the player is constantly colliding with a wall (even if it is the only thing in the frame). In short, I'm wondering how to distinguish between two objects in the same qualifier, while not specifically stating the objects.
Thanks for the quick response, and sorry for the confusion, I'm a bit confused myself.

 
Go into my head, then come back out and tell me I'm wrong.

vetmora120



Registered
  07/01/2010
Points
  273
7th May, 2011 at 04:13:31 -

Oh, I 'think' I understand now ;p

You could do try either adding a pick one of, or you could try using the ForEach object/extension. However using spread ID's to distinguish between objects should work. Have you tried using fixed values instead? Perhaps the ID's aren't spread properly or something... I dunno.

If you want you could message me the example and I could take a look.

Otherwise goodluck to you! Let me know if this doesn't work or it's not what you wanted

 
n/a

mastavasta



Registered
  27/07/2010
Points
  113
7th May, 2011 at 15:22:07 -

You've got the problem now. I don't really know what's happening now, I've tried using the fixed values instead of IDs, but to no avail. Unfortunately, I have no idea how to use the ForEach object. I already have the collisions running once per object on a fastloop, where:

+ID of Player=loopindex"collide"
+player is overlapping group.NPC
==>stop player
(isn't that what ForEach does?)

I'll search for a quick tutorial, but if that doesn't work, I think I'll try sending the source file to you.

 
Go into my head, then come back out and tell me I'm wrong.
   

Post Reply



 



Advertisement

Worth A Click