Thirsty Panther Posted June 21, 2015 Share Posted June 21, 2015 Ive had some problems with Aggros health Bar script. It seems that the Set Color command is no longer scaler. ie a value between 0 and 1 but now takes values between 0 and 255. Is this right? Quote Link to comment Share on other sites More sharing options...
reepblue Posted June 21, 2015 Share Posted June 21, 2015 I swore that this was addressed myself, but I still divide all my color values by 255 as I'm sure it will always work. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
macklebee Posted June 21, 2015 Share Posted June 21, 2015 The only thing that still uses the 0-255 scale is the color picker window (scripted color property)- but to set the color picker via code you would use the 0-1 scale. Also the color picker now returns a 0-1 scale. All other color features use 0-1 scale as well (SetColor(), shaders,etc...). Anything over 1 is just increasing the saturation/intensity which you will not notice a difference over 2 on models and for 2D items no difference over 1. As for Aggror's script, I cannot say if he is converting the 0-255 scale to the 0-1. The four cardboard boxes show how it works. First box from the left shows the texture. Second box from the left shows the results of SetColor(1,0,0,1) mixed with the texture. Third box from the left shows the saturation from using SetColor(2,0,0,1). And the fourth box shows that using a SetColor(255,0,0,255) looks the same as the saturated third box. Note though that a script's color property will give weird results in the color picker window if you use anything other than a 0-1 scale to set the property. See this bug report for more details: http://www.leadwerks.com/werkspace/topic/12241-script-color-property-returns-unexpected-results/#entry88728 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Thirsty Panther Posted June 21, 2015 Author Share Posted June 21, 2015 "Also the color picker now returns a 0-1 scale" This is the difference. In Aggrors script he takes the values from the picker and divides them by 255 to get the scaler. I've removed this step from the code and it works again. Thanks for the info. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.