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
2 registered members (AndrewAMD, degenerate_762), 1,213 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
3rd person move-skript #48305
06/25/05 12:44
06/25/05 12:44
Joined: Aug 2004
Posts: 593
Germany
Efrint Offline OP
Developer
Efrint  Offline OP
Developer

Joined: Aug 2004
Posts: 593
Germany
Hallo,

i posted a 1st person move script yesterday....now i´ve got the 3rd person one:
If you use it, name me (abraxas-games.de) in credits... It includes moving with kursors and jumping on space
////////////////////////////////////////////////////////////////////////////////
VAR laufen[3]=0,0,0;
VAR unten[3]=0,0,-3;
var dist_planar = 0;
var cam_angle = 0;
var dist_total = 60; // Change THIS value to zoom in or out
var tilt_3rd = 15;
var dist_traced;

function camera_to_target
{
// hole die Richtung von der Entity MY zur Entity YOU
vec_set(temp,player.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp); // und drehe MY, so dass er jetzt YOU anschaut
}


function validate_view()
{
my = player;
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.x = player.x - cos (cam_angle+player.pan) * dist_planar;
camera.y = player.y - sin (cam_angle+player.pan) * dist_planar;
camera.z = player.z + sin (tilt_3rd) * dist_total;
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;
}
}

FUNCTION jump()
{
proc_kill(2);
unten.z=2;
wait(30); //the bigger the wait, the higher the jump
unten.z=-3;
}


ACTION krasser_hero
{
player=my;

my.event=fall_event;
while(1)
{
////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_cuu==1)
{

laufen=1;
}
else
{
laufen=0;
}

if (key_cud==1)
{

laufen=-1;
}
if (key_cul==1)
{
my.pan+=5*time;
}
if (key_cur==1)
{
my.pan-=5*time;
}
if (key_space==1)
{
jump();
}


wait(1);
}
}

}
////////////////////////////////////////////////////////////////////////////////

I hope, it´s usefull

Regards Efrint

Last edited by Efrint; 06/25/05 18:29.
Re: 3rd person move-skript [Re: Efrint] #48306
06/25/05 18:27
06/25/05 18:27
Joined: Jan 2005
Posts: 1,918
BagEnd, Hobbiton, The Shire, E...
B
Bilbo Offline
Senior Developer
Bilbo  Offline
Senior Developer
B

Joined: Jan 2005
Posts: 1,918
BagEnd, Hobbiton, The Shire, E...
nice works well but i think u mean 3rd


http://Lonewolfstudios.syxe.com - now in php! Bah, I'm nerd enough to enjoy the rattling ~ laethyn
Re: 3rd person move-skript [Re: Bilbo] #48307
06/25/05 18:29
06/25/05 18:29
Joined: Aug 2004
Posts: 593
Germany
Efrint Offline OP
Developer
Efrint  Offline OP
Developer

Joined: Aug 2004
Posts: 593
Germany
post changed


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