xjoker_ 25 Posted August 10, 2017 Hello guys, As you can see on this video : I'm changing the vehicle's color by editing the R-G-B values and calling setObjectTexture with it. When I change the Green value, it works fine, the change is smooth. But when I change the Red et Blue values, we can see an unexpected transition between the old color and the new. The final color is good, the script works, but it s not nice to watch. Have you any idea on why it's doing this ? Do you think I can do something about it whereas i'm not doing anything special but using setObjectTexture ? _part = lbCurSel (_disp displayCtrl 1704); _R = sliderPosition (_disp displayCtrl 1705); _G = sliderPosition (_disp displayCtrl 1706); _B = sliderPosition (_disp displayCtrl 1707); target setObjectTexture [_part,format["#(argb,8,8,3)color(%1,%2,%3,1)",_R,_G,_B]]; Share this post Link to post Share on other sites
killzone_kid 1326 Posted August 10, 2017 Could be just texture preloading issue. Share this post Link to post Share on other sites
MrCopyright 107 Posted August 10, 2017 Have you tried adding a delay between each setObjectTexture command? Perhaps a 0.01 second sleep would resolve this issue. Share this post Link to post Share on other sites
xjoker_ 25 Posted November 20, 2017 On 10/08/2017 at 6:16 PM, MrCopyright said: Have you tried adding a delay between each setObjectTexture command? Perhaps a 0.01 second sleep would resolve this issue. I added a small delay, the problem still happens Share this post Link to post Share on other sites
pierremgi 4739 Posted November 20, 2017 You could test ctrlCommit: _part = lbCurSel (_disp displayCtrl 1704); _R = sliderPosition (_disp displayCtrl 1705); _G = sliderPosition (_disp displayCtrl 1706); _B = sliderPosition (_disp displayCtrl 1707); (_disp displayCtrl 1704) ctrlCommit 0; target setObjectTexture [_part,format["#(argb,8,8,3)color(%1,%2,%3,1)",_R,_G,_B]]; Share this post Link to post Share on other sites
HazJ 1288 Posted November 21, 2017 10 hours ago, pierremgi said: You could test ctrlCommit: _part = lbCurSel (_disp displayCtrl 1704); _R = sliderPosition (_disp displayCtrl 1705); _G = sliderPosition (_disp displayCtrl 1706); _B = sliderPosition (_disp displayCtrl 1707); (_disp displayCtrl 1704) ctrlCommit 0; target setObjectTexture [_part,format["#(argb,8,8,3)color(%1,%2,%3,1)",_R,_G,_B]]; Doesn't need ctrlCommit for lb commands. At least most and not this one. @xjoker_ - I just watched the video again, it looks to me like it is a speed thing? When you quickly do it, the issue sometimes happens. You could try using: https://community.bistudio.com/wiki/sliderSetSpeed Share this post Link to post Share on other sites
pierremgi 4739 Posted November 21, 2017 7 minutes ago, HazJ said: Doesn't need ctrlCommit for lb commands. At least most and not this one. That doesn't cost to try it. If all were clear, this kind of problem didn't occur. We are not discussing about bad script but finding any way to make it work smoothly. Share this post Link to post Share on other sites
HazJ 1288 Posted November 21, 2017 Okay but, it is pointless imo. Not sure if you saw after I edited my post or not but I shall repeat: Quote @xjoker_ - I just watched the video again, it looks to me like it is a speed thing? When you quickly do it, the issue sometimes happens. You could try using: https://community.bistudio.com/wiki/sliderSetSpeed Share this post Link to post Share on other sites
xjoker_ 25 Posted November 22, 2017 Thank you guys for your help. I'll test more this evening but I think I found the problem. In my event OnSliderChange, i was "spawning" the script instead of "calling" it Share this post Link to post Share on other sites
HazJ 1288 Posted November 22, 2017 Yeah, that could be an issue. Unless you clear/terminate the previous slider pos change, then it won't wait for that one to complete. I had a similar issue with ctrlMapAnimAdd in which I solved simply with ctrlMapAnimClear command. Share this post Link to post Share on other sites