bagakkkk
12-28-2013, 04:40 AM
save/ restore position are useful in some fxxking action games.
map teleportation is useful in sandbox games.
save position:
get player's position (X,Y,Z)
restore position:
set player's position (X,Y,Z)
map teleportation:
1. get map position (x1,y1) (x2,y2)
2. get player's position (X1,Y1) (X2,Y2)
3. get formulars X = a1*x + b1 , Y = a2*y + b2, Z = z + b3
where
a1 = (X2-X1)/(x2-x1) , b1 = X1 - a1*x1
a2 = (Y2-Y1)/(y2-y1) , b2 = Y1 - a2*y1
b3 = sky
if position is dynamic, use codecave to get position.
map teleportation is useful in sandbox games.
save position:
get player's position (X,Y,Z)
restore position:
set player's position (X,Y,Z)
map teleportation:
1. get map position (x1,y1) (x2,y2)
2. get player's position (X1,Y1) (X2,Y2)
3. get formulars X = a1*x + b1 , Y = a2*y + b2, Z = z + b3
where
a1 = (X2-X1)/(x2-x1) , b1 = X1 - a1*x1
a2 = (Y2-Y1)/(y2-y1) , b2 = Y1 - a2*y1
b3 = sky
if position is dynamic, use codecave to get position.