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
1 registered members (TipmyPip), 18,633 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
PLS help #298396
11/14/09 17:24
11/14/09 17:24
Joined: Aug 2009
Posts: 14
Everywhere
Webster_ Offline OP
Warez Kiddie
Webster_  Offline OP
Warez Kiddie

Joined: Aug 2009
Posts: 14
Everywhere
Hi. Now I'm really stuck in continuing my game and I need your help guys. Here is the FPS camera script. But there are 2 problems:
1) I tried absolutely everything, but I just can't make the player jump.
2) In the c_move command the variable that moves the player forward and backward realtive (dist_ahead) moves the player also up and down - when I look in the ground and press S the player jumps and wgen I look at the sky and press S the player crouches.
Here is the code:

action free_camera()
{
player=me;
my.min_z=-134;
var speed_down = 0;
VECTOR vFeet;
vec_for_min(vFeet,me);
while (1)
{
my.pan -= 10 * mouse_force.x * time_step;
my.tilt += 10 * mouse_force.y * time_step;
if (me.tilt>89) {me.tilt=89;}
if (me.tilt<-89) {me.tilt=-89;}
var dist_down;
if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE|USE_BOX|IGNORE_FLAG2) > 0)
dist_down = my.z + vFeet.z - target.z;
else
dist_down = 0;
if (dist_down > 0)
dist_down = clamp(dist_down,0,accelerate(speed_down,8,0.1));
else
speed_down = 0;
var dist_ahead = 19*(key_w-key_s)*time_step;
var dist_side = 10*(key_a-key_d)*time_step;

dist_ahead = sign(dist_ahead)*(abs(dist_ahead) + 0.5*dist_down) ;
dist_side = sign(dist_side)*(abs(dist_side) + 0.5*dist_down);
c_move(me,vector (dist_ahead,dist_side,0),vector(0,0,-dist_down),IGNORE_PASSABLE | GLIDE|USE_BOX);
vec_set(camera.x, my.x);
vec_set(camera.pan,my.pan);
}
wait(1);
}

I hope you'll help. I'm new in 3dgs. I checked the manual and everything but I can't get it work.

Re: PLS help [Re: Webster_] #298439
11/15/09 01:32
11/15/09 01:32
Joined: Aug 2003
Posts: 7,440
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,440
Red Dwarf


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: PLS help [Re: Michael_Schwarz] #298456
11/15/09 08:36
11/15/09 08:36
Joined: Aug 2009
Posts: 14
Everywhere
Webster_ Offline OP
Warez Kiddie
Webster_  Offline OP
Warez Kiddie

Joined: Aug 2009
Posts: 14
Everywhere
Thx, that's what I'm looking for.


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