The Daily Click ::. Forums ::. Klik Coding Help ::. Activate All Flags?
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
30th September, 2013 at 30/09/2013 22:46:11 -

I have a several instances of the same Active Object. When the player overlaps one, I want it's flag to turn on. When not overlapping, I want it to turn off. Pretty simple, and I've got this working with no problem.

The issue comes when I have two instances of this Active Object in the play area. Because the player isn't overlapping both actives, the flags will not toggle. How can I tell MMF to affect the flag on each of these Active Objects?

Edit: I suppose I could have adjusted the flag of the player, rather than the Active Objects... But still, I'd like to know if it's possible to change each instance of the Object.

Edited by -Liam-

 
Image

Tell 'em Babs is 'ere...

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
1st October, 2013 at 01/10/2013 02:14:47 -

Easy:

-Always
Set object "active" flag off

-Player overlaps object active
Set object "active" flag on

EDIT: I should mention that order of events is important here, but that might be obvious.

Edited by UrbanMonk

 
n/a

nim



Registered
  17/05/2002
Points
  7234
1st October, 2013 at 01/10/2013 13:42:12 -

Not sure I understand correctly. You want to toggle the flag on two instances of an object if the player only overlaps one of them?

If so, I don't think it's possible without using an intermediary value to get away from MMF's automatic object selection (in which case you'd be better just using a flag on the player sprite anyway)

 
//

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
2nd October, 2013 at 02/10/2013 02:53:50 -

From what I understand is that he wants the flag "on" for any object the player is overlapping, and for the flag to be "off" if it isn't.

If you code it like this:

Player overlapping active
-Flag ON

Player not overlapping active
-Flag OFF

It doesn't work in cases when both are overlapping and then one stops overlapping. The Flag won't toggle since the player is still overlapping at LEAST one of the objects.

If this is the case then my code will do the trick. At the start of the loop all the flag are turned off, and then it only toggles the flags that the player is overlapping.

 
n/a

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd October, 2013 at 02/10/2013 08:17:43 -

Thanks guys. Sorry I explained a bit weird, but my issue was trying to have the flag on all objects, when only overlapping one... I decided to go with changing the player flag instead as I figured it'd be a difficult process.

 
Image

Tell 'em Babs is 'ere...

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
9th October, 2013 at 09/10/2013 00:38:17 -

Putting the flag activation in a group will work:

Image

Easy workaround for MMF2's object scope

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click