Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Research/WIP] Custom Light Patterns through carcols.ymt

Featured Replies

  • Popular Post

Hey all,

Recently the OpenIV team has made the carcols.ymt file available as an XML file which allows editing. Big thanks to them for that as this is what makes this project possible. You can find the carcols.xml here: https://www.gta5-mods.com/tools/carcols-ymt-converted-into-xml-format

 

Anyways on to the meat of it. The carcols is where all vehicle sirensettings are configured. Vehicle developers are probably familiar with this and most, but not all, vehicles currently released have been configured to work with sirensettings 1. Looking in the carcols we can see exactly where siren setting 1 is configured and learn about the structure of sirens. This is a shortened portion of the configuration for siren setting 1:

Spoiler

<Item>
      <id value="1"/>
      <name>police/sheriff</name>
      <timeMultiplier value="1.00000000"/>
      <lightFalloffMax value="10.00000000"/>
      <lightFalloffExponent value="10.00000000"/>
      <lightInnerConeAngle value="2.29061000"/>
      <lightOuterConeAngle value="70.00000000"/>
      <lightOffset value="0.00000000"/>
      <textureName>VehicleLight_sirenlight</textureName>
      <sequencerBpm value="220"/>
      <leftHeadLight>
        <sequencer value="0"/>
      </leftHeadLight>
      <rightHeadLight>
        <sequencer value="0"/>
      </rightHeadLight>
      <leftTailLight>
        <sequencer value="1431655765"/>
      </leftTailLight>
      <rightTailLight>
        <sequencer value="2863311530"/>
      </rightTailLight>
      <leftHeadLightMultiples value="1"/>
      <rightHeadLightMultiples value="1"/>
      <leftTailLightMultiples value="2"/>
      <rightTailLightMultiples value="2"/>
      <useRealLights value="true"/>
      <sirens>
        <Item>
          <rotation>
            <delta value="0.00000000"/>
            <start value="0.00000000"/>
            <speed value="3.00000000"/>
            <sequencer value="4294967295"/>
            <multiples value="1"/>
            <direction value="false"/>
            <syncToBpm value="true"/>
          </rotation>
          <flashiness>
            <delta value="1.57079600"/>
            <start value="4.71238900"/>
            <speed value="1.00000000"/>
            <sequencer value="1431655765"/>
            <multiples value="2"/>
            <direction value="true"/>
            <syncToBpm value="true"/>
          </flashiness>
          <corona>
            <intensity value="50.00000000"/>
            <size value="1.10000000"/>
            <pull value="0.20000000"/>
            <faceCamera value="false"/>
          </corona>
          <color value="0xFFFF0300"/>
          <intensity value="0.50000000"/>
          <lightGroup value="0"/>
          <rotate value="false"/>
          <scale value="true"/>
          <scaleFactor value="2"/>
          <flash value="true"/>
          <light value="true"/>
          <spotLight value="true"/>
          <castShadows value="false"/>
        </Item>
      </sirens>
    </Item>

 

The full xml contains definitions for all 20 siren elements in order, but I have removed sirens 2-20 for the sake of making it easier to read. So far, here is what I have learned:

  • The game engine caps the maximum number of sirens at 20 per sirensetting.
  • Custom sirensettings can be added to the file and used.
  • Corona colors and intensity can be edited for each individual siren (format for color: AARRGGBB). They can also be removed completely.
  • Each individual siren can have it's own individual flash pattern (and these can be user created, not just selected from a list)
  • Headlight and taillight flashing can be configured with custom flash patterns - one user has already released a modification that enables headlight flashing.
  • You can set the number of "beats" per minute that the lights will flash using sequencerBPM value. This value will apply to all of the sirens for that specific sirensetting.
  • You can set individual sirens to be rotating or non-rotating and configure their speeds.

 

So far I have not done any work with rotating lights. For non-rotating lights, the flash pattern can be custom configured by editing the sequencer value under "flashiness" for each siren. In the snippet of code posted above, the siren uses the following configuration:

<sequencer value="1431655765"/>

At first glance it looks to be just a random number. This is actually a 32-bit integer, and when you view it in binary, the flash pattern becomes clear:

01010101010101010101010101010101

So this siren uses a simple alternating flash pattern - off, on, off, on, off, on, etc. These can be configured to create new and far more complex flash patterns than are currently in the game. Along with increasing the sequencer beats per minute you can create some neat stuff.

 

Here is a (very quickly) thrown together demo to showcase possible patterns. This vehicle uses 6 sirens: two for all the red and blue lights, two for the traffic advisor (which is an extra), and two for the headlight strobes. The headlight strobe coronas have been modified to be white and the vehicle uses a completely custom sirensetting. The pattern for the red and blue lights has been customized for alternating speeds.

 

Again, this is just rough stages of research so far, but I wanted to share what I had found with the community. Hopefully this will be useful for vehicle developers in designing cars which are non-ELS but offer similar levels of functionality. I will be updating this thread with further research as I discover new things.

 

Thanks for reading and happy modding!

  • Replies 596
  • Views 185.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • We've been busy working on patterns per vehicle (no longer limited to per model) as well as giving you the ability to change them at runtime. Soon in RAGE Plugin Hook. Some background info: http://blo

  • testing messages board using 3 siren nodes:  

  • Deactivated Member
    Deactivated Member

    I've made a carcols a while back that just seems to work really well on pretty much any car you throw it on. Here's a demo of it on my Kansas cars, no edits were done to the cars.  If a

Posted Images

This is actually really neat, having the ability to change/create patterns via a simple text change is truly amazing. If this does become fruitful and a script like the ELS pattern changer could be made to read the file and maybe even have the ability to change patterns while in game (like a plugin) could create virtually unlimited possibilities for everyone. And also maybe render ELS obsolete as then the only feature it would have over default lighting is the ability to change siren tones (which I'm sure a script could be written to do as well).

I do look forward to more info on your research! 

To go along with HankVoight, i'd have to think that it would also be much more stable.. Instead of extras rapidly firing, using rockstars script would probably be better. (Tbh I'm not too sure how stable ELSV is, it could be perfect and I wouldn't know, just making an assumption). 

That is so COOL! I still can't believe that we're finding things out about this game even after it's been out for a good while. I really enjoy that custom headlight strobe pattern on the Explorer! 

Edited by purplepotatoes14

"Please, put it in park, will ya?" "LSPD, see the lights, pullover." "Stop the vehicle, we need to have a little chat!" "Get in the car and keep your mouth shut." "You have the right to absolutely nothing." "The damn gun is jammed!"

  • Author
20 minutes ago, DroidRZRLover said:

Will it be possible to replicate this

 

https://youtu.be/YgXOTlhnWFw

Yes absolutely. You can create any flash pattern with 32 flashes per cycle and they can be applied to the headlights, taillights, or any individual siren.

 

@Desmond98 I would be happy to help you with configuring an ultra realistic pattern for your upcoming explorer! 

Edited by Captain14

11 minutes ago, Captain14 said:

Yes absolutely. You can create any flash pattern with 32 flashes per cycle and they can be applied to the headlights, taillights, or any individual siren.

 

@Desmond98 I would be happy to help you with configuring an ultra realistic pattern for your upcoming explorer! 

Desmond98 and I are working together

We will gladly accept the ultra realistic flash pattern

  • Author
43 minutes ago, royalx7 said:

To go along with HankVoight, i'd have to think that it would also be much more stable.. Instead of extras rapidly firing, using rockstars script would probably be better. (Tbh I'm not too sure how stable ELSV is, it could be perfect and I wouldn't know, just making an assumption). 

I'm certain ELS will be stable (at least much more so than the IV version) but as with any added plugin you will have crashes. As this uses the built-in system for lighting it will be more stable, but as another user has noted this does not offer the ability to change siren tones like ELS does.

Today is a good day. So if I have a custom ambulance model installed, I can edit the file above and use custom flash patterns for the ambulance model ? Or does it require model editing as well in order to load the custom patterns ?

Edited by GravelRoadCop

SmsqmYF.png

 

 

2 minutes ago, Jakeus said:

From what I gather @GravelRoadCop it's simply editing the carcols.ymt file, no vehicle modeling required.

Time to have a play!  Be interesting to see what everyone comes up with!

To be honest, I had to do a double-take on this because it seemed too good to be true ! How fascinating, I think I'm gonna dive into this and see what I can make !

SmsqmYF.png

 

 

  • Author
1 hour ago, GravelRoadCop said:

To be honest, I had to do a double-take on this because it seemed too good to be true ! How fascinating, I think I'm gonna dive into this and see what I can make !

It's entirely in the carcols file. You can create extra siren settings to apply to an individual custom model if you would like to.

I look forward to some kind of tutorial explaining the steps. @Captain14 first post is a nice start. Also, how did you see that number sequence. I still don't see 010101, etc That sound like some Dr. Harry Adams (Samuel L. Jackson's character in the movie Sphere) type skills. :D

MSI MPG Z490 GAMING EDGE WIFI, Core™ i7-10700 8-Core 2.9 - 4.8GHz Turbo, MSI GeForce RTX™ 2070 TRI FROZR, 16GB Kit (2 x 8GB) HyperX FURY DDR4 2666MHz, 500GB Black SN750 2280 M.2 SSD, 1TB MX500 7mm, 560 SSD

14 hours ago, HankVoight said:

This is actually really neat, having the ability to change/create patterns via a simple text change is truly amazing. If this does become fruitful and a script like the ELS pattern changer could be made to read the file and maybe even have the ability to change patterns while in game (like a plugin) could create virtually unlimited possibilities for everyone. And also maybe render ELS obsolete as then the only feature it would have over default lighting is the ability to change siren tones (which I'm sure a script could be written to do as well).

I do look forward to more info on your research! 

Possibly RIP ELS, all that time for nothing, kek.

But on a serious note, good thread.

The ENV can also be greatly effected by altering these lines.

<lightFalloffMax value="55.60000000"/>
      <lightFalloffExponent value="10.00000000"/>
      <lightInnerConeAngle value="0.00000000"/>
      <lightOuterConeAngle value="25.60130000"/>

As far as I've tested, you can do whatever you want. I'm sure if this is tweaked enough for all the sirens, we could have a great mix of ELS enhancers! I recommend doing some small research on light falloff exponent values and falloff to get a better understanding of what you're editing.

Edited by densup

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Similar Content

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.