CLEO Help 00AB: put_car 0@ at xyz question

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I noticed that when I use this opcode in order to place the car at specific coordinates it's placed a bit higher and falls to the ground. I'd like to avoid falling and put it in the right place straight away by subtracting something from "Z" axis. Do you know what is the exact difference between the Z axis value typed in "00AB: put_car 0@ at" and the actual position of the car before it falls on the ground?
 

HenryTeylor

Active member
Joined
Sep 13, 2014
Messages
33
Reaction score
0
monday link said:
I noticed that when I use this opcode in order to place the car at specific coordinates it's placed a bit higher and falls to the ground. I'd like to avoid falling and put it in the right place straight away by subtracting something from "Z" axis. Do you know what is the exact difference between the Z axis value typed in "00AB: put_car 0@ at" and the actual position of the car before it falls on the ground?

Car.StorePos(0@, 1@, 2@, 3@)
02CE: 16@ = ground_z_at 1@ 2@ 3@
16@ += 1
Car.PutAt(0@, 1@, 2@, 16@)
 

DzkAy

Well-known member
Joined
Feb 20, 2014
Messages
472
Reaction score
1
0407: store_coords_to 12@ 13@ 14@ from_car $Car with_offset -0.0 0.0 -1.0
0400: store_coords_to 20@ 21@ 22@ from_object $Object with_offset 0.0 0.0 -1.0
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -1.0

Or just use those opcodes to save coords with offset.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
That happens at all kind of teleporting. I think it avoids actors/cars to get under the map.
If you still want to get teleported exactly on the ground, lower Z with 1.0.
Code:
000F: 4@ -= 1.0
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
0AB1: @teleport_to_point 3 X_coord 0@ Y_coord 1@ Z_coord 2@
Code:
:teleport_to_point
if 00DF:   actor $PLAYER_ACTOR driving
then
    03C0: 4@ = actor $PLAYER_ACTOR car
    0A97: 3@ = car 4@ struct
    000A: 3@ += 20
    0A8D: 3@ = read_memory 3@ size 4 virtual_protect 0
    000A: 3@ += 48
    0A8C: write_memory 3@ size 4 value 0@ virtual_protect 0
    000A: 3@ += 4
    0A8C: write_memory 3@ size 4 value 1@ virtual_protect 0
    000A: 3@ += 4
    0A8C: write_memory 3@ size 4 value 2@ virtual_protect 0
else
    0A96: 3@ = actor $PLAYER_ACTOR struct
    000A: 3@ += 20
    0A8D: 3@ = read_memory 3@ size 4 virtual_protect 0
    000A: 3@ += 48
    0A8C: write_memory 3@ size 4 value 0@ virtual_protect 0
    000A: 3@ += 4
    0A8C: write_memory 3@ size 4 value 1@ virtual_protect 0
    000A: 3@ += 4
    0A8C: write_memory 3@ size 4 value 2@ virtual_protect 0
end
0AB2: ret 0
 
Status
Not open for further replies.
Top