Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
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 | 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