The Daily Click ::. Forums ::. Klik Coding Help ::. Yet another question!
 

Post Reply  Post Oekaki 
 

Posted By Message

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  368

VIP MemberCardboard BoxThe Cake is a Lie
2nd April, 2011 at 04:29:53 -

Let's say I have 2 objects. Both of them are grouped as "Children" objects, but they have two different Alterable Value Ps. Now let's say I have 2 more objects, but both of them are grouped as "Parent" objects instead. They, too, have two different Alterable Value Ps. Here's the problem:

If a child object's Alterable Value P equals a parent object's Alterable Value P, then set the child object to the position of the parent object. That's basically what I was aiming for, but in the end, the code didn't really work.

If you need me to send the .mfa file, let me know.

Thanks in advance!

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
2nd April, 2011 at 14:21:46 -

It's far more better if you connect the parent and the child with a fixed value instead of a value. Such as when a child is connected give that child the parent's fixed value or vice versa.

And your code probably didn't work because of object selection. You should read a few articles on object scoping to see how objects are selected.

And basicly make sure that

on loop
parent = loop index (selecting parent!)
child = parent (selecting child!)

set child x,y to parent (without selection will not work properly)

 
Code me a sausage!

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  368

VIP MemberCardboard BoxThe Cake is a Lie
3rd April, 2011 at 23:52:37 -

Sorry, man, but I tried following what you said and I got a little lost. Could you possibly give me a more detailed explanation?

Thanks, man.

 
n/a

nim



Registered
  17/05/2002
Points
  7232
4th April, 2011 at 02:22:38 -


Originally Posted by Austrian W3R3W00F
If a child object's Alterable Value P equals a parent object's Alterable Value P, then set the child object to the position of the parent object. That's basically what I was aiming for, but in the end, the code didn't really work.



I'm surprised that this didn't work. As far as I remember, you can't (for whatever reason) spread a value and execute the fast loop in the same event, so put those actions on separate events.

 
//

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
4th April, 2011 at 03:29:40 -

If you're just trying to position things based on equal alterable values here ya go:

http://www.megaupload.com/?d=W84298E4

I've had this same problem before. I'm not sure if I fixed it this exact way as I whipped this up in two seconds, but for some reason it seems you need a dumb workaround for this to work properly.

Sorry for the megaupload link btw, mediafire is broken atm.

 
n/a

Jacob!



Registered
  17/06/2011
Points
  153
6th April, 2011 at 05:27:15 -

You don't need to mess around with values.
Always: Set Position of Child to 0,0 from Parent

MMF2 will automatically do this for you if there are the exact same number of either.

 
Have you even been far as decided to use even go want to do look more like?

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
6th April, 2011 at 16:27:14 -

I think he needed a method to link ANY child object to ANY parent object, Jacob. Someone correct me if I'm wrong . Either way, being able to link any object to any other object is always going to be more flexible and efficient.

Edited by GamesterXIII

 
n/a
   

Post Reply



 



Advertisement

Worth A Click