Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 07/22/26 06:42
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
need help using Trace #1648
03/28/01 11:55
03/28/01 11:55

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Ok, I have a 3rd person view and I need to detect if something gets in between the player and camera view.

I set the trace_mode to ignore me and passable, then I use result = trace(player.x,camera.x) then I check if result is smaller than the distance of palyer.x and camera.x using vec_dist, if it is I execute a command to move the camera.

The problem is it either always moves the camera, even when nothing is in the way or never moves it, even when something is in the way.

Any suggestions or code snips would be helpful.

note: the player can move the camera.x by pressing a key.

thanks

Brandon

[This message has been edited by AcidCrow (edited 28 March 2001).]


Re: need help using Trace #1649
03/28/01 14:54
03/28/01 14:54

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hi AcidCrow,

If you search for "My 3rd person camera function" in the beginner's topics you may find some useful info. I was working through alot of the same issues when I wrote that. Hope this helps.


Re: need help using Trace #1650
03/28/01 15:01
03/28/01 15:01

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Well, its not the camera stuff Im having problems with. I need to know when something gets inbetween the player and the camera, hence the trace command. I cant seem to get the trace to detect when a object is blocking the view from the camera to the player.

Thanks for replying though.

Brandon


Re: need help using Trace #1651
03/28/01 15:05
03/28/01 15:05

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Well, there is an example of using trace in that way in that code.

Re: need help using Trace #1652
03/28/01 15:26
03/28/01 15:26

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Heres the code I am using, maybe you can find my mistake:

while (1){
trace_mode = ignore_me + ignore_passable + use_box;
result1 = trace(player.x,temp_cdist.x);
if (result1 > 0){
temp_cdist.x = temp_cdist.x + 20;move_view_3rd();}
wait(1);
}

the result1 always returns a 0, even if I stand where I know there is something in the way.

I really need to get this solved...I looked at the code you were talking about, and it seems like I am doing about the same thing with the trace, but I must be missing something.

Thanks in advance.

Brandon

[This message has been edited by AcidCrow (edited 28 March 2001).]


Re: need help using Trace #1653
03/28/01 16:10
03/28/01 16:10

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Hmmm, I only used ignore_me and ignore_passable in my function. Could adding use_box make a difference? Doesn't seem very likely, but that is different.

Ahh, I have a vec_sub to put the desired camera position temp_cdist.x behind the player for the trace sort of like this:


vec_set(temp, player.X);
vec_sub(temp, temp_cdist);
trace_mode = ignore_me + ignore_passable;
result = trace(player.X, temp);

(I changed it from the way I did it to make is more like your function, hope I didn't screw it up.)

The only other thing I see is when result1 is greater than zero, it looks like the cammera is moving away. Should it move closer? But that doesn't have anything to do with the trace function.


Re: need help using Trace #1654
03/28/01 16:30
03/28/01 16:30

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I tried your entire 3rd person code and I got it where it alomst works for what I want.

The only problem is when something is in the way the camera view is right on top of it. I need to get it to move back a bit more from it.

And yes, my camera is moving forward, not back.

I do appreciate your help though, seems like Im getting closer to what I need.

Brandon


Re: need help using Trace #1655
03/29/01 03:59
03/29/01 03:59

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



OK, I fixed the problem of being too close, but have one other bug. If the camera touches the ceiling it gets the mirror effect and sticks to the ceiling for a second. I even tried making the camera non-passable and it still does it.

Any ideas?

Brandon


Re: need help using Trace #1656
03/29/01 08:32
03/29/01 08:32

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I saw the hall of mirrors effect also. Usually worst when I was zoomed way back. I suspected that it was due to the camera getting too close to or even slightly inside a wall or ceiling. I tried adding a fudge (using a trace at 110% of the camera distance to the player or so) to keep the camera from getting too close to an obstacle. That did seem to help somewhat, but even with that, I never was able to eliminate it completely. I finally just decided to let it go.

Re: need help using Trace #1657
03/29/01 08:44
03/29/01 08:44

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Yeah, Ive been trying to get rid of it also and cant seem to do it. Its not too bad and hopefully wont affect game play much being that its only the ceiling that does it.

Thanks a lot for your help.

Brandon


Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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