Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Texture animation behavior

rolevix
Registered User
Quote
2017-10-27 06:53:46

Is it possible to make behavior like standart "Animate a texture"
But on key pressed, or every second.

For example:

I press "W" -> Play texture animation for 0.8 sec. After this, it go on default texture.

I press "S" -> Play texture animation until i release "S".


tim12345
Guest
Quote
2017-10-27 17:08:26

This can be achieved using an alternate method that uses a combination of 'change a texture' and 'if a variable has a value do something' and 'every few seconds do something'. It's pain staking yes, but once you set it up you can clone it for use in other objects, and simply modify it.

Might be easier if someone created a javascript plugin that does this, but I think then you would have to store your textures in a folder and it would manually load them?? i don't like that.

Other than that you'd have to wait for niko to add this to the program. (as far as I am aware)

But I do what you have described in essence quite a bit using the first method. maybe someone else has a better idea.


wild-master
Registered User
Quote
2017-10-27 21:46:30

rolevix, I created an example for you that might achieve your goal.

Before you try my demo, you must download this first:
http://ambiera.com/coppercube/ex...

Inside of that Zip file, you will see a file named "action_DoLater.js". You must extract it and place it at this location on your hard drive:
Documents\CopperCube\extensions

After you put the file at that location, you must close CopperCube and restart it.

Now, you should download my example here:
https://drive.google.com/file/d/...

When you open the CCB file with CopperCube, press the tab that says "Publish" near the top, and then press the arrow shaped like a "Play" button to start the game.

When the game opens, you can do this:
1. When you press the W button, the textures that appear on the character will change. After 0.8 seconds, the textures will switch to the normal textures.
2. When you hold the S button, the textures will change, and they will only switch to the normal textures when you stop pressing the button.

Study the file to learn how I did that.


rolevix
Registered User
Quote
2017-10-28 09:37:56

Umm, im working with CCB about 4 years, i know how to do all of this, im just looking for plugin to make process of animation 2D characters more easy.

But thanks for answers...


tim12345
Guest
Quote
2017-10-28 21:23:31

oops...just discovered that you can change the textures via javascript without having to store textures in a folder. you just have to call them into the cache first. cool! so this could be done with a javascript plugin. one of these days i gotta look into how to make one of those plugins. doesn't look too difficult, i'll have to study javascipt in more detail now.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact