logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline AndreiH  
#1 Posted : Sunday, January 3, 2016 8:07:03 PM(UTC)
AndreiH


Rank: Member

Groups: Registered
Joined: 12/9/2015(UTC)
Posts: 21
Man
Romania

RAGE Plugin Hook Version: 0.32.839.6212 ALPHA
Game Version: 573

Issue: When getting the Vehicle.PearlescentColor property, the value isn't correct.

Code:
Code:
Color pearlescentColor = vehicle.PearlescentColor;


Description: I am trying to save vehicle data to disk by serializing a special class which implements certain key properties of the Vehicle class, without it actually inheriting the Vehicle class. Getting and saving the primary and secondary colours works perfectly, but the pearlescent colour does not. The value recorded seems to be quite random, but once it's saved to disk, it's always the same, meaning that the serialization part works fine.

UPDATE #1: When trying to use
Code:
NativeFunction.CallByName<uint>("GET_VEHICLE_EXTRA_COLOURS", m_Vehicle, new IntPtr(pearlescentColor), new IntPtr(wheelColor));

the game crashes completely.
Link to the crash report

Edited by user Sunday, January 3, 2016 8:27:52 PM(UTC)  | Reason: Not specified

Offline AndreiH  
#2 Posted : Friday, January 8, 2016 3:03:37 PM(UTC)
AndreiH


Rank: Member

Groups: Registered
Joined: 12/9/2015(UTC)
Posts: 21
Man
Romania

Bump.
Offline alexguirre  
#3 Posted : Friday, January 8, 2016 7:12:45 PM(UTC)
alexguirre


Rank: Member

Groups: Registered
Joined: 6/17/2015(UTC)
Posts: 87
Spain

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: AndreiH Go to Quoted Post

UPDATE #1: When trying to use
Code:
NativeFunction.CallByName<uint>("GET_VEHICLE_EXTRA_COLOURS", m_Vehicle, new IntPtr(pearlescentColor), new IntPtr(wheelColor));

the game crashes completely.


This how I use that native and it works:
Code:

int pearlescentColor, wheelColor;
unsafe { NativeFunction.CallByName<uint>("GET_VEHICLE_EXTRA_COLOURS", vehicle, &pearlescentColor, &wheelColor); }

Note the & symbol and the unsafe keyword
The values returned are color indexes, here is a list with most indexes: http://pastebin.com/pwHci0xK

Vehicle.PearlescentColor doesn't work correctly for me either.
Offline AndreiH  
#4 Posted : Saturday, January 9, 2016 3:07:36 PM(UTC)
AndreiH


Rank: Member

Groups: Registered
Joined: 12/9/2015(UTC)
Posts: 21
Man
Romania

Originally Posted by: alexguirre Go to Quoted Post
This how I use that native and it works:
Code:

int pearlescentColor, wheelColor;
unsafe { NativeFunction.CallByName<uint>("GET_VEHICLE_EXTRA_COLOURS", vehicle, &pearlescentColor, &wheelColor); }

Note the & symbol and the unsafe keyword
The values returned are color indexes, here is a list with most indexes: http://pastebin.com/pwHci0xK

Vehicle.PearlescentColor doesn't work correctly for me either.


Thank you very much Alex!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.