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

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

BeastyBill88

That's good then, I can just copy the coordinates from this version to the vehicles and then just add the extra lights.

It is still the lag fix causing the status icon to break? So the coronas will work like the headlights? Would you be able to show us a video at a later date to show this? Would be great if you could.

And don't worry about when your going to release it, we can wait ;) lol

nyolc8

Yes, the shadow lag fix breaks all draw-on-screen opcodes, making all of them permanently being drawn on each other. Basically it doesn't get removed at the end of the frame.

The angle script is now in a seperate file which is just draws a text on screen with the multiplier so not much to show yet... :D

BeastyBill88

Well that sucks lol. Is the fix like an ASI file, Cleo script or something like that?

Ah fair enough :) either way its looking great, definitely makes it alot better then the standard lights and ELM just because you can add it to any car and customize it were as with ELM you have to do it in 3DS or something lol.

nyolc8

the fix is built into my emergency.cs file.

now strobe1 and strobe2 works with dynamically changed corona sizes (relative to what you configure in the ini file), and there is a switch for pair of lights to set it front/rear/old style. This option also modifies the shadow direction(front/rear).

edit: now all lights supporting front/rear option (strobe1-2-3 & advisor) so now advisor can be moved to the roof behind the siren and it won't be visible from front view.

nyolc8

check how the coronas changing their sizes, also visible from only one angle:



(not the best video but the effect can be clearly seen on the reverse light blinkers)

nyolc8

I have no idea how I'll make the shadows... because the guy who made the fix, said that isn't a fix, it just blocks a function which prevents draw things too fast. Now I sent a pm to DK and asked how he did it with imvehft light shadows... (because that works without messing up anything) maybe I can get some help from there...

edit: DK responded and I have no idea what he meant xd so I don't know how I'll make this :/

edit2: I had a stupid idea, also DK said it won't work. :D But I started to do it... and... well I got it to work :D So the shadow not crawls away but jumps a bit as you move(but because of the blinking light, it won't be much noticable)... I think this is the best solution because this not changes anything render-wise, so everything will be the same as before(icon will work and such) just shadow won't crawl away. :D

BeastyBill88

Great news Nyolc8 :D the improvements are looking brilliant, is there anything else you will be adding? I was thinking, maybe a sound can play like a beep or click noise when you change the light pattern or turn lights on/off etc.

Also will it be possible to add lights and setup lights which are not flashing? Like a spotlight? That would be a good add to have :D

nyolc8

I don't know if sound needed or not... The cript getting really heavy because of all the angle math things and such... and now the shadow position correction math...

With the angle corona sizing thing, I can add spotlight. Maybe I'll make it with a searchlight too, and it will light where the camera is looking :P Just an idea...

Btw the shadow position correcting is so complex, I can't follow what I'm doing... xd So it's only works properly when the car moves on X axis and the car is inside a positive coordinate.... my brain exploded already lol
But I'll make it... :D

edit: all four direction works now, shadow position being corrected

BeastyBill88

QuoteI can add spotlight. Maybe I'll make it with a searchlight too, and it will light where the camera is looking :P Just an idea...

That would be awesome! :D Also if your brain explodes please can someone clean up the mess? Lol

nyolc8

strobelight1 has got the "shadow corrector" fully, tested, works nicely :P, now 3 other lights to go... :D

edit: shadow correction implemented for all lights :P

edit2: here's my current setup for my "copcarla", just to see what's new in the vehicles.ini parameters:

[596] //copcarla
mainLights.enable = 1
strobeLights.1.enable = 1
strobeLights.2.enable = 1
strobeLights.3.enable = 1
advisorLights.enable = 1

strobeLights.enable became 1-2-3 to be configure which one you want enabled on the car.
***


mainEL.pos1.X = 0.3
mainEL.pos2.X = 0.8
mainEL.pos.Y = -0.35
mainEL.pos.Z = 0.95
mainEL.rgb1.R = 0
mainEL.rgb1.G = 0
mainEL.rgb1.B = 255
mainEL.rgb2.R = 255
mainEL.rgb2.G = 0
mainEL.rgb2.B = 0
mainEL.alpha = 190
mainEL.size = 0.8
mainEL.shadow.pos.X = 7.0
mainEL.shadow.pos.Y = -0.35
mainEL.shadow.size = 6.0
mainEL.shadow.rgb1.R = 0
mainEL.shadow.rgb1.G = 0
mainEL.shadow.rgb1.B = 60
mainEL.shadow.rgb2.R = 60
mainEL.shadow.rgb2.G = 0
mainEL.shadow.rgb2.B = 0

no change here
***


strobeEL.1.posF.X = 0.4
strobeEL.1.posF.Y = 2.45
strobeEL.1.posF.Z = -0.03
strobeEL.1.posF.dir = 1 //1 = front, 2 = rear, 0 = both
strobeEL.1.posR.X = -0.54
strobeEL.1.posR.Y = -1.77
strobeEL.1.posR.Z = 0.38
strobeEL.1.posR.dir = 2 //1 = front, 2 = rear, 0 = both
strobeEL.1.rgb1.R = 255
strobeEL.1.rgb1.G = 0
strobeEL.1.rgb1.B = 0
strobeEL.1.rgb2.R = 0
strobeEL.1.rgb2.G = 0
strobeEL.1.rgb2.B = 255
strobeEL.1.size = 0.1
strobeEL.1.alpha = 255
strobeEL.1.shadowF.enable = 1
strobeEL.1.shadowF.pos.X = 0.4
strobeEL.1.shadowF.pos.Y = 4.4
strobeEL.1.shadowR.enable = 1
strobeEL.1.shadowR.pos.X = -0.7
strobeEL.1.shadowR.pos.Y = -5.5
strobeEL.1.shadow.rgb1.R = 80
strobeEL.1.shadow.rgb1.G = 0
strobeEL.1.shadow.rgb1.B = 0
strobeEL.1.shadow.rgb2.R = 0
strobeEL.1.shadow.rgb2.G = 0
strobeEL.1.shadow.rgb2.B = 80
strobeEL.1.shadow.size = 1.8

here you can see the new .dir option and the shadow enable/disable lines for front and rear.
***


strobeEL.2.posF.X = 0.06
strobeEL.2.posF.Y = 0.4
strobeEL.2.posF.Z = 0.68
strobeEL.2.posF.dir = 1 //1 = front, 2 = rear, 0 = both
strobeEL.2.posR.X = 0.62
strobeEL.2.posR.Y = -1.4
strobeEL.2.posR.Z = 0.6
strobeEL.2.posR.dir = 2 //1 = front, 2 = rear, 0 = both
strobeEL.2.rgb1.R = 255
strobeEL.2.rgb1.G = 0
strobeEL.2.rgb1.B = 0
strobeEL.2.rgb2.R = 0
strobeEL.2.rgb2.G = 0
strobeEL.2.rgb2.B = 255
strobeEL.2.size = 0.1
strobeEL.2.alpha = 255

here you can see the new .dir option too. Also you can see I left out shadow lines because I didn't wanted light shadows for this light
***


strobeEL.3.posF.X = -0.7
strobeEL.3.posF.Y = 2.43
strobeEL.3.posF.Z = -0.04
strobeEL.3.posF.dir = 1 //1 = front, 2 = rear, 0 = both
strobeEL.3.posR.X = 0.75
strobeEL.3.posR.Y = -2.8
strobeEL.3.posR.Z = 0.03
strobeEL.3.posR.dir = 2 //1 = front, 2 = rear, 0 = both
strobeEL.3.rgb1.R = 255
strobeEL.3.rgb1.G = 255
strobeEL.3.rgb1.B = 255
strobeEL.3.rgb2.R = 255
strobeEL.3.rgb2.G = 255
strobeEL.3.rgb2.B = 255
strobeEL.3.size = 0.5
strobeEL.3.alpha = 150
strobeEL.3.shadowF.enable = 1
strobeEL.3.shadowF.pos.X = -0.7
strobeEL.3.shadowF.pos.Y = 4.0
strobeEL.3.shadowR.enable = 1
strobeEL.3.shadowR.pos.X = 0.7
strobeEL.3.shadowR.pos.Y = -4.0
strobeEL.3.shadow.rgb1.R = 40
strobeEL.3.shadow.rgb1.G = 40
strobeEL.3.shadow.rgb1.B = 40
strobeEL.3.shadow.rgb2.R = 40
strobeEL.3.shadow.rgb2.G = 40
strobeEL.3.shadow.rgb2.B = 40
strobeEL.3.shadow.size = 1.1

same as strobe 1
***


advisorEL.pos.Y = -1.77
advisorEL.pos.Z = 0.38
advisorEL.dir = 2 //1 = front, 2 = rear, 0 = both
advisorEL.space.X = 0.12
advisorEL.alpha = 255
advisorEL.rgb.R = 255
advisorEL.rgb.G = 166
advisorEL.rgb.B = 0
advisorEL.size = 0.06

you can specify the advisor direction, so it will not visible from all view if you want (good if you want the advisor on the roof)

also I removed all shadow Z values, they don't need anymore.

Wizzer

Quote from: nyolc8 on February 26, 2015, 20:46
strobelight1 has got the "shadow corrector" fully, tested, works nicely :P, now 3 other lights to go... :D

edit: shadow correction implemented for all lights :P
Can't wait to see more progress :like:
Keep up the great work!
[hide=Steam]
[hide=stats]
Quote from: a ban appealWhat actually was happening:
lv was fleeing police and suddenly porqe not sack me and went back inside and did not let me
Quote from: Sorin on May 14, 2015, 19:23
Quote from: Emily on May 14, 2015, 19:04
Quote from: asjhfbisyadfb69 on May 14, 2015, 16:50
So many people from romania lol
no wonder everyone asks for help
:ukiddn:
Quote from: asjhfbisyadfb69 on May 15, 2015, 12:37
The other day I got rammed so hard against the wall my vehicle jumped in the hair and went from perfect to broken wtf.

Quote from: Guest on June 02, 2015, 20:36
Good afternoon some time ago stopped playing Samp personal problems recently reopened it and I appeared Banding not know why I really seems unfair that I Page Broken Dishes Another's hope I solve the problem Regards
Quote from: StrangerWizzer has 6 letters, 6 is our first number, there are 2 z, 2 is our second number, 6-2=4. 4 is our third number, your rest of your name letters are not doubled, 1 is our forth number, 4-1=3. A triangle was 3 thingy things. iluminati is triangle, Wizzer = iluminati comfirmed.
Joci [06 Jun 20:12]:   We need an admin hacker online -.-

BeastyBill88

Quote from: Wizzer on February 26, 2015, 21:21
Quote from: nyolc8 on February 26, 2015, 20:46
strobelight1 has got the "shadow corrector" fully, tested, works nicely :P, now 3 other lights to go... :D

edit: shadow correction implemented for all lights :P
Can't wait to see more progress :like:
Keep up the great work!

Agreed! The progress, Nyolc8 has made on this is fantastic! I can't wait to see what else you have up your sleeves.

nyolc8

coronas size changing preview again, shadows staying with car when going, also made custom shadow texture for strobe lights too (in the previous video, I just used the texture from imvehft as placeholder), changed corona for strobe3 (uses the same corona as headlight, useful for "fake" headlight blinker as I did in the example)
Oh and status icon working as before :P



Now the keys are like this:
G = main EL
H = siren (sound)
J = strobe lights (U = 1st, I = 2nd, O = 3rd  - to control them seperately)
K = advisor lights
L = advisor mode

I'll look into the spotlight thing, and after that, new version coming... :)

BeastyBill88

Fantastic work Nyolc8! So with the direction for the strobe lights. If we have it set to 1 (front) we can only see the lights from the front of the car? and the likewise for the rear? Also I'm assuming we can still edit it as we can now? by tabbing out, changing a setting, saving and going back into the game.

I was wondering will there be a limit on how many lights we can add? Also in future versions will be able to change the speed of the lights or make our own flash patterns maybe?

I am very impressed with what you have managed to do with this mod. I really am! I can't wait for the next version to be released so I can put many many lights on my vehicles ;) lol.

Thanks for all the hard work you have been putting into your mods Nyolc8, not to blow smoke up your arse, but your definitely at the top of my list of SA mods.

PS. The spotlight would be amazing if you are able to make the light illuminate where the camera is looking. I think I might need to start using the keypad for all of the light buttons ;) lol.

nyolc8

Yes if you set it to 1 then it will be visible only when viewing the car from front. And yes, you can change it while game running.

The numbers of lights are static, there is the main emergency light set, 3 strobe sets (4 light corona for each set) and the advisor light set.


Some test with spotlight:
[imgur]http://imgur.com/a/erFRy#0[/imgur]

problems with it:
- samp only allows one searchlight to be moving, so lighthouse script blocks it out
- very, I mean VERY buggy when I move it with mouse, it glitches at some angles
- it's have that huge lightcorona when you look into the lights which can't be lowered

so don't expect spotlight soon... atleast not with this method.