Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (RealSerious3D, rvl, tomaslolo), 685 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
change my tilt #81992
07/18/06 01:00
07/18/06 01:00
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
hello, I was using a tutorial for a third person game and come to a problem, I want to change my tilt but in the tutorial I dont know how.

Quote:

function update_views()
{
dist_planar = cos (tilt_3rd) * dist_total;
camera.pan=player.pan;camera.tilt=player.tilt;camera.roll=player.roll;
camera.x = player.x - cos(player.pan)*cos(-player.tilt)*zoom;
camera.y = player.y - sin(player.pan)*cos(-player.tilt)*zoom;
camera.z = player.z + sin(-player.tilt)*zoom;
camera.pan = cam_angle;
camera.roll = 0;
camera.tilt = - tilt_3rd;
validate_view();
}

camera.tilt = - tilt_3rd;
////camera////
update_views();




How do I change tilt_3rd ? because I dont like the view I currently have.

Re: change my tilt [Re: tek] #81993
07/18/06 19:04
07/18/06 19:04
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
is there a var that is called
tilt_3rd at the beginning? if so you could replace it with another number
so maybe the var is 5 so replace it with 12 or whatever


Visit:
schwenkschuster-design.de
Re: change my tilt [Re: aztec] #81994
07/18/06 19:23
07/18/06 19:23
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Code:

function update_views()
{
dist_planar = cos (-camera.tilt) * dist_total;
camera.pan = player.pan;
camera.tilt = -70; //play with this value
camera.x = player.x - cos(player.pan)*cos(-player.tilt)*zoom;
camera.y = player.y - sin(player.pan)*cos(-player.tilt)*zoom;
camera.z = player.z + sin(-camera.tilt)*zoom;
camera.pan = cam_angle;
camera.roll = 0;
validate_view();
}


This _should_ work but I've not tested it

EDIT:
which tutorial did you follow?
could you please post a link and I'll might take a look at it to see what the author did intend to do, and how I can help you out.

Last edited by Thunder; 07/18/06 19:25.
Re: change my tilt [Re: aztec] #81995
07/19/06 00:39
07/19/06 00:39
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Quote:

is there a var that is called
tilt_3rd at the beginning? if so you could replace it with another number
so maybe the var is 5 so replace it with 12 or whatever




I wish it was that easy, I tried changing the variable so many times but nothing happened.

Quote:

Code:
--------------------------------------------------------------------------------

function update_views(){ dist_planar = cos (-camera.tilt) * dist_total; camera.pan = player.pan; camera.tilt = -70; //play with this value camera.x = player.x - cos(player.pan)*cos(-player.tilt)*zoom; camera.y = player.y - sin(player.pan)*cos(-player.tilt)*zoom; camera.z = player.z + sin(-camera.tilt)*zoom; camera.pan = cam_angle; camera.roll = 0; validate_view();}

--------------------------------------------------------------------------------

This _should_ work but I've not tested it





You don't need to test it it works, yet it gave me another problem with my bullet, before my bullet would touch the ground and move forward. now when i shoot it doesnt move forward. I believe this is because it's to close to the ground, I tried moving it up but nothing I did seemed to work.

I know this is asking too much but I tried myself for almost two hours and coulnt change the bullet direction.
Do you happen to know how to make my bullet z direction go up ?

This is the code for my bullet.

Quote:

function player_bullet_event()
{
my.event = 0;
my.invisible = on;

if(you != 0){if(you.gegner== on){you.health -= 10;}}
waitt(5);
ent_remove(my);
}

function player_bullet()
{
my.passable = on;
my.scale_x = 1.9;
my.scale_y = 1.9;
my.scale_z = 17.9;
my.narrow = on;
wait(1);
my.min_x = -1;
my.min_y = -1;
my.max_x = 1;
my.max_y = 1;
my.pan = camera.pan;
my.tilt = camera.tilt;
my.skin = 2;
my.flare = on;
my.bright = on;
my.ambient = 100;
my.unlit = on;
my.enable_entity = on;
my.enable_impact = on;
my.enable_block = on;
my.event = player_bullet_event;
while (1)
{
if(vec_dist(my.x,player.x)>40){my.passable = off;}
move_mode = ignore_you+ignore_passable+glide;
ent_move(vector(100*time,0,0),nullvector);
wait(1);
}
}

function player_shoot()
{
if(player.health < 1){return;}
ent_create("bullet.mdl",player.x,player_bullet);
}
on_mouse_left = player_shoot;
on_ctrl=player_shoot;




I tried changing the "my.scale_z = 17.9;" but it would not make the bullet go the z direction up. I am lost. I tried changing every number.

Quote:

which tutorial did you follow?
could you please post a link and I'll might take a look at it to see what the author did intend to do, and how I can help you out.




I followed the AI_Tutor by tuschcarsten the code works well, it's meant for 1st person shooter but somehow I transferred it to third.
If I am bugging you guys with too much questions I am sorry, i just want my game to have everything I need it to have. You don't have to answer if you dont want.

Last edited by tek; 07/19/06 00:43.
Re: change my tilt [Re: tek] #81996
07/19/06 06:07
07/19/06 06:07
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
lol, if noone wants to answer noone would I guess
simple as that.

Alright about your bullet problem:
scale_z has nothing to do with the bullets angle nor direction.
its just a skill to scale the bullet (make it bigger for example).
You just need to change 1 line in your player_bullet function, here it is: (updated)
Code:

function player_bullet()
{
my.passable = on;
my.scale_x = 1.9;
my.scale_y = 1.9;
my.scale_z = 1.9;
my.narrow = on;
wait(1);
my.min_x = -1;
my.min_y = -1;
my.max_x = 1;
my.max_y = 1;
my.pan = camera.pan;
my.tilt = player.tilt; //CHANGED
my.skin = 2;
my.flare = on;
my.bright = on;
my.ambient = 100;
my.unlit = on;
my.enable_entity = on;
my.enable_impact = on;
my.enable_block = on;
my.event = player_bullet_event;
while (1)
{
if(vec_dist(my.x,player.x)>40){my.passable = off;}
move_mode = ignore_you+ignore_passable+glide;
ent_move(vector(100*time,0,0),nullvector);
wait(1);
}
}



Re: change my tilt [Re: Xarthor] #81997
07/19/06 13:29
07/19/06 13:29
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Thanks Thunder it worked


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