Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help with floor movement #258837
04/02/09 12:08
04/02/09 12:08
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline 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 Offline
Expert
EvilSOB  Offline
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 Offline OP
Newbie
xandeck  Offline 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 Offline
Expert
EvilSOB  Offline
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!
Code:
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
Re: Help with floor movement [Re: EvilSOB] #258865
04/02/09 15:53
04/02/09 15:53
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
NIce, thanks, I will test when I got home (in work now) smile


XandeCK
Lead Developer
JogadorVIP.com

Moderated by  HeelX, rvL_eXile 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1