View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:00 am



Reply to topic  [ 8 posts ] 
 Another question involving parent objects 
Author Message
User avatar

Joined: Wed Jun 03, 2009 1:12 am
Posts: 93
Reply with quote
Post 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.


Mon Nov 16, 2009 6:44 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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.


Mon Nov 16, 2009 6:47 am
Profile
User avatar

Joined: Wed Jun 03, 2009 1:12 am
Posts: 93
Reply with quote
Post 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.


Mon Nov 16, 2009 4:23 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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?


Mon Nov 16, 2009 5:39 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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.


Mon Nov 16, 2009 6:10 pm
Profile
User avatar

Joined: Wed Sep 16, 2009 6:22 pm
Posts: 491
Location: Victoria, BC
Reply with quote
Post 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!


Mon Nov 16, 2009 9:55 pm
Profile ICQ YIM WWW
User avatar

Joined: Wed Jun 03, 2009 1:12 am
Posts: 93
Reply with quote
Post 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).


Tue Nov 17, 2009 2:05 am
Profile
User avatar

Joined: Wed Sep 16, 2009 6:22 pm
Posts: 491
Location: Victoria, BC
Reply with quote
Post 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.


Tue Nov 17, 2009 2:58 am
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.110s | 14 Queries | GZIP : Off ]