The Daily Click ::. Forums ::. Klik Coding Help ::. Enable Flag on all instances
 

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
2nd December, 2014 at 02/12/2014 13:50:25 -

I'd like to enable a flag on all instances of an object, when the player collides with just one of them. How can I do this?

 
Image

Tell 'em Babs is 'ere...

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
2nd December, 2014 at 02/12/2014 15:36:59 -

Probably a forEach loop I guess.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

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 December, 2014 at 02/12/2014 17:53:02 -

Set a value on a separate object then check that value directly after the collision check, if the value is set set the flags and reset the value. I use this trick all the time to get around the object selection.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
2nd December, 2014 at 02/12/2014 22:04:49 -

Clever pony!

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd December, 2014 at 02/12/2014 22:34:50 -

Aha, thanks guys! A simple work around it seems.

Also, love your avatar Eternal Man.

 
Image

Tell 'em Babs is 'ere...

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
3rd December, 2014 at 03/12/2014 14:58:46 -

I think a fastloop is the way to go. This is what I always do:

+ Object_A collides with Object_B
-> Start loop "Set_Flags", 1 time

+ On loop "Set_Flags"
-> Object_A: Set Flag to ON

btw: If you happen to be using it in your project already, the "Select Object" extension can do exactly what you want, without the need for the extra event - although it's obviously overkill if this is all you're going to use it for.

It's a shame you can't say something like:

+ Never
OR (logical)
+ Object_A collides with Object_B
-> Object_A: Set Flag to ON

...which I thought might work, but doesn't.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
4th December, 2014 at 04/12/2014 17:47:52 -

Thanks UrbanMonk. You are a clever pony, but I am an idiot. Can you make an example mfa how that works?

Thanks,
Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
5th December, 2014 at 05/12/2014 00:32:52 -


Originally Posted by nivram
Thanks UrbanMonk. You are a clever pony, but I am an idiot. Can you make an example mfa how that works?

Thanks,
Marv



Sounds almost like a poem.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image
   

Post Reply



 



Advertisement

Worth A Click