Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
sm animated healthbar
Author Text

coa
Registered User
Quote
2022-06-04 11:57:23

Im trying to use sm animated healtbar for clones but it does not work.. can the script be modified to work with clones

thanks in advance

here is the link to the extension
https://neophyte.cf/ccb_behavior...


smnmhmdy
Registered User
Quote
2022-06-04 12:57:08

Its due to coppercube not changing the node name when using the built-in 'Clone a scene node', you can fix it by executing this code on the 'Action to do with clone' field:
ccbSetSceneNodeProperty(ccbGetCurrentNode(), "Name", "enemy_" + Math.round(Math.random() * 1000));



coa
Registered User
Quote
2022-06-04 14:13:26

thanks smnmhmdy for the fix .. i thought it had something to do with the names i tried changing them first with diffrent method but i had a bug in it. your method is much more clean.!


coa
Registered User
Quote
2022-06-04 14:34:54

would be super cool for a feature if it was possible to apply image on both front and back node maybe for future update


hadoken
Guest
Quote
2022-06-04 17:11:41

Since it is not sold but freely available in the forum, I allowed myself to modify smnmhmdy's "Dynamic, Customizable Health bar" behavior a bit, so that now besides simple colors you can use image textures as bars (BarTex) and bar backgrounds (BarBGTex) as well:

https://www.dropbox.com/s/sud27o...


coa
Registered User
Quote
2022-06-04 18:14:00

very useful extension if you want to make nice looking hp bars quick very nice if you want to make diffrent kinds.
and now with image support very nice! great job hadoken!

im using it in my game The Wizard!


coa
Registered User
Quote
2022-06-05 09:16:14




coa
Registered User
Quote
2022-06-18 10:24:26

hello.. i was trying to use the extension with textures for webgl but the textures do not load any idea why?


hadoken
Guest
Quote
2022-06-18 12:38:54

@coa

After examining the issue myself, seems like both ccbDrawTextureRectangle & cbDrawTextureRectangleWithAlpha do not correctly work in webgl target while ccbDrawColoredRectangle does. All I got were black rectangles in Firefox, maybe it's browser dependent.

So I guess our "animated health bar behavior with image textures" may only work for windows targets at the moment, sorry.

There is a workaround if you use 3D meshes like e.g. cubes or planes as health bar objects. These can be equipped with transparent material and textures as well which are displayed correctly in webgl. But you would need another script for that approach (which shouldn't be hard to come up with despite taking some amount of effort and time).


coa
Registered User
Quote
2022-06-18 13:40:22

thanks hadoken for examine the issue and for the information.
I just used the regular sm animated healthbar for the webgl version


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (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© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact