juicermv / GTA-GPS-Redux

A complete GPS mod for Grand Theft Auto San Andreas
20 stars 3 forks source link

Pickups don't have nav routes. #1

Open juicermv opened 2 years ago

juicermv commented 2 years ago

At the moment, pickups do not have nav routes because their coords are a little messed up. Working on a fix.

juicermv commented 2 years ago

Couldn't manage to fix it. Help would be appreciated.

AndroidModLoader commented 1 year ago

Still trying to understand what's gone wrong for you. Probably you decompressed coordinates wrongly: https://github.com/AndroidModLoader/GTASA_GPS/commit/2a456341e4867a916db7745b8f0d60ec297b05d7

juicermv commented 1 year ago

That might be the issue. I'll try that out, thanks.

AndroidModLoader commented 1 year ago

Let me know later

juicermv commented 1 year ago

Where is the function UncompressLargeVector declared in the code sample you sent? I'm trying to find whether there's a plugin sdk equivalent

juicermv commented 1 year ago

What I've tried doing up until this point is find the pickup via first getting the blip trace's object (parsing the handle into a function under CPools) and then use a function in CPickups that gets an object's pickup. I then get the pickups (uncompressed) position using GetPosn(). The issue is that the position returned is completely wrong. I've also tried manually decompressing the position via getting the m_vecPos of the pickup which does return a compressed vector. I then decompress it using uncompress(destVec). This also returns broken coordinates. For reference I'm testing this in Burning Desire.

AndroidModLoader commented 1 year ago

Compressing is done simply by dividing float value. Large vector is 128-divided.

AndroidModLoader commented 1 year ago

I'm not even using plugin-sdk because im working with a Mobile version of the game

juicermv commented 1 year ago

Compressing is done simply by dividing float value. Large vector is 128-divided.

Either way something is wrong with the coordinates compressed or not. Idk what to do here at this point.

RusJJ commented 1 year ago
inline CVector UncompressLargeVector(const CompressedVector& compressedVec) {
    return { static_cast<float>(compressedVec.x) / 8.0f, static_cast<float>(compressedVec.y) / 8.0f, static_cast<float>(compressedVec.z) / 8.0f };
}
RusJJ commented 1 year ago

Sorry, i told you about 128... That was 8, oops.

juicermv commented 1 year ago
inline CVector UncompressLargeVector(const CompressedVector& compressedVec) {
    return { static_cast<float>(compressedVec.x) / 8.0f, static_cast<float>(compressedVec.y) / 8.0f, static_cast<float>(compressedVec.z) / 8.0f };
}

Might try this later but doubt this will help sadly as pluginSDK has built in compressed vector decompression implemented and I've tried to no avail. Thanks for taking the time to help so far though.

RusJJ commented 1 year ago

You can just write your own decompressor for that. Probably you can just do this (im sure every structure value is public):

CVector pos = CVector((float)compvec.x, (float)compvec.y, (float)compvec.z) / 8.0f;

Just give it a try, should work

juicermv commented 1 year ago

Yeah I'll try it out when I find the time thanks.

RusJJ commented 8 months ago

Are you alive, lol?

juicermv commented 7 months ago

Been busy lol. I don't think it's an issue with the decompressed coordinates. I'll try to see if the issue still persists after recent my recent changes.

RusJJ commented 7 months ago

Im 100% sure you used the wrong decompress function.

juicermv commented 6 months ago

The compressed vector class literally has a decompress function. That's what I used.

RusJJ commented 6 months ago

The compressed vector class literally has a decompress function. That's what I used.

It has multiple functions if you still dont understand

juicermv commented 6 months ago

Screenshot_20240307_125551_GitHub.png

No?

RusJJ commented 6 months ago

Use this: https://github.com/juicermv/GTA-GPS-Redux/issues/1#issuecomment-1467330958

juicermv commented 6 months ago

This is literally the function man... image

RusJJ commented 6 months ago

Check your code then

juicermv commented 6 months ago

My guy I think it's fair at this point to just admit you have no idea what you're talking about instead of trying to put the blame on me

RusJJ commented 6 months ago

My guy I think it's fair at this point to just admit you have no idea what you're talking about instead of trying to put the blame on me

I have it working for a year on mobile.

juicermv commented 6 months ago

The mobile version is a completely different codebase and engine

RusJJ commented 5 months ago

You don't know a lot about it.