The Daily Click ::. Forums ::. Klik Coding Help ::. Only the top active object.
 

Post Reply  Post Oekaki 
 

Posted By Message

Metal-Geo



Registered
  25/06/2003
Points
  8
19th June, 2005 at 21:28:17 -

Hi,
I'm working with MMF 1.5 and a lot with Active Objects but I have a (maybe common?) problem. When ever I click on an Active Object that is overlapping another Active Object, they both get focus. For example:

(in a frame where 2 active objects overlap each other)
Condition: User clicks with left button on Active 1
Event: Active 1 Destroy.

Then they both dissapear. Is there any way to make it work only on top Active Objects?
Thanks in advance.

 
Many routes lead to good software development. One of them is Clickteam.

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
19th June, 2005 at 23:22:55 -

The cheap way would be to add a "Pick object at random" condition. While this wouldn't neccessarily pick the TOP object, it would pick only one of 'em.

If you really must pick the object at the top, it'll get a little more complicated...

 
Go Moon!

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
20th June, 2005 at 00:09:58 -

I tried a method to find a way to detect which one was on top by giving each of the Active objects values at the start of the level, and that didn't work because you can't test if AV A (Active 1) is greater than AV A (Active 1)... at least it didn't when I tried it. It would seem some extension would be handy.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Metal-Geo



Registered
  25/06/2003
Points
  8
20th June, 2005 at 06:50:23 -

Fifth: If it's not too much to ask but could you maybe give an example file? I seem to work completely wrong with this condition.

 
Many routes lead to good software development. One of them is Clickteam.

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
20th June, 2005 at 09:11:29 -

Maybe if you used the layer object and use a condition like "Is Object above Object" and have it add 1 to the object's alterable value A, then when you have the event to click on the object, have it only Destroy the one with the highest Value A. I haven't tried it, and I dunno if I got the expressions right, but it'd work in theory.

 
Image

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
20th June, 2005 at 16:29:46 -

An example of the "pick object at random" condition?
It should be pretty self-explanitory: you just add it to a condition that applies to several of an object, and it picks only one of them to act upon.

...except...

you don't want it to be the FIRST condition of an event. It can't hold up as the driving condition, as it hasn't got anything to apply to. Put it at the end, like this:

Condition: User clicks with left button on "Active 1"
AND Pick an "Active 1" at random

 
Go Moon!

Long John Kickbag



Registered
  26/08/2002
Points
  148
20th June, 2005 at 16:53:15 -

Some example I did ages ago: www.clicksplat.com/Files/Examples/Click/Pick%20top%20object.cca

 
Resize! - www.clicksplat.com/comparison.html

Long John Kickbag



Registered
  26/08/2002
Points
  148
20th June, 2005 at 17:26:58 -

Some example I did ages ago: www.clicksplat.com/Files/Examples/Click/Pick%20top%20object.cca

 
Resize! - www.clicksplat.com/comparison.html

Metal-Geo



Registered
  25/06/2003
Points
  8
21st June, 2005 at 04:27:25 -

Thanks all. I finaly got it to work and Erik C., your example is very useful. Thanks!

 
Many routes lead to good software development. One of them is Clickteam.
   

Post Reply



 



Advertisement

Worth A Click