[ [ Script ] ] Color Conversion + Light Manipulation
[ [ Script ] ] Color Conversion + Light Manipulation
Out of Order
Last edited by NutJob on Wed Oct 29, 2014 11:47 pm, edited 2 times in total.
................
..................
Last edited by NutJob on Wed Nov 12, 2014 1:33 am, edited 4 times in total.
Re: [ [ Script ] ] Color Conversion + Light Manipulation
errr... sory but what is this script for ? I can change light of color ? Do I need define object for it ? any examples ? How to do that ?
Re: [ [ Script ] ] Color Conversion + Light Manipulation
To dynamically change light colors, turn off particles, fade out lights with other scripts (that you make) using calculation instead of hard/hand-coding it into every script you want to manipulate lighting.Drakkan wrote:what is this script for ?
Yes, lighting color and pointLight color can be changed. Still trying to figure out particle colors. I think I've been looking in the wrong places to do this.Drakkan wrote:I can change light of color ?
You don't.Drakkan wrote:Do I need define object for it ?
SureDrakkan wrote:any examples ?
Code: Select all
library.script.GFX.light({"ceiling_light_20", "ceiling_light_21"}, "red") -- turn these two lights red
library.script.GFX.light({"ceiling_light_20", "ceiling_light_21"}, {"red","33ff21"}) -- turn the first light red, the second a light green
library.script.GFX.light("someLight_01", _, 0, 20000) -- fade out someLight_01 over 20 seconds
library.script.GFX.light("someLight_01", "purple", 0, 5000) -- turn someLight_01 purple then fade it out over 5 seconds
library.script.GFX.light("someLight_01", _, 1, 2000) -- fade in someLight_01 over two second
library.script.GFX.light({"light01","light02","light03","light04","light05","light06","light07"}) -- toggle all 7 lights
library.script.GFX.light("someLight_01", "#3333ff", _, _, _, 0) -- shut off only the particle effects, the light stays AND was turned blue
-- too many permutations for examples but I hope you get the picture
Make a script_entity, rename the ID 'library'. That's it.Drakkan wrote:How to do that ?
Last edited by NutJob on Fri Oct 31, 2014 1:17 am, edited 1 time in total.
Re: [ [ Script ] ] Color Conversion + Light Manipulation
aaaah, I tried some of these examples and it is really wonderfull. I do not think I am able to use whole potencial of this, however still thanks a lot, I can use it for some riddles and will definitey credit you !
Re: [ [ Script ] ] Color Conversion + Light Manipulation
Groovy! And no worries about the credit. A reply of [gratitude|feedback|criticism{constructive|inflammatory}] in the thread you find any of my scripts works well enough. ~cheers~Drakkan wrote:aaaah, I tried some of these examples and it is really wonderfull. I do not think I am able to use whole potencial of this, however still thanks a lot, I can use it for some riddles and will definitey credit you !
Re: [ [ Script ] ] Color Conversion + Light Manipulation
crediting you is the smallest thanks I can do right now. I will probably need some specific color changes / effect, will send you PM eventaully. Thanks once again.NutJob wrote:Groovy! And no worries about the credit. A reply of [gratitude|feedback|criticism{constructive|inflammatory}] in the thread you find any of my scripts works well enough. ~cheers~Drakkan wrote:aaaah, I tried some of these examples and it is really wonderfull. I do not think I am able to use whole potencial of this, however still thanks a lot, I can use it for some riddles and will definitey credit you !
Re: [ [ Script ] ] Color Conversion + Light Manipulation
Anytime, but it has limitations and bugs currently until I get documentation. I'm sort of winging-it right now and hope to make it a lot more robust, feature rich, and applicable to other objects. Not just light. I was working on a strobe effect that can be applied to any light but removed it before copying it here. It [strobe] "sort of" worked but requires making a timer/script dynamically and was having some problems with it's destruction, too many timers populating, and some logic errors (mostly programmer error heh).Drakkan wrote:will send you PM eventaully.
Re: [ [ Script ] ] Color Conversion + Light Manipulation
what am i doing wrong. i made a script entity library and put your code into it. Then I made a ceiling light and named it someLight_01.. coupled a floor trigger to another lua script entity with the following code:
function somelight()
library.script.GFX.light({"someLight_01"}, "red") -- turn these two lights red
end
When I step on it I get the following message: attempt do index field pointlight a nil value ... behind this part of line in the script below ------------------------------> obj.pointlight:setColor(GFX.vec(xC))
any help would be apriciated: I am very new to this and trying to learn ..what does what .. etc
if forceFade ~= nil then
if forceFade == 1 then
obj.light:fadeIn(fadeOvertime)
obj.pointlight:fadeIn(fadeOvertime)
obj.particle:fadeIn(fadeOvertime)
else
obj.light:fadeOut(fadeOvertime)
obj.pointlight:fadeOut(fadeOvertime)
obj.particle:fadeOut(fadeOvertime)
end
end
if _colors ~= nil then
if _colors ~= nil then xC = _colors else xC = lastColor end
if xC ~= nil then
obj.pointlight:setColor(GFX.vec(xC))
obj.light:setColor(GFX.vec(xC))
lastColor = xC
end
end
end
end
end
function somelight()
library.script.GFX.light({"someLight_01"}, "red") -- turn these two lights red
end
When I step on it I get the following message: attempt do index field pointlight a nil value ... behind this part of line in the script below ------------------------------> obj.pointlight:setColor(GFX.vec(xC))
any help would be apriciated: I am very new to this and trying to learn ..what does what .. etc
if forceFade ~= nil then
if forceFade == 1 then
obj.light:fadeIn(fadeOvertime)
obj.pointlight:fadeIn(fadeOvertime)
obj.particle:fadeIn(fadeOvertime)
else
obj.light:fadeOut(fadeOvertime)
obj.pointlight:fadeOut(fadeOvertime)
obj.particle:fadeOut(fadeOvertime)
end
end
if _colors ~= nil then
if _colors ~= nil then xC = _colors else xC = lastColor end
if xC ~= nil then
obj.pointlight:setColor(GFX.vec(xC))
obj.light:setColor(GFX.vec(xC))
lastColor = xC
end
end
end
end
end
Re: [ [ Script ] ] Color Conversion + Light Manipulation
Which ceiling light? I suppose I never checked them all and perhaps(?) not all have 'pointlight' ... let me know. I assumed they all had it and it was the "glare" effect for realism. When I get back to my computer at home I'll do more testing. (at office atm)kelly11 wrote:what am i doing wrong. i made a script entity library and put your code into it. Then I made a ceiling light