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
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 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
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 | 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