Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 636 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Like swimming or spaceship #371105
05/17/11 23:29
05/17/11 23:29
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
How can i make an entity move in the 3 axys freely and make
it tilt depending on camera tilt, like if camera tilt is < 10
it tilts 30 degrees, < 20 it tilts 60 degrees.

Only found x, y movement examples and abolute nothing on entity tilt depending on camera tilt.

Re: Like swimming or spaceship [Re: Mythran] #371106
05/17/11 23:37
05/17/11 23:37
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline
Expert
Rondidon  Offline
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
I don`t know what exactly you need, but this is a free camera script ("specator mode for FPS")

Code:
var camvector[3];

action freecam_ac() //Freie Kamera
{	
	set(my,INVISIBLE);
	camera.genius = me;
	freecam_fnc();
}

function freecam_fnc() //Freie Kamera
{
	while(1)
	{
		camvector[0] = ((key_w - key_s)*13*time_frame*1.5);
		camvector[1] = ((key_a - key_d)*13*time_frame*1.5);
		camvector[2]= key_space*13*time_frame;
    	camera.pan-=mickey.x;
  		camera.tilt-=mickey.y;  
  		camera.tilt = maxv(-85,minv(camera.tilt,85));
		c_move(my,cambewegung,nullvector,IGNORE_PASSABLE | GLIDE);
		camera.x = my.x;
		camera.y = my.y;
		camera.z = my.z;
		my.pan = camera.pan;
		my.tilt = camera.tilt;
		wait(1);
	}
}



Re: Like swimming or spaceship [Re: Rondidon] #371147
05/18/11 12:59
05/18/11 12:59
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
In this case the player is basicly the camera, i want to have a player.

A camera following a player, and the tilt of both are to be diffrent.

The player just tilts when the camera has archieved a certain tilt point.
Basicly only the player.pan is to be the same of camera.pan.

Imagine a 3rd person shooter but the player can fly on 3 axys.

Edit*

I have this player movement

player_movement.x = 8 * (key_w) * time_step;
player_movement.y = 6 * (key_a - key_d) * time_step;
player_movement.z = player_movement.x * camera.tilt * 0.2 * time_step;

(the player tilting depending on camera.tilt is on other function)

and it seems to be tilting depending on camera.tilt
but i found my.x follow my.tilt, so if the player tilts forward to start swimming while i press key_w he starts swimming downwards instead of going in front.
What could be causing this?

Thanks for your reply

Last edited by Mythran; 05/18/11 20:13.
Re: Like swimming or spaceship [Re: Mythran] #371216
05/18/11 23:12
05/18/11 23:12
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
can please someone tell me if this is possible?
after c_rotate, add_ang, etc... nothing seems to work frown
Rondidon ?

Last edited by Mythran; 05/18/11 23:14.
Re: Like swimming or spaceship [Re: Mythran] #371217
05/18/11 23:27
05/18/11 23:27
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline
Expert
Rondidon  Offline
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
This should work. I hope I got you right.

Code:
var switch_player;


if(camera.tilt < 10 && camera.tilt > -10)
{
switch_player = 1;
}
else { switch_player = 0; }


player_movement.x = 8 * (key_w) * time_step;
player_movement.y = 6 * (key_a - key_d) * time_step;
player_movement.z = switch_player * player_movement.x * camera.tilt * 0.2 * time_step;



Re: Like swimming or spaceship [Re: Rondidon] #371270
05/19/11 17:24
05/19/11 17:24
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Well it was that. And it does work, but as i said before if you tilt the player the movement will follow the player tilt and not camera tilt. Thanks once again Rondidon laugh


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | 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