0 registered members (),
984
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
movement around moving planets/platforms
#330098
06/25/10 18:52
06/25/10 18:52
|
Joined: Aug 2003
Posts: 127 Berlin, Germany
CHaP
OP
Member
|
OP
Member
Joined: Aug 2003
Posts: 127
Berlin, Germany
|
Hey! How can I realize the player movement around a platform/planet, they moves (pan/tilt) as well? (A player movement like in 'Populous - The Beginning', you know?) I have already tried:
while(1)
{
ENTITY* eIsland = ptr_for_handle(my.skill1);
my.x = (eIsland.x - cos(eIsland.pan) * cos(eIsland.tilt + 90) * 50);
my.y = (eIsland.y - sin(eIsland.pan) * cos(eIsland.tilt + 90) * 50);
my.z = (eIsland.z + sin(eIsland.tilt + 90) * 50);
var varDistance = c_trace(my.x,vector(my.x,my.y,my.z - 100),IGNORE_ME | USE_POLYGON);
my.skill10 += (key_t - key_g) * time_step;
my.skill11 += (key_f - key_h) * time_step;
my.skill12 = -varDistance;
my.x += my.skill10;
my.y += my.skill11;
my.z += my.skill12;
my.pan -= (key_r - key_z) * 5 * time_step;
wait(1);
}
^^ In this case, the player will move exactly with the platform/planet if they moves but his own pan direction is going to lose. And this:
ENTITY* eIsland = ptr_for_handle(my.skill1);
my.x = (eIsland.x - cos(eIsland.pan) * cos(eIsland.tilt + 90) * 50);
my.y = (eIsland.y - sin(eIsland.pan) * cos(eIsland.tilt + 90) * 50);
my.z = (eIsland.z + sin(eIsland.tilt + 90) * 50);
while(1)
{
var varDistance = c_trace(my.x,vector(my.x,my.y,my.z - 100),IGNORE_ME | USE_POLYGON);
my.skill10 = (key_t - key_g) * time_step;
my.skill11 = (key_f - key_h) * time_step;
my.skill12 = -varDistance;
my.pan -= (key_r - key_z) * 5 * time_step;
c_move(my,vector(my.skill10,my.skill11,my.skill12),nullvector,IGNORE_MODELS);
wait(1);
}
^^ There works the pan direction fine but the player will not moved to the right position of platform/planet. And, let alone of the including of the normal adjustment... So, any ideas?
|
|
|
Re: movement around moving planets/platforms
[Re: CHaP]
#330221
06/26/10 12:00
06/26/10 12:00
|
Joined: Aug 2003
Posts: 127 Berlin, Germany
CHaP
OP
Member
|
OP
Member
Joined: Aug 2003
Posts: 127
Berlin, Germany
|
Right! On this PAGE is exactly what I want to do. And these used mechanics agree with my thoughts. But, how the hell will it work if the planetoids are moving?!
|
|
|
Re: movement around moving planets/platforms
[Re: CHaP]
#330296
06/26/10 17:47
06/26/10 17:47
|
Joined: Jan 2002
Posts: 300 Usa
Rich
Senior Member
|
Senior Member
Joined: Jan 2002
Posts: 300
Usa
|
How about: When the player is on the platform, the player stores a pointer to himself in one of the platform's skills.
Then in the platform's action, it displaces the player (using the pointer) to a position far away, performs it's own movement, then brings the player back to his original position plus distance the platform moved that frame. And finally, the platform's action clears the skill, it would be set again by the player's action if he is still standing on it.
Just a concept.
A8 com / A7 free
|
|
|
|