Jump to content

Turn indicators [CLEO4/SA/REL]


Recommended Posts

Description:

This script allows to use turn indicators while driving automobile or motobike. Coronas are created at positions of headlights and back lights of vehicle, which are calculated automatically. So, you can use this script with all models of automobiles and motobikes, without additional files. If trailer is attached to automobile with enabled turn indicators, it will have enabled turn indicators too.

 

Version 1.1. Indicators work after player exit car until enter another car.

Version 2.0. AI-drivers can use indicators, no CJ only.

Version 2.1. Some bugs were fixed.

 

Installation:

1.Download and install CLEO4 library from cleo.sannybuilder.com.

2.Put file turn_indicators.cs to cleo folder.

 

How to use:

Z - enable left indicators, C - enable right indicators, X - enable all indicators. Press this buttons again to disable indicators (in v.2 disable indicators by Shift button).

 

Script was made for game version 1.0 US. Work with other versions of game is not guaranteed.

Edited by Den_spb
Link to comment
https://gtaforums.com/topic/467004-turn-indicators-cleo4sarel/
Share on other sites

Is it possible to make them blink? Great mod BTW.
Lights must blink. If blinking isn't visible, you can enlarge pause between flashes:
        if           32@ > 1000 // duration of flash + pause between flashes (ms)       then           32@ = 0       end       if           32@ < 500 // duration of flash in ms       then

 

is it work with modded vehicles ?
It works with all vehicles.

Good one! Works pretty well, although indicators mostly are placed in the wrong position - but that's not your fault.

Now it would be cool to see other cars using indicators in traffic - and maybe when both indicators together would still continue flickering when you leave the car.

Nice job, really well done - thanks!

  • 2 weeks later...
  • 2 weeks later...
  • 4 weeks later...
  • 7 months later...

Sonny Red, thanks for opinion. I don't plan add sounds now.

How to change buttons:

1.Put file turn_indicators2.txt into cleo folder

2.Open txt-file by Sanny Builder (File-Open)

3.Change numbers of buttons (90, 88, 67) here

            if                 0AB0:  key_pressed 90 // Z             then                 0_StatusOfPlayerCar = 1_Left               else                 if                     0AB0:  key_pressed 88 // X                 then                     0_StatusOfPlayerCar = 1_Both                   else                     if                         0AB0:  key_pressed 67 // C                     then                         0_StatusOfPlayerCar = 1_Right                     else                         if                             0AB0:  key_pressed 16 // Shift                         then                             0_StatusOfPlayerCar = 0                         end                       end                                      end                      end

Numbers of buttons are in SB Help: Help - Contents - CLEO3 - Virtual key codes 0AB0, column Decimal

4.Compile script after editing (Run-Compile).

 

Darecki, you can change offsets of lights yourself. For example, increase standard X offsets to 1.0 and Z offsets to 0.5:

:Get_lights_coords0A8E: 0_Adress = 0_VehicleStruct + 0x22 // int 0A8D: 0_Adress = read_memory 0_Adress size 2 virtual_protect 0 //model index0_Adress *= 40_Adress += 0xA9B0C80A8D: 0_Adress = read_memory 0_Adress size 4 virtual_protect 0 //CModel0_Adress += 0x5C                                        0A8D: 0_Adress = read_memory 0_Adress size 4 virtual_protect 0 //vehicle struct0A8D: 0_FrontLightX = read_memory 0_Adress size 4 virtual_protect 0 //x offset0_Adress += 40A8D: 0_FrontLightY = read_memory 0_Adress size 4 virtual_protect 0 //y offset0_Adress += 40A8D: 0_FrontLightZ = read_memory 0_Adress size 4 virtual_protect 0 //z offset0_Adress += 40A8D: 0_BackLightX = read_memory 0_Adress size 4 virtual_protect 0 //x offset0_Adress += 40A8D: 0_BackLightY = read_memory 0_Adress size 4 virtual_protect 0 //y offset0_Adress += 40A8D: 0_BackLightZ = read_memory 0_Adress size 4 virtual_protect 0 //z offsetif   0_FrontLightX == 0.0then   0_FrontLightX = 0.15endif   0_BackLightX == 0.0then   0_BackLightX = 0.15end0_FrontLightX += 1.0 // NEW COMMANDS HERE0_BackLightX += 1.00_FrontLightZ += 0.50_BackLightZ += 0.5return

But I think that the variant with standard offsets is the best variant.

It works for me; but sometimes it crashes also. I removed San Andreas Limit Adjuster, and used StreamMemFix instead, and didn't have a crash for over 10 mins ..

 

But..

 

Sometimes, they don't indicate when turning (I guess thats good, not all drivers do LOL)

 

I can see the indicator texture/particle through the car sometimes ..

 

user posted image

 

What particle is the effect based on ? It's quite large on my screen. Maybe make its own particle in particle.txd and make it smaller? So everyone can have the perfect size, but not effect any other particles in the game?

 

 

but sometimes it crashes also.
Script must work without crashes with gta_sa.exe 1.0 US version and v4.1.1.30 CLEO4 version. If you have another versions of game or cleo, I don't guarantee correct work of script.

If you have right versions of game and cleo and game is still crashing, install plugin ScmLog from cleo.sannybuilder.com. File scmlog.txt will be created after crashing - send it me.

 

 

Sometimes, they don't indicate when turning
Indicators enable before begin of turning usually. If indicators enable during turning or don't enable, that means low speed of script working (reasons: very many cars in traffic, many "heavy" modifications were installed, low-power computer...).

 

user posted image

 

 

I can see the indicator texture/particle through the car sometimes ..
No you only. May be, it will be fixed later.

 

 

Maybe make its own particle in particle.txd and make it smaller?
0AA5: 0x6FC580 21 21 1 0 0x41700000 0 0x3FC00000 0 0 0 0 0 attach_corona_flare 0 type 0 0x43160000 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_vehicle_struct 0_VehicleStruct unical_number 0_UnicalNumberOfCorona

 

Here 0.3 is radius of corona. You can change it yourself.

Ok thanks for that ^ ^

 

I found another bug; don't know if this is your scripts fault or not ..

 

But I have the Packer script, that has up to four cars on the Packer; and those vehicles have there indicators going as well lol colgate.gif

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.