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
0 registered members (), 16,232 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
Page 1 of 2 1 2
c_trace problems #282016
07/29/09 21:58
07/29/09 21:58
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
i'm trying two different ways to use c_trace to make the player stick to the ground, but neither are working:

1)

(c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) = downdistance);

my.z -= downdistance;


2)

if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0)
{
my.z = hit.z;
}



but the first one has a syntax error:
(c_trace(my invalid character

and the second one has the error message:
parameter unknown hit keyword


can somebody please help? thanks in advance

Re: c_trace problems [Re: nigel] #282019
07/29/09 22:19
07/29/09 22:19
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
1)

result = c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX);

my.z -= result * (result > 0);

2) Use "target" instead of "hit"

I hope it helped smile

Last edited by Claus_N; 07/29/09 22:22.
Re: c_trace problems [Re: Claus_N] #282020
07/29/09 22:22
07/29/09 22:22
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
@ Claus_n: 1) this works?


you made something wrong smile - You should not make my.z -= downdistance - becuase it´s wrong xD - use my.z = -downdistance * time_step -there is a differetn

Re: c_trace problems [Re: nigel] #282021
07/29/09 22:22
07/29/09 22:22
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
for falling etc...

Code:
var ground_dist;
var fall_limit = 1000;
ground_dist = c_trace(my.x,vector(my.x,my.y,(my.z - fall_limit)),IGNORE_ME|IGNORE_PASSABLE);
 if(ground_dist > 5)//adjust if needed
 {
  player.z -= 100 * time_step;//falling, adjust as well.
 }


///stick to ground
VECTOR temp;
 vec_set(temp,my.x);
 temp.z -= 1000;
 c_trace(my.x,temp,IGNORE_ME|IGNORE_PASSABLE);

 if(trace_hit)
 {
   vec_set(my.x,hit.x);
 }




Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: c_trace problems [Re: nigel] #282022
07/29/09 22:22
07/29/09 22:22
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
1>
downdistance = c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX);
my.z -= downdistance;

2> "hit" is only valid in lite-c, and from version A7.08 onwards.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: c_trace problems [Re: Nowherebrain] #282023
07/29/09 22:24
07/29/09 22:24
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Quote:
@ Claus_n: 1) this works?

You probably saw what I wrote before I edited it. I was just a bit too fast (might have been thinking of ent_animate as I've just been using that) grin

Last edited by Claus_N; 07/29/09 22:24.
Re: c_trace problems [Re: Claus_N] #282025
07/29/09 22:25
07/29/09 22:25
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
ah okay laugh

Re: c_trace problems [Re: Rei_Ayanami] #282237
07/30/09 22:14
07/30/09 22:14
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
thanks everyone, it works perfectly now! =D

Re: c_trace problems [Re: nigel] #282247
07/30/09 23:16
07/30/09 23:16
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Good deal, play around as much as you can with c_trace, and vectors...a large part of your functions will revolve around them.

out of curiosity what method did you go with?...starting out what was the easiest to implement for you?


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: c_trace problems [Re: Nowherebrain] #282252
07/30/09 23:42
07/30/09 23:42
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
the first one, it was easier to adapt to a falling function

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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