Data Realms Fan Forums
http://45.55.195.193/

Another question involving parent objects
http://45.55.195.193/viewtopic.php?f=7&t=17142
Page 1 of 1

Author:  Cadwaller [ Mon Nov 16, 2009 6:44 am ]
Post subject:  Another question involving parent objects

You guys really helped me out last time, and I'm very grateful for your speedy responses. What I was working on before turned out really well but I have another programming question to ask, how could I cause the entire series of connected children (I forgot to explain last time, its a ragdollish thing i'm making) to decrease their size proportionally to the parent when the parent changes its size, and adjust their offsets based on the new size so that they formed a smaller version of the previous ragdoll? I was able to very easily make the peices decrease proportionally in size, but when I did so they became very disorganized.

I hate to make this long-winded, but one more thing I'd also like to clarify is that I don't want 2 ragdolls of different sizes with different offsets, I'd like a function that continually changes the offset of the ragdoll based on size percentage.

Thanks to anyone who reads this.

Author:  Duh102 [ Mon Nov 16, 2009 6:47 am ]
Post subject:  Re: Another question involving parent objects

Uh, can you change the offsets of a child object...? I don't think you can, unless they're pseudo attached with Lua. Also, I don't know if you know but a ragdoll can't be made with regular .ini, joints are stiff and don't allow rotation.

Author:  Cadwaller [ Mon Nov 16, 2009 4:23 pm ]
Post subject:  Re: Another question involving parent objects

oh, oops, I forgot to specify, its not in cortex command either, its another part of the same mod I was making when I asked an earlier question.

Author:  p3lb0x [ Mon Nov 16, 2009 5:39 pm ]
Post subject:  Re: Another question involving parent objects

If it's not in cortex command then what's the point of asking a community dedicated to the aforementioned game?

Author:  Duh102 [ Mon Nov 16, 2009 6:10 pm ]
Post subject:  Re: Another question involving parent objects

Because we're good at math?

How are your child objects attached to your parent objects? Do they have an absolute pixel offset from the parent? If so, you could convert that to a percentage for the scaling and then reset it at the end of the scaling.
Hopefully you're doing the scaling before you let it go crazy with the rotations, otherwise you'd have to do inverse trig calculations too to make sure you had the right positions and whatnot while you did the scaling.

Author:  weasel [ Mon Nov 16, 2009 9:55 pm ]
Post subject:  Re: Another question involving parent objects

Cadwaller wrote:
how could I cause the entire series of connected children (I forgot to explain last time, its a ragdollish thing i'm making) to decrease their size proportionally to the parent when the parent changes its size


Refresh my memory, is this in Basic?

In Flash, a displayObject will automatically inherit and scale for it's children appropriately. You don't have to do any math. Check and see if there is a classType you can extend that provides an equivalent function in your programming language - I suspect most have it.

If you need to do it manually: Organize all the children to have an "attachment point" specified in your code. If a head is on the top of a 10-unit tall body, the attachment point for the head could be 0,-10. You can use Trig to find out the angle and the distance - the head is 0 degrees and a distance of 10.

Simply reverse engineer it for your children. If the parent reduced scale by 20%, 10-20%=8. Scale the size of the object down and move it to the new attachment point. done!

Author:  Cadwaller [ Tue Nov 17, 2009 2:05 am ]
Post subject:  Re: Another question involving parent objects

Thank you for your fast support again! It seems that most of these problems ive been having are due to the limited capabilities of the programming console I am using (this is really emberassing, but I'm using Scratch). Is there any good flash programming console that is free? I know hardly anything about computers so I havent really ever been able to find one other than scratch (which is its own language).

Author:  weasel [ Tue Nov 17, 2009 2:58 am ]
Post subject:  Re: Another question involving parent objects

Cadwaller wrote:
Thank you for your fast support again! It seems that most of these problems ive been having are due to the limited capabilities of the programming console I am using (this is really emberassing, but I'm using Scratch). Is there any good flash programming console that is free? I know hardly anything about computers so I havent really ever been able to find one other than scratch (which is its own language).


I use the Flex SDK to code actionscript without the flash IDE -- it's a free download from Adobe's website. It works fine straight out of notepad, but if you don't know much about computers - you might need to find a few online tutorials on how to get the compiler set up and running properly.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/