|
5 registered members (Quad, 3run, alx, 2 invisible),
4,749
guests, and 57
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Help with floor movement
#258837
04/02/09 12:08
04/02/09 12:08
|
Joined: Mar 2007
Posts: 34 Osasco
xandeck
OP
Newbie
|
OP
Newbie
Joined: Mar 2007
Posts: 34
Osasco
|
Hello all, please, I'm trying to make the player moves with the floor he is above of it, but not exacly like in AUM 75, that George did... imagine a floor like my picture below:  So I have that platform (floorB) it keeps rotating into its pan angle, the player jumps on it and he now must move with the platform, in the same place he jumped on. If I do not do that, my player will stay on platform floorB, but it will stay idle and will fall down when his feet get out of the floor. I tried a couple of scripts, ideas, but no success so far. I tried with train code in AUM 75, no success, the player stay freezed into the center of platform, I can move with W and S, but when I release the button, the player goes back to center. Thanks in advance
XandeCK Lead Developer JogadorVIP.com
|
|
|
Re: Help with floor movement
[Re: xandeck]
#258847
04/02/09 13:10
04/02/09 13:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Try this for an crude idea. Make the top surface of the rotating platform have many vertices scattered over its surface (grid pattern?). When the play stops walking (not sure how you will test for that?), find a vertex on the platform that he is roughly above, then with every move of the platform, re-align the players x&y co-ords with the new x&y co-ords of the vertex he was standing on. Better - c_move him(absolute) by the x&y CHANGE the platform vertex had this frame.
Ive got another idea in mind, but I'll need to think on it a bit more first.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Help with floor movement
[Re: EvilSOB]
#258848
04/02/09 13:12
04/02/09 13:12
|
Joined: Mar 2007
Posts: 34 Osasco
xandeck
OP
Newbie
|
OP
Newbie
Joined: Mar 2007
Posts: 34
Osasco
|
Hmm... got you, I will try this...thanks...
XandeCK Lead Developer JogadorVIP.com
|
|
|
Re: Help with floor movement
[Re: xandeck]
#258859
04/02/09 15:08
04/02/09 15:08
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Here is the MUCH better idea I was thinking of. Tested and looks good to me. Hopefully you be able to see how to feed it into your actions. Any questions? Fire away!
ENTITY *Platform;
action Rotating_Platform()
{
Platform = me;
wait(1);
my.scale_x = 5;
while(1)
{
vec_set(my.skill1, my.pan); //store current pan/tilt/roll
me.pan += time_step; //or whatever rotations you want
vec_sub(my.skill1, my.pan); //calculate pan/tilt/roll change this frame
wait(1);
}
}
action Stay_On_Platform()
{
wait(1);
while(1)
{
vec_scale(Platform.skill1, -1); //invert Platform angle change
VECTOR tmpV;
vec_diff(tmpV, me.x, Platform.x); //calculate positional vector with Platform origin as center
vec_rotate(tmpV, Platform.skill1); //rotate aroung the origin
vec_add(tmpV, Platform.x); //calulate back to World co-ordinates
vec_sub(tmpV, me.x); //calculate absolute vector to move to
c_move(me, NULL, tmpV, NULL); //move there, checking for collisions
c_rotate(me, Platform.skill1, NULL); //rotation inherited from platform
vec_scale(Platform.skill1, -1); //invert Platform angle change BACK in case something else uses it
wait(1);
}
}
PS: the last idea sucks cause it doesnt rotate the player according to how far the platform has turned. He keeps facing the same direction. This code he turns with the platform too.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|