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

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

nyolc8

This is really hard to do... I working on this for about 2 hours now, and only wrote the code for storing mainEL and strobe 1 colors and coordinates... strobe 2 and strobe 3 still left... (I won't make advisor) And then I'll need to wrote the codes to read these in the loop cycle which will actually create the lights... ><
And then the other thread which will blink the lights.... f*ck >< :D

But theoretically, it will work... I hope xd

nyolc8



edit: now all three strobe lights + mainEL coronas being draw, even dynamic corona sizing works (smaller corona based on view angle), mainEL light shadow works, strobe light shadows not yet.

todo:
- light shadows
- blinking(this will be tricky, not yet sure how to make it)
- only start thread for car which is in the vehicles.ini and also have default siren turned off, and not driven by player, and not empty.

BeastyBill88

Quote from: nyolc8 on March 25, 2015, 14:17

- only start thread for car which is in the vehicles.ini and also have default siren turned off, and not driven by player, and not empty.

So is could eventually might work on AI vehicles? If only the script worked in SP aswell :D

nyolc8

I making this for AI and other players on SAMP who enable siren on their vehicles. The controllable lights will still only work for one vehicle.

Btw light shadows now working, only need to mem-patch custom texture into it. Also I'm not implementing my shadow lagg fix because that would need thread for all lights (like how it is for controlabble lights).

edit: now shadows patched with custom texture, but now it crashes with some cars... have no idea why...

Hakan

Hello nyolc8, this is not the topic sorry but i have question can you make a file for Petro you did make? i want to drive petro as roadtrain replace but when i'm importing and i look in game the textures are white?




BeastyBill88

Did you also import and replace the Roadtrain txd with the Tanker txd file?

nyolc8

if you know this is wrong topic then why you posted here? ::) send pm about that.

***

finally made the light shadows, it was just a wrong offset in memory...
(lights are too bright because their transparency is not yet controlled, this is what the blinker section will handle)

[imgur]http://imgur.com/a/Jpl9B#0[/imgur]


BeastyBill88

Excellent progress :) does it cause much lag with all of the lights? I think when its all working complete it will definitely be a replacement for ELM/ELS.

Also if you plan to make it work on AI vehicles, would you be able to find out what causes it to crash on the SP loading bar? As this would be amazing to use in SP with SAPD:FR.

nyolc8

I did not noticed any lag yet. Well, if my SP will load without crashing, then I'll try to make it work with that. But without SP (to test), I can't do anything with it.

mainEL light coronas blinking, fuckyeah :D

BeastyBill88

Nice :D ah well if you can't load SP then just for SAMP will be alright at least we will get to see it on other vehicles :D

Nice one! Will the lights be on all the time or only when the siren is turned on? So parked vehicles won't have the lights on. Or something like that lol.

nyolc8

I'll make a check, and lights will only there when:
- car has siren on
- car has configuration in vehicles.ini
- car default emergenc light is not disabled
- car is not driven by player (so yourself)
- car is driven by somebody else (so, not empty)

Marccc

Is it possible to disable the original lights from the police bike?


I added this:
HPV1000.disableDefaultEL = 1   // disable default emergency light - HPV 1000
in emergency.ini but i still see the original lights.

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]

Hakan

Quote from: BeastyBill88 on March 25, 2015, 19:28
Did you also import and replace the Roadtrain txd with the Tanker txd file?

Beastybill how can i do that?

Quote from: nyolc8 on March 25, 2015, 19:30
if you know this is wrong topic then why you posted here? ::) send pm about that.

***

finally made the light shadows, it was just a wrong offset in memory...
(lights are too bright because their transparency is not yet controlled, this is what the blinker section will handle)

[imgur]http://imgur.com/a/Jpl9B#0[/imgur]



Sorry nyolc8 but there is not topic about the Tanker truck that you made  :-[

nyolc8

Quote from: Marccc on March 25, 2015, 21:16
Is it possible to disable the original lights from the police bike?


I added this:
HPV1000.disableDefaultEL = 1   // disable default emergency light - HPV 1000
in emergency.ini but i still see the original lights.
It's not work like that, those lines in the ini file are just "switches" for complicated memory writings.

The problem is, I couldn't find the memory address for hpv bike lights, to overwrite it. But if I'll find it, I'll implement that too.

BeastyBill88

Quote from: Hakan on March 25, 2015, 21:22
Quote from: BeastyBill88 on March 25, 2015, 19:28
Did you also import and replace the Roadtrain txd with the Tanker txd file?

Beastybill how can i do that?

You do it the same way you replaced the Roadtrain.dff Just replace the Roadtrain.txd with Petro.txd and it should fix the textures.