CLEO Help Getting and Setting a Vehicles XYZ Velocity

CLEO related
Status
Not open for further replies.

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
I know we can get velocity, but how do we set the vehicles XYZ velocity? I know how to speed the vehicle forward, but I can't find an opcode to set all axis velocity...

Ex:
Get vehicles velocity into 0@, 1@, 2@
if or
none of the velocities are over 2x max speed of that vehicle
none of the velocities are less than -2x max speed of that vehicle
then
Set vehicles velocity to (1.1*0@), (1.1*1@), (1.1*2@)
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Why not, but what's the point? If you're going to manually set max-speed value per each model then it doesn't make any difference if you use "0441: 1@ = car 0@ model" or if you'll loop through every model to find it because you'll have to make a lot of conditions or a table(?) anyway

Or there's any other aim behind looping through every model?

Edit: *if you use "0441: 1@ = car 0@ model" + "0811: 0@ = actor $PLAYER_ACTOR used_car"
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599E-3)

0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x84 SIZE 4 _TO: 0@

0@ *= 5.55555

0@ = max_velocity. ( i think)
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I tried it before and the value of 0@ was around 0.9 -- 1.1 so multiplied by 5.555... wouldn't give the max speed in kmph

Edit: it actually does but not in kmph, i'm an idiot;d
 

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
monday link said:
Why not, but what's the point? If you're going to manually set max-speed value per each model then it doesn't make any difference if you use "0441: 1@ = car 0@ model" or if you'll loop through every model to find it because you'll have to make a lot of conditions or a table(?) anyway

Or there's any other aim behind looping through every model?

Edit: *if you use "0441: 1@ = car 0@ model" + "0811: 0@ = actor $PLAYER_ACTOR used_car"

Im not setting the max speed of anything, im going to be pushing a car faster, but not over 2*maxspeed
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
By "setting max speed" I meant manual input of default max speed per each model into your script, not changing the value by itself. It looks like Opcode's way does the thing so nevermind
 

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
oh now i see what you mean, instead of looping to find the cars model id just use that opcode and the players vehicle id... After getting the model, replace "#SULTAN" in opcode.exe's example using his snippets, use the returned value as the max speed... right? anyways I'll try it tomorrow, I'm in bed already, on my phone right now....
Opcode.eXe link said:
0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599E-3)

0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x84 SIZE 4 _TO: 0@

0@ *= 5.55555
 
Status
Not open for further replies.
Top