You'd think after 2+ years of programming in Blitz I'd have seen everything. Well how about this:
PROBLEM 1: POSITIONENTITY.
Setting the start position of a vehicle; ent is a pivot, and _not_ a child of another entity.
My car was nowhere in sight, so I checked the code:
ex = 723 : ey = 9 ; ex = 392
PositionEntity ent, ex,ey,ez
UpdateWorld()
tempex = EntityX(ent)
tempey = EntityY(ent)
tempez = EntityZ(ent)
; tempex returns 127!
; tempey returns 206!
; tempez returns 392!
After 2 days of frustration I wondered what would happen if I immediately repeated the positioning:
PositionEntity ent, ex,ey,ez
UpdateWorld()
tempex = EntityX(ent)
tempey = EntityY(ent)
tempez = EntityZ(ent)
; tempex,y,z now _sometimes_ return 723,9,392 (the correct values).
But not all the time. It's a 50/50 chance that I will get non-accurate values as I step through the second block of code.
So my cars appear up in the air, or away from the racetrack altogether.
This problem happens whether the parent is a pivot or a sphere.
Can anyone help. This feels just plain insane!
PROBLEM 2: POSITIONENTITY.
I now take it for granted that child entities are not going to stay 'attached' to parent entities.
So every loop I have to do 'PositionEntity car,0,0,0' to 'remind' Blitz to re-attach the child to the parent pivot accurately, or else the car drives along the side of the road, while the pivot drives down the middle.
PROBLEM 1: POSITIONENTITY.
Setting the start position of a vehicle; ent is a pivot, and _not_ a child of another entity.
My car was nowhere in sight, so I checked the code:
ex = 723 : ey = 9 ; ex = 392
PositionEntity ent, ex,ey,ez
UpdateWorld()
tempex = EntityX(ent)
tempey = EntityY(ent)
tempez = EntityZ(ent)
; tempex returns 127!
; tempey returns 206!
; tempez returns 392!
After 2 days of frustration I wondered what would happen if I immediately repeated the positioning:
PositionEntity ent, ex,ey,ez
UpdateWorld()
tempex = EntityX(ent)
tempey = EntityY(ent)
tempez = EntityZ(ent)
; tempex,y,z now _sometimes_ return 723,9,392 (the correct values).
But not all the time. It's a 50/50 chance that I will get non-accurate values as I step through the second block of code.
So my cars appear up in the air, or away from the racetrack altogether.
This problem happens whether the parent is a pivot or a sphere.
Can anyone help. This feels just plain insane!
PROBLEM 2: POSITIONENTITY.
I now take it for granted that child entities are not going to stay 'attached' to parent entities.
So every loop I have to do 'PositionEntity car,0,0,0' to 'remind' Blitz to re-attach the child to the parent pivot accurately, or else the car drives along the side of the road, while the pivot drives down the middle.