#1 22-11-2013 18:43

Hypersonic
Registered: 18-11-2013
Posts: 3

get_Z_angle_for_point only gives whole numbers

get_Z_angle_for_point is basically arctan (given opposite and adjacent determine angle between hypotenuse and adjacent.) I don't see any arccos or arcsin functions.

Problem is that it only returns whole numbers, it omits the fraction, even if it is a float and not an integer. So there is only 360 direction precision, which makes for choppy motion if you try animate using this function. Any chance that this could be changed to not omit the fraction in future versions of Cleo for San Andreas?

On a side note I couldn't even find tan,cos,nor sin in the original 2001 GTA3, let alone atan,acos,asin. I had to make due creating rough approximation pseudo trig functions.

Offline

#2 23-11-2013 00:43

DK22Pac
From: Ukraine
Registered: 26-03-2010
Posts: 447
Website

Re: get_Z_angle_for_point only gives whole numbers

02F6: 14@ = sine 45.0 // (float)
02F7: 13@ = cosine 45.0 // (float)

GTA 3 1.0

05E1: call 0x48CC30 num_params 2 pop 2 _y 0@ _x 1@ // CGeneral::GetAtanOfXY
05F2: 0@ = pop_float // fstp [0@]

GTASA 1.0 US

0AA5: call 0x4207A0 num_params 1 pop 1 _value 0@ // asin
0AE9: pop_float 0@ // fstp [0@]

0AA5: call 0x48DE40 num_params 1 pop 1 _value 0@ // acos
0AE9: pop_float 0@ // fstp [0@]

0AA5: call 0x4207C0 num_params 2 pop 2 _x 0@ _y 1@ // atan2
0AE9: pop_float 0@ // fstp [0@]

Plugin-SDK https://github.com/DK22Pac/plugin-sdk
Discord-сервер по plugin-sdk и программированию в GTA
RU https://discord.gg/QEesDGb
ENG https://discord.gg/zaVqFQv

Offline

#3 23-11-2013 05:04

Hypersonic
Registered: 18-11-2013
Posts: 3

Re: get_Z_angle_for_point only gives whole numbers

Thanks for all the info DK22Pac!

Regarding opcodes 02f6 & 02f7, these are just for VC and SA, correct?
Do you know cos,sin, or tan for GTA3 by chance?
Thanks for atan for GTA3!

Thanks for the info about 0AA5 and 0AE9! Found out what they do on the gtag dot gtagaming dot com site
Interesting, seems like you could program with CLEO just by using a few opcodes, such as
    0AA5 call
    0A8C: write_memory
    0A8D: read_memory
As long as you have a memory map handy.
If you know the start of structures you could easily figure out locations across exe versions as offsets from structure start usually stays the same.

For data memory maps I know gtamodding dot com has some good ones
I haven't come accross any memory maps of functions just yet.

Offline

Board footer

Powered by FluxBB