Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: gravity depending on new_z [Re: Loopix] #128371
05/06/07 18:01
05/06/07 18:01
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Eh, this is a bit tricky.

How does your player use gravity? Could you post that part of the code?
ex:
- Directly adjusts the my.x value with a c_trace() for distance
- uses the z vector of c_move()
- Physics...
- Whatever...


xXxGuitar511
- Programmer
Re: gravity depending on new_z [Re: xXxGuitar511] #128372
05/06/07 18:07
05/06/07 18:07
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
It's in the sript I posted above ...in the c_move abs_dist z value!

Re: gravity depending on new_z [Re: Loopix] #128373
05/06/07 18:23
05/06/07 18:23
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:


- Directly adjusts the my.x value with a c_trace() for distance
- uses the z vector of c_move()





It uses these two together

Re: gravity depending on new_z [Re: Slin] #128374
05/06/07 18:29
05/06/07 18:29
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
ahh...he diden't fall from his horse

Re: gravity depending on new_z [Re: Loopix] #128375
05/06/07 18:55
05/06/07 18:55
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Ok. The problem is with the GLIDE flag in c_move(). Because the player is on a slope, the trace (without using USE_BOX) is thinking the player is above ground. Therefore, the c_move is pushing the player downwards, and sliding down the slope.

You could do many things. Turn off the GLIDE flag in c_move(), but this isn't desireable.
The most popular option would be to use USE_BOX with your downward trace. This way the player knows it's actually hitting the ground.

However, with the latter solution, you must configure your "slope sliding" manually, which is what we want here .

So then you use the normal returned from the trace and do as I stated above, transforming the angles.

...I need to figure out this part still...


xXxGuitar511
- Programmer
Re: gravity depending on new_z [Re: xXxGuitar511] #128376
05/09/07 14:18
05/09/07 14:18
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
vec_to_angle(temp.pan,normal.x); //find normal angle
vec_to_angle(temp2.pan,my.PlayerMove_x); //find move angle

//if the player is moving at an angle within 90 towards the slope apply gravity
IF (ang(temp.pan - temp2.pan) > 135) { //apply gravity }

Re: gravity depending on new_z [Re: DavidLancaster] #128377
05/10/07 12:19
05/10/07 12:19
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Quote:

vec_to_angle(temp.pan,normal.x); //find normal angle
vec_to_angle(temp2.pan,my.PlayerMove_x); //find move angle

//if the player is moving at an angle within 90 towards the slope apply gravity
IF (ang(temp.pan - temp2.pan) > 135) { //apply gravity }




instead of applying gravity, you can just turn ON glide, and make an else state in which it is being turned off... just an idea

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Page 2 of 2 1 2

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

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