Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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... |
||||
|
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)); |
||||
|
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.! |
||||
|
would be super cool for a feature if it was possible to apply image on both front and back node maybe for future update |
||||
|
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... |
||||
|
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! |
||||
|
|
||||
|
hello.. i was trying to use the extension with textures for webgl but the textures do not load any idea why? |
||||
|
@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). |
||||
|
thanks hadoken for examine the issue and for the information. I just used the regular sm animated healthbar for the webgl version |
||||
|
Back to this thread, I'm making an health bar asides the player's health which reduces on player movement but I noticed that when I added an external variable to the "sm animated health bar", the health bar suddenly disappears when I run the game but does not disappear when I remove the external variable. I don't know what can be causing this issue, maybe I'm not getting something right. |
||||
|
hie @Dynamogames, I recently created a similar bar extension that you require for @Niven, if you want you can try that. here is the link to the extension:- https://cdn.discordapp.com/attac... Here is the unlisted usage tutorial video:- https://youtu.be/_eZkBN97eaY This is very basic implementation for the healthbars, @hadoken has a great extension for the power and health bar, I highly recommend to use that extension as it allows you to customize the bar heavily with different modes and options. Edit:- Regarding the original question, for sm_animated bar, It is possible that you are not initiating the external variable. So the variable remains zero or undefined and the bar doesn't shows up. You need to make sure that when the game starts, you have defined the external variable with a value. It is much better to set variables in your before first drawing do something behavior. |
|