The Daily Click ::. Forums ::. Klik Coding Help ::. Paste object into frame?
 

Post Reply  Post Oekaki 
 

Posted By Message

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
26th February, 2010 at 23:03:43 -

Is there any way to paste an object into another objects frame of animation??

For example I want to paste a blood stain on an axe throughout a game so it gets more bloody when times goes by.. But I want this to be dependent on where the player hits and stuff so pasting an object into the animation could help it get more "random", instead of having a preset number of frames with axes that has more and more blood on them..

Is this possible? =P

 
www.Solgryn.org

Image

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!
27th February, 2010 at 00:36:16 -

Should technically be do-able via the overlay extension and the active object's "load frame" action.

It means you have to save the axe image to an actual file, add blood, and then re-load it. It sounds like it would be slow, but it's actually fine unless you have a huge axe object. You'd pretty much have to make the axe a separate object from the player holding it though - otherwise the blood will move relative to the axe with each animation frame.

I once did something similar in a top-down rally driving game, as a method of making the cars get gradually dirtier during the course of a race - I had an active picture object for the car, another semi-transparent one to act as a dirt layer (so you could still make out the details on the car underneath), and another to act as a mask for the areas I didn't want to get dirty (the image border around the actual car, and the windshield which would be kept clean by the wipers). I then just kept picking a random coordinate, and as long as that point wasn't black on the mask object, then I added a patch of dirt on the dirt layer. It was very effective, and didn't cause any slowdown at all.

Quick example I just made:
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Dirt.mfa
Ignore the crappy race car movement.
Same principles apply to blood on an axe, except you only need to add the blood when the player attacks, so it will be faster

Edited by Sketchy

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
27th February, 2010 at 01:54:30 -

Ah, nice I got it to work kinda =P

Why is the alpha channel getting phucked when I save as an image? Any way to keep the alpha channels??

Also, how do I use the "paste object into overlay" so I can choose which x and y coordinates it's getting pasted in?

EDIT:

fixed the alpha channel stuff, I just removed the black outline and had like a "layer" ontop of the original object, like you had. But I'm still having trouble with the paste object into overlay..

Edited by Solgryn

 
www.Solgryn.org

Image

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!
27th February, 2010 at 02:34:12 -

"paste object into overlay" doesn't really let you set an x,y source and x,y destination easily - the object is pasted where it overlaps the overlay.
You should really put all the various "blood stains" into one overlay, and then use the "paste overlay into overlay" action instead.

btw: Something you might not have noticed, is that when it asks for the fixed value of the source overlay, you actually have to enter the "address of overlay" instead. Don't ask me why...

Alright, here's a demo:
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/AxeBlood.mfa
Click mouse to add blood
"blood" is basically a spriteset containing different types of blood splotch.
"blood mask" is there so that the blood doesn't go over the edge of the axe.
"blood layer" is same as "dirt layer", so you just need to save it, and then load it into an active object as with the car example.

Edited by Sketchy

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
27th February, 2010 at 10:33:58 -

It works nice =D But again, can I have alpha channels pasted in? :/ Like a blood stain that looks kinda real instead of just 1 color -.-

 
www.Solgryn.org

Image

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!
27th February, 2010 at 15:14:44 -

No, you can't
The overlay extension doesn't allow pasting with alpha channels.
The simple solution would be to use dithering on your blood stains, or I guess you could have two or three semi-transparent blood layers, and randomly choose which one to paste the blood stain into - where blood stains overlap on two or more layers, they would look darker/more opaque.


 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
27th February, 2010 at 15:55:37 -

Okay, thanks for the help =D

 
www.Solgryn.org

Image
   

Post Reply



 



Advertisement

Worth A Click