Gamestudio Links
Zorro Links
Newest Posts
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
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 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
Page 2 of 2 1 2
Re: Demo of my game [Re: tek] #81313
07/14/06 15:57
07/14/06 15:57
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Quote:

The camera is too close from the ground so you should change the tilt of the camera or rise the target of the camera .




Does anyone know how to fix this in my code, where I got my code was from a tutorial, I tried changing numbers but nothing seem to work.
this is my code.


Quote:


var laufen[3]=0,0,0;
var unten[3]=0,0,-3;
var dist_planar = 0;
var cam_angle = 0;
var dist_total = 60;
var tilt_3rd = 30;
var dist_traced;
var zoom=300;
var move_vec[3]=0,0,0;
var stand_percent=0;
var walk_percent=0;
var player_distance[3]=0,0,0;
define gegner,flag1;
define health,skill1;
sound player_hurt=<player_hurt.wav>;
sound hit_scorpion=<hit_scorpion.wav>;
bind <bullet.mdl>;
var jump_time=1;
var gravity=2;
var player_distance;
var distance_traced;
define ground_dist, skill2;

function validate_view()
{
player=my;
trace_mode = ignore_me + ignore_passable;
dist_traced = trace (player.x, camera.x);
if (dist_traced == 0) { return; } // No obstacles hit... fine
if (dist_traced < dist_total)
{
dist_traced -= 5; // Move it out of the wall
dist_planar = cos (tilt_3rd)* dist_traced;
camera.x = player.x - cos (cam_angle) * dist_planar;
camera.y = player.y - sin (cam_angle) * dist_planar;
camera.z = player.z + sin (tilt_3rd) * dist_traced;
}
}

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();
}


FUNCTION fall_event
{
if(event_type==event_block)
{
unten.z=0;
}
else
{
unten.z=-3;
}
if(event_type==event_entity)
{
unten.z=0;
}
else
{
unten.z=-3;
}
}



ACTION player_move
{
my.health=100;
player=my;
my.event=fall_event;
my.enable_click=on;
score.visible=on;
//name_ent1();

while(my.health > 0)

{

////camera////
update_views();
camera_to_target();

////walking////
c_move (me,laufen,nullvector,GLIDE+IGNORE_PASSABLE);
c_move (me,unten,nullvector,IGNORE_PASSABLE);
////controle////

if(key_t==1)
{
camera.genius=player;
camera.x=player.x;
camera.y=player.y;
camera.z=player.z+55;
camera.pan=player.pan;
waitt(1);
}

player_distance.x=18*(key_w-key_s)*time;
my.pan-=12*mouse_force.x*time;
move_vec[1]=(key_comma-key_period)*20*time;
if(camera.tilt > 90){camera.tilt = 90;}
if(camera.tilt < -90){camera.tilt = -90;
}
vec_set (temp, my.x);
temp.z -= 1000;
trace_mode = ignore_me + ignore_passable + use_box;

my.skill2 = trace(my.x, temp);
if (my.skill2 > 2)
{
player_distance.z -= 2 * time;
}
else
{
player_distance.z = 0;
}
if (my.skill2 < 0)
{
player_distance.z += 5 * time;
}

/* if(my.health<=0)
{
wait(1);
load_level(<mynewgame.wmb>);
my.enable_impact=ON;
my.event=lev_2_event;
}


if(myscore==390)
{
my.enable_impact=ON;
my.event=lev_1_event;
my.enable_impact=OFF;
wait(1);
load_level(<MOSESL~1.wmb>);
}
*/

if(key_shift ==1)
{ player_distance.x += player_distance.x;
player_distance.y += player_distance.y;}
if(key_w-key_s)
{
walk_percent=(walk_percent+5*time)%100;
ent_animate(me,"walk",walk_percent,ANM_CYCLE);
}
if(key_w-key_s==0)
{
stand_percent=(stand_percent+5*time)%100;
ent_animate(me,"stand",stand_percent,ANM_CYCLE);
}
if (key_shift!=0&&key_w-key_s!=0)
{
walk_percent=(walk_percent+5*time)%100;
ent_animate(me,"walk",walk_percent,ANM_CYCLE);
}
if (key_ctrl==1)
{
attack_percent=(attack_percent+5*time)%100;
ent_animate(me,"attack",attack_percent,ANM_CYCLE);
}
if(mouse_left==1)
{
attack_percent=(attack_percent+5*time)%100;
ent_animate(me,"attack",attack_percent,ANM_CYCLE);
}

if(key_space == 1){jump();}
move_mode = ignore_passable+glide;
ent_move (player_distance,nullvector);
wait(1);
}
camera.roll = 90;
}




I know this is a long code, but if someone can just tell me where I can start experimenting to make the camera not be in Moses behind I would greatly appreciate :\

Re: Demo of my game [Re: ZZZgames] #81314
07/14/06 16:05
07/14/06 16:05
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Quote:

How many spikes did you place all over the holes?
Because the problem might not be the polycount but more the fact there are many mdls due to many spikes ... thats why i told you to create one big mdl with many spikes and attach to it the spike script.




yea thats a good idea im gonna do that. thanks for the advice that would help my game.

Re: Demo of my game [Re: tek] #81315
07/14/06 16:51
07/14/06 16:51
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Thanks ZZZgames that did it I made one model with many spikes and the game is much smoother

Re: Demo of my game [Re: tek] #81316
07/14/06 17:58
07/14/06 17:58
Joined: Aug 2005
Posts: 218
Z
ZZZgames Offline
Member
ZZZgames  Offline
Member
Z

Joined: Aug 2005
Posts: 218
Cool that it worked

For the tilt ..You can change the tilt by two ways.
The camera function is called from player_move action with the line " update_views();"

1)So when you look at the function update_views() ,you can see there is the 8th line of the function that says "camera.tilt = - tilt_3rd;" .
So you can change directly the tilt with a numeric value here instead of the tilt_3rd var.

Or

2)tilt_3rd is a var defined in the first lines before the functions ...
Its defined in the 6th line of the whole script you posted ..And it says "var tilt_3rd = 30;"
So you can change the value of the variable there.

This is how ,imho you can change the tilt ...But i am not sure since i cant test it.


Its a pleasure to play around with A6. zzzgames.ifrance.com : go try & buy Streetkicker
Re: Demo of my game [Re: ZZZgames] #81317
07/15/06 14:58
07/15/06 14:58
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
gahhhhh!!!!!! wheres your comments, and your indenting mister? does someone need to look at coding etiquette tutorials??? no im just kiddng

Re: Demo of my game [Re: lostclimate] #81318
07/16/06 20:49
07/16/06 20:49
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
cool thanks for the advice the var didnt do nothing when i changed the number, the tilt 3rd i believe could work, how do you change it ?

camera.tilt=- tilt_3rd:
I tried changing tilt_3rd and putting a number but gives me error.

Re: Demo of my game [Re: tek] #81319
07/19/06 15:14
07/19/06 15:14
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
hi every1 I got good news I changed the camera so that it's no longer in Moses behind and I zoomed the camera a little back I also added a new level, Level 2 "Unseen Hope" this is where Moses has to go up the mountain and get to the burning Bush

I still havent fixed the problem of when I get near a wall but hopefully I will one day.

here are some pics of the camera change and the new level feedback please



and heres mount Sinai



btw does any1 know where I can find egyptian wav music I want for my pyramid level to play an egyptian song.
I am also gonna add a panel in the beginning that you click with the mouse start and then you go to first level or exit and you leave.

Last edited by tek; 07/19/06 21:54.
Page 2 of 2 1 2

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