. . . Posted August 17, 2016 Share Posted August 17, 2016 (edited) Hello, I have a question if someone can tell me ! So, like in the title says can FX colors be changed? Like the "sparks_fx"? I'd like my character to use the sparks_fx but I want to make it color white would that be possible or no? Thanks a lot for reading my question, have a wonderful day !!! QUESTION IS BELOW I V PS. Also, if someone can tell me what's the "sparklefx" in "fx.lua" and why is it not being used? Can it be used because it sounds interesting to me ! Edited August 20, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/ Share on other sites More sharing options...
Joachim Posted August 19, 2016 Share Posted August 19, 2016 (edited) Yes, you can. As you can see, the definitions refer to "builds" and "banks". These consider the animation files, which can be found in the anim/ folder. You need to extract the corresponding animation files (which are ZIPs) and convert the TEX file to a PNG (there is a tool called ktech that you can download; look it up). Then you use Photoshop, GIMP or whatever to change the PNGs however you want, and convert them back to TEX files. I would start with this. The next step would be to rename the builds and make sure your new assets are loaded correctly. Edited August 19, 2016 by Joachim Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-804936 Share on other sites More sharing options...
. . . Posted August 19, 2016 Author Share Posted August 19, 2016 (edited) Hello, I need help with something if possible ! So, i'd just like to know if it's possible to shorten this code? ---------------------------------------------------------------] ---------------------------------------------------------------] act.target._blinktask = act.target:DoPeriodicTask(1.5, function() act.target._lightenabled = not act.target._lightenabled ---------------------------------------] ---------------------------------------] act.target:DoTaskInTime(0.1, function() act.target.Light:SetRadius(.01) act.target.Light:SetIntensity(.40) end) act.target:DoTaskInTime(0.2, function() act.target.Light:SetRadius(.02) act.target.Light:SetIntensity(.39) end) act.target:DoTaskInTime(0.3, function() act.target.Light:SetRadius(.03) act.target.Light:SetIntensity(.38) end) act.target:DoTaskInTime(0.4, function() act.target.Light:SetRadius(.04) act.target.Light:SetIntensity(.37) end) act.target:DoTaskInTime(0.5, function() act.target.Light:SetRadius(.05) act.target.Light:SetIntensity(.36) end) act.target:DoTaskInTime(0.6, function() act.target.Light:SetRadius(.06) act.target.Light:SetIntensity(.35) end) act.target:DoTaskInTime(0.7, function() act.target.Light:SetRadius(.07) act.target.Light:SetIntensity(.34) end) act.target:DoTaskInTime(0.8, function() act.target.Light:SetRadius(.08) act.target.Light:SetIntensity(.33) end) act.target:DoTaskInTime(0.9, function() act.target.Light:SetRadius(.09) act.target.Light:SetIntensity(.32) end) act.target:DoTaskInTime(0.10, function() act.target.Light:SetRadius(.10) act.target.Light:SetIntensity(.31) end) act.target:DoTaskInTime(0.11, function() act.target.Light:SetRadius(.11) act.target.Light:SetIntensity(.30) end) act.target:DoTaskInTime(0.12, function() act.target.Light:SetRadius(.12) act.target.Light:SetIntensity(.29) end) act.target:DoTaskInTime(0.13, function() act.target.Light:SetRadius(.13) act.target.Light:SetIntensity(.28) end) act.target:DoTaskInTime(0.14, function() act.target.Light:SetRadius(.14) act.target.Light:SetIntensity(.27) end) act.target:DoTaskInTime(0.15, function() act.target.Light:SetRadius(.15) act.target.Light:SetIntensity(.26) end) act.target:DoTaskInTime(0.16, function() act.target.Light:SetRadius(.16) act.target.Light:SetIntensity(.25) end) act.target:DoTaskInTime(0.17, function() act.target.Light:SetRadius(.17) act.target.Light:SetIntensity(.24) end) act.target:DoTaskInTime(0.36, function() act.target.Light:SetRadius(.18) act.target.Light:SetIntensity(.23) end) act.target:DoTaskInTime(0.18, function() act.target.Light:SetRadius(.19) act.target.Light:SetIntensity(.22) end) act.target:DoTaskInTime(0.19, function() act.target.Light:SetRadius(.20) act.target.Light:SetIntensity(.21) end) act.target:DoTaskInTime(0.20, function() act.target.Light:SetRadius(.21) act.target.Light:SetIntensity(.20) end) act.target:DoTaskInTime(0.21, function() act.target.Light:SetRadius(.22) act.target.Light:SetIntensity(.19) end) act.target:DoTaskInTime(0.22, function() act.target.Light:SetRadius(.23) act.target.Light:SetIntensity(.18) end) act.target:DoTaskInTime(0.23, function() act.target.Light:SetRadius(.24) act.target.Light:SetIntensity(.17) end) act.target:DoTaskInTime(0.24, function() act.target.Light:SetRadius(.25) act.target.Light:SetIntensity(.16) end) act.target:DoTaskInTime(0.25, function() act.target.Light:SetRadius(.26) act.target.Light:SetIntensity(.15) end) act.target:DoTaskInTime(0.26, function() act.target.Light:SetRadius(.27) act.target.Light:SetIntensity(.14) end) act.target:DoTaskInTime(0.27, function() act.target.Light:SetRadius(.28) act.target.Light:SetIntensity(.13) end) act.target:DoTaskInTime(0.28, function() act.target.Light:SetRadius(.29) act.target.Light:SetIntensity(.12) end) act.target:DoTaskInTime(0.29, function() act.target.Light:SetRadius(.30) act.target.Light:SetIntensity(.11) end) act.target:DoTaskInTime(0.30, function() act.target.Light:SetRadius(.31) act.target.Light:SetIntensity(.10) end) act.target:DoTaskInTime(0.31, function() act.target.Light:SetRadius(.32) act.target.Light:SetIntensity(.09) end) act.target:DoTaskInTime(0.32, function() act.target.Light:SetRadius(.33) act.target.Light:SetIntensity(.08) end) act.target:DoTaskInTime(0.33, function() act.target.Light:SetRadius(.34) act.target.Light:SetIntensity(.07) end) act.target:DoTaskInTime(0.34, function() act.target.Light:SetRadius(.35) act.target.Light:SetIntensity(.06) end) act.target:DoTaskInTime(0.35, function() act.target.Light:SetRadius(.36) act.target.Light:SetIntensity(.05) end) act.target:DoTaskInTime(0.36, function() act.target.Light:SetRadius(.37) act.target.Light:SetIntensity(.04) end) act.target:DoTaskInTime(0.37, function() act.target.Light:SetRadius(.38) act.target.Light:SetIntensity(.03) end) act.target:DoTaskInTime(0.38, function() act.target.Light:SetRadius(.39) act.target.Light:SetIntensity(.02) end) act.target:DoTaskInTime(0.39, function() act.target.Light:SetRadius(.40) act.target.Light:SetIntensity(.01) end) act.target:DoTaskInTime(0.40, function() act.target.Light:Enable(act.target._lightenabled) end) end) ---------------------------------------------------------------] ---------------------------------------------------------------] I use this code to make like a smooth blinking light transition but it's kinda annoying when I want to edit my modmain.lua it takes a long time to scroll down because of this code, so, does anyone maybe know how to shorten all those "act.target:DoTaskInTime"? It would be a really great help but this is not super important so if nobody can help that's 100% okay too ! I thank you for reading me problem, god bless you & have a wonderful day/night !!! PS. I felt like this question isn't important enough to have it's own thread so I just edited one of my other threads to ask this, sorry if that's not okay or something ! Edited August 19, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805075 Share on other sites More sharing options...
DarkXero Posted August 19, 2016 Share Posted August 19, 2016 local function SetLightRadiusIntensity(target, radius, intensity) target.Light:SetRadius(radius) target.Light:SetIntensity(intensity) end local target = act.target target._blinktask = target:DoPeriodicTask(1.5, function() target._lightenabled = not target._lightenabled local radius = 0.01 local intensity = 0.40 for i = 0.1, 0.39, 0.1 do target:DoTaskInTime(i, SetLightRadiusIntensity, radius, intensity) radius = radius + 0.01 intensity = intensity - 0.01 end target:DoTaskInTime(0.40, function() SetLightRadiusIntensity(target, 0.40, 0.01) target.Light:Enable(target._lightenabled) end) end) Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805146 Share on other sites More sharing options...
. . . Posted August 20, 2016 Author Share Posted August 20, 2016 (edited) local function SetLightRadiusIntensity(target, radius, intensity) target.Light:SetRadius(radius) target.Light:SetIntensity(intensity) end local target = act.target target._blinktask = target:DoPeriodicTask(1.5, function() target._lightenabled = not target._lightenabled local radius = 0.01 local intensity = 0.40 for i = 0.1, 0.39, 0.1 do target:DoTaskInTime(i, SetLightRadiusIntensity, radius, intensity) radius = radius + 0.01 intensity = intensity - 0.01 end target:DoTaskInTime(0.40, function() SetLightRadiusIntensity(target, 0.40, 0.01) target.Light:Enable(target._lightenabled) end) end) I replaced my long code with this code & the light this code gives off is so much weaker compared to the long code, look at the gifs. Do you know what I change with your code to make it give off higher radius light, sorry for being such a bother & thanks for helping so much !!! This is code you made me DarkXero V & the max light it gives off. This is long code V & the max light it gives off. Edited August 20, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805188 Share on other sites More sharing options...
Serpens Posted August 20, 2016 Share Posted August 20, 2016 (edited) your long code is wrong. act.target:DoTaskInTime(0.9, function() act.target.Light:SetRadius(.09) act.target.Light:SetIntensity(.32) end) act.target:DoTaskInTime(0.10, function() act.target.Light:SetRadius(.10) act.target.Light:SetIntensity(.31) end) after 0.9 you start again at 0.1. So as a result after 0.1 seconds, your light radius is 0.1 instead of 0.01. The versoin of DarkXero fixed this, but the result is not what you wanted. So just change the radius E.g try local radius = 0.1 try to understand the short code from DarkXero for i = 0.1, 0.39, 0.1 do does mean that we start with an i=0.1 and we will increase it every round by 0.1, until it reaches 0.39... Okay, obviously this is also wrong But could be because of your code that is not consistent if you want to increase it by 0.1 or by 0.01 Edited August 20, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805321 Share on other sites More sharing options...
. . . Posted August 20, 2016 Author Share Posted August 20, 2016 (edited) 50 minutes ago, Serpens said: your long code is wrong. act.target:DoTaskInTime(0.9, function() act.target.Light:SetRadius(.09) act.target.Light:SetIntensity(.32) end) act.target:DoTaskInTime(0.10, function() act.target.Light:SetRadius(.10) act.target.Light:SetIntensity(.31) end) after 0.9 you start again at 0.1. So as a result after 0.1 seconds, your light radius is 0.1 instead of 0.01. The versoin of DarkXero fixed this, but the result is not what you wanted. So just change the radius E.g try local radius = 0.1 try to understand the short code from DarkXero for i = 0.1, 0.39, 0.1 do does mean that we start with an i=0.1 and we will increase it every round by 0.1, until it reaches 0.39... Okay, obviously this is also wrong But could be because of your code that is not consistent if you want to increase it by 0.1 or by 0.01 Thanks , i'll try doing that! And i'm not really good at understanding most code so I really thank you for explaining what DarkXero's does !!! PS. OKay, I edited DarkXero code like this local function SetLightRadiusIntensity(target, radius, intensity) target.Light:SetRadius(radius) target.Light:SetIntensity(intensity) end local target = act.target target._blinktask = target:DoPeriodicTask(1, function() target._lightenabled = not target._lightenabled local radius = 0.5 local intensity = 0.40 for i = 0.01, 0.89, 0.01 do target:DoTaskInTime(i, SetLightRadiusIntensity, radius, intensity) radius = radius + 0.01 intensity = intensity - 0.01 end target:DoTaskInTime(0.90, function() SetLightRadiusIntensity(target, 0.40, 0.40) target.Light:Enable(target._lightenabled) end) end) and it gives off a much smoother nice looking light , thanks so much for everyone's help !!!!!!!!!!!!!!!! Edited August 20, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805324 Share on other sites More sharing options...
DarkXero Posted August 20, 2016 Share Posted August 20, 2016 Oh jeez, I wasn't paying attention. I read the top and the bottom and assumed what was in the middle. Anyways, if you see you have too much stuff in modmain, you can "run separate modmains". With the modimport function provided. Like in the attached example. example.zip Link to comment https://forums.kleientertainment.com/forums/topic/69628-solved-need-help-with-trying-to-shorten-some-dotaskintime/#findComment-805344 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now