The Daily Click ::. Forums ::. Klik Coding Help ::. Creating new objects and setting properties
 

Post Reply  Post Oekaki 
 

Posted By Message

nim



Registered
  17/05/2002
Points
  7233
5th August, 2013 at 05/08/2013 14:28:05 -

Just something that I've sometimes wondered about in MMF. I think I'm pretty handy with MMF now but sometimes its thinking just confuses me. I'm hoping that Sketchy, Fifth, Pixelthief or one of those guys more experienced with MMF notice this!

In the picture below, I'm creating 5 active objects and setting their properties. It looks logical but it messes up at run time. The last property is applied (only) to the first-created object.

Image

Does anyone have any insight into this? And in a case where fastloops aren't an option, is there a way to create multiple objects and set their properties in one event? I understand that this particular example can be done easily with fastloops. I'm just trying to figure out how MMF thinks.


 
//

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
5th August, 2013 at 05/08/2013 15:16:43 -

I just tried this and it messed up. I was so certain it would work though, as it will let you create an object, then set it's position right afterwards, and continue with other actions the same way you have displayed in the pic.

sorry I can't help, but it's a strange problem!

 
Image

Tell 'em Babs is 'ere...

Alonso Martin



Registered
  29/12/2010
Points
  294
5th August, 2013 at 05/08/2013 16:58:51 -

The reason why this happens is because MMF's object selection is reset every time it creates a new object (and the focus is just applied to the new object). If you have 5 separate events that create the object and set the scale, it will work. Or you could run a fastloop 5 times to create them more neatly.

Also, create at object and create at x,y also influences object selection. It seems it's best to always create the object at x,y and then set the x,y to another object's x,y if you need to. But if you create objects through fastloops (1 object + config conditions per event), this last shouldn't be relevant.


EDIT: By the way, if you're going to use fastloops, put them inside a deactivated group. I always name groups like these "LOOP: Description". When you need to run the events, activate the group, run the loop, and deactivate the group. This way you keep MMF's string pool clean, and that way it avoids having to determine what fastloops need to be run (which can be pretty slow if you have a lot of on loop events).

Edited by Alonso Martin

 
www.hfalicia.com
www.alonsomartin.mx

nim



Registered
  17/05/2002
Points
  7233
5th August, 2013 at 05/08/2013 23:34:06 -

Thanks, Alonso!

 
//
   

Post Reply



 



Advertisement

Worth A Click