[Update 1.0 - 2015.03.13] Emergency Lights CLEO script by nyolc8

Started by nyolc8, February 08, 2015, 13:59

nyolc8

random testing, those "light objects" (billboard object scaled down lol) are made there with script only:



this is not a thing I'll implement soon, but maybe someday...

nyolc8

This is a spotlight method I can implement (today's work :D):



I'll try to find a better object in the game for the light object back side (I'll need a half-sphere object), currently I used the area69 object there.

Problems:
- the object(the light object model) would appear only when you're in the car or you enabled an emergency light (or the spotlight itself) on the car
- it's only rotatable on Z (in this game, this is the vertical - stupid game :d) axis (well maybe it's possible to make tiltable - then lightshadow would change size and distance from light to make a realistic effect, but it will be hard to do it. this thing needs many math in it's current state too :D)
- light can only bright up vehicles or players (better than nothing :P)

PS.: I'll implement this corona visibility thing into my lighthouse light script, so there will be not only the beam but a corona as well, from far away too

BeastyBill88

Great work yet again! And thanks for answering my questions earlier :) well the spotlight could be worked on in a later version. The EL,Strobe & advisor lights are the main reason for the mod.

Marccc

I found a nice car mod and i want to show you it with the light mod.  C:-)

[xfire]http://social.xfire.com/videos/63323b[/xfire]

Car is from here: http://www.ikey07.com/?page=download&item=17
Here the  coordinates i use on this car.
[spoiler][597]             //copcarsf
mainLights.enable = 1
strobeLights.enable = 1
advisorLights.enable = 1


mainEL.pos1.X = 0.65
mainEL.pos2.X = 0.65
mainEL.pos.Y = 0.05
mainEL.pos.Z = 0.95
mainEL.rgb1.R = 0
mainEL.rgb1.G = 0
mainEL.rgb1.B = 0
mainEL.rgb2.R = 0
mainEL.rgb2.G = 0
mainEL.rgb2.B = 255
mainEL.alpha = 255
mainEL.size = 0.35
mainEL.shadow.pos.X = 1.5
mainEL.shadow.pos.Y = -0.35
mainEL.shadow.pos.Z = 0.9
mainEL.shadow.size = 0
mainEL.shadow.rgb1.R = 0
mainEL.shadow.rgb1.G = 0
mainEL.shadow.rgb1.B = 0
mainEL.shadow.rgb2.R = 0
mainEL.shadow.rgb2.G = 0
mainEL.shadow.rgb2.B = 0


strobeEL.posF.X = -0.12
strobeEL.posF.Y = 1
strobeEL.posF.Z = 0.37
strobeEL.posR.X = -0.60
strobeEL.posR.Y = -1.7
strobeEL.posR.Z = 0.35
strobeEL.rgb1.R = 0
strobeEL.rgb1.G = 0
strobeEL.rgb1.B = 255
strobeEL.rgb2.R = 0
strobeEL.rgb2.G = 0
strobeEL.rgb2.B = 255
strobeEL.size = 0.12
strobeEL.alpha = 255
strobeEL.shadow.pos.X = 0.4
strobeEL.shadow.pos.Y = 3.5
strobeEL.shadow.pos.Z = -0.03
strobeEL.shadow.rgb1.R = 70
strobeEL.shadow.rgb1.G = 0
strobeEL.shadow.rgb1.B = 0
strobeEL.shadow.rgb2.R = 0
strobeEL.shadow.rgb2.G = 0
strobeEL.shadow.rgb2.B = 70
strobeEL.shadow.size = 0


advisorEL.pos.Y = -1.4
advisorEL.pos.Z = 0.64
advisorEL.space.X = 0.12
advisorEL.alpha = 255
advisorEL.rgb.R = 0
advisorEL.rgb.G = 0
advisorEL.rgb.B = 255
advisorEL.size = 0.07[/spoiler]

LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

~!!!~ Watch my Police cars collection in the link below ~!!!~

[hide=link]http://imgur.com/a/gaJTT[/hide]

nyolc8

Nice :P

***

Made the spotlight to actually work like a light (works the same as vehicle headlights, it was a nightmare to do - cosine & sinus math all day along... :D) so now it brights up charaters and vehicles, and even the car itself (which contains the spotlight) too if you point the light to it (can be seen on video). Also now the lights shadow scales and becomes less visible based on camera tilt (it also changes the light distance) so it works more real now. The light model itself does not tilting yet (But I don't know if I'll make that model even visible or there will be only the light as for other lights).


Petar

Omg, you are a GOD!!! That spotlight is freaking amazing. I guess it's not synced, just visible on your own screen?

nyolc8 I suggest you to come on a RP server where I'm from and show them your work, they will love it. ;)

nyolc8

Thanks :)) yes, it's not synced. :)

Now I'm cleaning repetitive code from the script, then I'll implement this spotlight into it (without the light model for now). Just need a key switch for it.... Is B key used for anything?:D

BeastyBill88

To be honest you won't need the spotlight model as most models already have one or two. and the B key isn't used for anything in a vehicle as far as I know.

nyolc8

I know but because this script works with stock vehicles too, that's why I wanted a model... but it looks strange that it just appears there so that's why I left out the model.

Anyway... just making it turnable on/off in this moment, also it will not moved all time, only when you hold down right mouse button .And then I need to implement this whole thing into the emergency.cs...

edit: finished the controlling, also the lightcorona now changes it's side based on how much is the light distance is (so it's "tilt")

sardarji

Quote from: nyolc8 on February 27, 2015, 22:12
Nice :P

***

Made the spotlight to actually work like a light (works the same as vehicle headlights, it was a nightmare to do - cosine & sinus math all day along... :D) so now it brights up charaters and vehicles, and even the car itself (which contains the spotlight) too if you point the light to it (can be seen on video). Also now the lights shadow scales and becomes less visible based on camera tilt (it also changes the light distance) so it works more real now. The light model itself does not tilting yet (But I don't know if I'll make that model even visible or there will be only the light as for other lights).


WOW...Epic!


nyolc8

Thanks, I just finished implementing it into the emergency.cs (this is not just copy paste :D).
It have a small bug (light appears in the center of the car for a moment when you enable it), I'll fix that somehow, then need to figure out a status icon for this, and then new version will released.

nyolc8

status icon "thing" updated, now it contains the "searchlight" too, also slightly moved/scaled the elements of it

BeastyBill88

:D epic! I can't wait to try this out, great work again Nyolc8.

nyolc8

Thanks! :)

Well, it looks like config lines will change afterall, I mean for the lightshadows. I think the "shadow.pos.X" coordinate is unneccessary in the .ini file because the corona position can be used for that. I'll leave the pos.Y to be able to set shadow distance from light. So I'll remove all shadow.pos.X coordinate lines from vehicles.ini file.
BUT as a new thing, you will can change light shadow size seperately for front and rear shadows. So there will be shadowF.size and shadowR.size for all strobe lights. You'll can set the "R"(rear) shadows and lights to face front too if you want.

BeastyBill88

Very nice! The pos.Z was for moving it forward or backwards wasn't it? I can't remember lol. But all the other coordinates are the same so we can copy the ones from V 0.9.5. Oh and by the way this is what my Roadtrain (your mod) looks like with orange lights ;)



I have the strobes on the front grill, the main EL's on the roof (and made to the same size as the advisor), also the TA is on the roof aswell. Thanks for the idea Marccc.