Jump to content

Recommended Posts

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 :D!!!

 

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 by SuperDavid

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 by Joachim

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 :D!!! 

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 :shock:!

Edited by SuperDavid
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)

 

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 :D!!!

This is code you made me DarkXero V & the max light it gives off.

Light thing 2.gif

 

This is long code V & the max light it gives off.

Light thing 1.gif

 

Edited by SuperDavid

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 :D 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 by Serpens
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 :D 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 :D, 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 :D!!!

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 :D!!!!!!!!!!!!!!!!

Flawless.gif

Edited by SuperDavid

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...