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.
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
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
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.
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