Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

H3RB4LS

[Q] Neon Colors On/Off & RGB?

Recommended Posts

H3RB4LS

Hello, fairly new to all this modding and coding stuff but I've done quite a bit of research on the Natives and Script Hook. I've figured out how to modify the Native Trainer successfully so I'm trying to add my own personal options/mods to it now. At the moment, I'm just trying to figure out the Neon lights (both the R,G,B and on/off). I understand obviously the values for RGB, yet still unclear to the first Vehicle parameter (is this the vehicle hash? or can you set it to the current vehicle? Im sure you can Im just very new to coding. I'm still unsure of the values to change for the on & off switch as well because I must be doing something wrong when it's telling me that _SET_VEHICLE_NEON_LIGHTS_ON doesn't belong to VEHICLE, I've tried multiple variations of things so any info would be helpful. Thanks for your time.

 

BWQRP4L.jpg

 

And unless I'm missing something?

 

xLEKJnz.png

 

Any direction on making an 'RGB' slider for each value would be helpful. But for now, I'd like to just get the light to turn on. If adding any other info would be helpful, let me know. Im not too experienced with this stuff so my bad if Im leaving out something simple lol.

Share this post


Link to post
Share on other sites
BoXz_modder

Hello, fairly new to all this modding and coding stuff but I've done quite a bit of research on the Natives and Script Hook. I've figured out how to modify the Native Trainer successfully so I'm trying to add my own personal options/mods to it now. At the moment, I'm just trying to figure out the Neon lights (both the R,G,B and on/off). I understand obviously the values for RGB, yet still unclear to the first Vehicle parameter (is this the vehicle hash? or can you set it to the current vehicle? Im sure you can Im just very new to coding. I'm still unsure of the values to change for the on & off switch as well because I must be doing something wrong when it's telling me that _SET_VEHICLE_NEON_LIGHTS_ON doesn't belong to VEHICLE, I've tried multiple variations of things so any info would be helpful. Thanks for your time.

 

BWQRP4L.jpg

 

And unless I'm missing something?

 

xLEKJnz.png

 

Any direction on making an 'RGB' slider for each value would be helpful. But for now, I'd like to just get the light to turn on. If adding any other info would be helpful, let me know. Im not too experienced with this stuff so my bad if Im leaving out something simple lol.

 

I'm not sure, but maybe you need to type in the perimeters in your method call??

I don't know C++ that well.

 

Where did you find that documentation? :O

Share this post


Link to post
Share on other sites
H3RB4LS

I realize they're going to need parameters such as the Vehicle VehicleHandle, int, bool. Im just not 100% sure what values I need to place. Obviously one is for vehicle, but what, the specific vehicle ID? or preferably to use the vehicle the PED is in using something like

PED::GET_VEHICLE_PED_IS_USING() for the vehicle. The int parameter is obviously which side of the neon (which gives me plenty of ideas if you can control each individual one, then you should be able to control the color on each individual side, even make animations which you'd have to code obviously).

And then the BOOL value, which I assume is 0 or 1. Im just not sure why it's not registering _SET_VEHICLE_NEON_LIGHTS_ON to the VEHICLE:: class which it clearly is, but maybe because I don't have it defined?? Maybe I have to set the RGB first, or even assure the vehicle HAS the neons equipped (which should be able to be done in script I would assume looking at the vehicle section)Im still a bit hazy but I will figure it out in time.

 

As for the documentation: That info is located on the Native here: http://www.dev-c.com/nativedb/

 

 

 

Edit: Maybe something along these lines here? But it's still telling me they're not part of the VEHICLES::

I suppose I'm doing something wrong, I'm just not sure...
63BPUEi.jpg

Edited by H3RB4LS

Share this post


Link to post
Share on other sites
Inco

SET_VEHICLE_NEON_LIGHTS_COLOUR named as _0x8E0A582209A62695 in natives.h .

SET_VEHICLE_NEON_LIGHTS_ON = _0x2AA720E4287BF269 .

Share this post


Link to post
Share on other sites
H3RB4LS

SET_VEHICLE_NEON_LIGHTS_COLOUR named as _0x8E0A582209A62695 in natives.h .

SET_VEHICLE_NEON_LIGHTS_ON = _0x2AA720E4287BF269 .

 

Ahhhh, so I just had to replace that value with the hash. It seems to be showing up now, thanks a bunch, will continue tweaking with that info...

 

 

8OrpWCg.png

 

 

 

After messing with it a bit, I've seemed to figure out how to "kinda" get it work, but I have to go buy the neons first. So now I to figure out how to set it to the vehicle without purchase, probably in the VEHICLE:: _blahblah_mod somewhere. But this is only a solid change, no toggle as of yet, but progress nonetheless :D

 

e566b921e65445b432df0255ecc00198.png

Edited by H3RB4LS

Share this post


Link to post
Share on other sites
H3RB4LS

So I'm working on figuring out the int location for the neon lights. Such as 0: left 1: right 2: Front 3: back listed on the natives, but it's not turning so straight forward. So far I've tested 0 through 7. Where 0 gave me everything but driver side, 1 gave everything but passenger side, 2 gave me Back & Sides, 3 gave me Front & Sides, 4 and above just changed whichever location I chose. So I tried 0.5 for fun and nothing happened, just the same as 0, but no matter which I pick after, the driver side won't light up. So it's got me thinking more about which sides/locations are which and how to control them....

 

AfnCUg1.jpg

I have F,B,Sides chosen but still, driver side isn't lit, yet passenger is. Just brainstorming...

Share this post


Link to post
Share on other sites
c39687

fyi, when you pass 0.5 into an argument looking for an integer, the compiler casts your 0.5 to int which basically removes everything after the decimal, so the result is 0. ((int)0.999999999) == 0 is true

 

if you want to test values you can write a loop that sets the value and then waits a certain amount of time for you to observe and record what happened. You could even program it to write results to a file if you know what ur doing.

Edited by c39687

Share this post


Link to post
Share on other sites
H3RB4LS

fyi, when you pass 0.5 into an argument looking for an integer, the compiler casts your 0.5 to int which basically removes everything after the decimal, so the result is 0. ((int)0.999999999) == 0 is true

 

if you want to test values you can write a loop that sets the value and then waits a certain amount of time for you to observe and record what happened. You could even program it to write results to a file if you know what ur doing.

 

Thanks for the info, now I understand that a bit. Yea, I'm very new to coding and whatnot but I've just been playing with values to see what does what as a lot of the parameters are still undefined/unknown. Another area I'd like to learn is the vehicle height, which I've modified in the handling.meta and raised and lowered the vehicle. Now, I'm wondering how to use/where to find those values to use in a script/menu say; to lower/raise the vehicle. In time, much to learn.

Share this post


Link to post
Share on other sites
c39687

Well you are going to have to do some research for that. I know you can get model dimensions via native although im not sure how that takes the height of suspension into consideration. Good luck

Share this post


Link to post
Share on other sites
LibertyLocked

It won't light up because

void _SET_VEHICLE_NEON_LIGHTS_ON(Vehicle vehicle, int location, BOOL on)

 

As seen here, the last param is a boolean, and you passed a 0, thus turning it off.

 

Edit: So to turn it on, make sure the last param is 1.

Edited by LibertyLocked

Share this post


Link to post
Share on other sites
sjaak327
VEHICLE::_SET_VEHICLE_NEON_LIGHTS_ON(f, 0, NLeft);					VEHICLE::_SET_VEHICLE_NEON_LIGHTS_ON(f, 1, NRight);					VEHICLE::_SET_VEHICLE_NEON_LIGHTS_ON(f, 2, NFront);					VEHICLE::_SET_VEHICLE_NEON_LIGHTS_ON(f, 3, NBack);					VEHICLE::_SET_VEHICLE_NEON_LIGHTS_COLOUR(f, MenuColors[NeonColor].r, MenuColors[NeonColor].g, MenuColors[NeonColor].b);

where the last parm is a bool, 0 for off, 1 for on

Share this post


Link to post
Share on other sites
H3RB4LS

Thank you both LibertyLocked & sjaak327. I'll test those and see what I can come up with. Your comments are greatly appreciated as this stuff is a bit tricky for newbies. Sometimes the parameters are the hardest part for me. As some bools are -1 & 0 then sometimes they're 0 and 1. Then sometimes I have no idea or the values listed aren't as they seem,etc. So a bit of rest and clearing my head and I'll go back at it in a bit, thanks again.

 

Edit: To LibertyLocked: Changed that and things are gravy, thank you a bunch. (So now Im assuming that 0 is what were turning the lights off. Because the 0, 1 gave me a driver side only on...Yet..a 0, 0 would have the driver side *un*lit while other were on...)That tiny bit of info helped a bunch.

 

Now my next task is to get it to turn off lol. Toggles on just fine, but I'll get it. I might have to throw an featureNeonLightsUpdated so the game doesn't mess with it. Or maybe I just need an 'else' to turn the NEONS off. Probably the latter. Just documenting my steps for this tweak. Thanks to those with information.

Edited by H3RB4LS

Share this post


Link to post
Share on other sites
thewhitehammer99

Thank you both LibertyLocked & sjaak327. I'll test those and see what I can come up with. Your comments are greatly appreciated as this stuff is a bit tricky for newbies. Sometimes the parameters are the hardest part for me. As some bools are -1 & 0 then sometimes they're 0 and 1. Then sometimes I have no idea or the values listed aren't as they seem,etc. So a bit of rest and clearing my head and I'll go back at it in a bit, thanks again.

 

Edit: To LibertyLocked: Changed that and things are gravy, thank you a bunch. (So now Im assuming that 0 is what were turning the lights off. Because the 0, 1 gave me a driver side only on...Yet..a 0, 0 would have the driver side *un*lit while other were on...)That tiny bit of info helped a bunch.

 

Now my next task is to get it to turn off lol. Toggles on just fine, but I'll get it. I might have to throw an featureNeonLightsUpdated so the game doesn't mess with it. Or maybe I just need an 'else' to turn the NEONS off. Probably the latter. Just documenting my steps for this tweak. Thanks to those with information.

to turn it off, just do the exact same as the on function, but change the bool from 0 to 1 :)

Share this post


Link to post
Share on other sites
H3RB4LS

Ahh of course. I haven't got around to messing with it more but I knew it wouldn't be too bad. Gonna get a bit of help with coding and learn a bit more. Thank you for the replies. The information is greatly appreciated.

 

Edit: Thanks, got the switch figured out now. Next step, RGB slider for color select. :D

 

F7kl52v.jpg

 

 

And off :)

 

L4P4aPz.jpg

 

Thanks again for the comments, you all are great :)

Edited by H3RB4LS

Share this post


Link to post
Share on other sites
H3RB4LS

Slight progress, adding in Menus for colors. Now to just add in 0-255 selectable range slider on each value, coming along...

 

fkrp7Hl.jpg

Share this post


Link to post
Share on other sites
Fireboyd78

For future reference, if a native you find on NativeDB is not showing up correctly in Visual Studio, download the latest natives.h file by going to the Downloads tab.

 

By the way, I hope nobody hates me for this, but I changed the names of the natives:

 

void _SET_VEHICLE_NEON_LIGHT_ENABLED(Vehicle vehicle, int location, BOOL toggle) // 2AA720E4287BF269

BOOL _IS_VEHICLE_NEON_LIGHT_ENABLED(Vehicle vehicle, int location) // 8C4B92553E4766A5

Edited by CarLuver69

Share this post


Link to post
Share on other sites
H3RB4LS

For future reference, if a native you find on NativeDB is not showing up correctly in Visual Studio, download the latest natives.h file by going to the Downloads tab.

 

By the way, I hope nobody hates me for this, but I changed the names of the natives:

 

void _SET_VEHICLE_NEON_LIGHT_ENABLED(Vehicle vehicle, int location, BOOL toggle) // 2AA720E4287BF269

BOOL _IS_VEHICLE_NEON_LIGHT_ENABLED(Vehicle vehicle, int location) // 8C4B92553E4766A5

 

Good to know. So if I update my natives.h in the SDK\inc folder, I'll have to update those values I take it? I'm sure it's constantly being updated as for values and parameters that are still unknown. Thanks for the info.

Edited by H3RB4LS

Share this post


Link to post
Share on other sites
H3RB4LS

Success/ Progress:

https://www.youtube.com/watch?v=UNv8rim_cIM

 

So I have the On/Off & Red, Green and Blue selectable. I'm trying to figure out "animations", but the only semi-success I've had was using a for(;;); loop but then I guess I can't even use the menu. I've tried using do while loops but the only success I've had was having it blink once then returning to the trainer menu. So any ideas on that loop deal might be nice. Another question, what's the best way to accomplish "animations" such as being able to loop this:

 

VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 0, 0);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 1, 0);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 2, 0);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 3, 0);
WAIT(500);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 0, 1);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 1, 1);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 2, 1);
VEHICLE::_SET_VEHICLE_NEON_LIGHT_ENABLED(PED::GET_VEHICLE_PED_IS_IN(playerPed, 0), 3, 1);
WAIT(500);

 

Would it be better to create a seperate LUA script and have it access it that way, so the menu (Native Trainer) would continue to function and not have something looping in it?

 

Thanks in advance for anyone who might have info.

Share this post


Link to post
Share on other sites
sjaak327

you need to loop this in tick. Since that trainer orginates from blade's trainer, It is probably called updatefeatures()

Share this post


Link to post
Share on other sites
H3RB4LS

Ahh, I forgot about the Update part..this about what I have so far. But I'll check that out

 

244cbb84df1c450f2f670a884e1c00bc.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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