Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
sliding #334230
07/21/10 22:57
07/21/10 22:57
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
I whant that my player and ncps start to slide when they are on a Model, Terrain or block that has an angle of 60.
My code looks like this, but it dosnt work;

VECTOR z_dist;//Of course

if(event_type == EVENT_BLOCK | EVENT_ENTITY && normal.z > 0.75) {
my.z_dist = minv(my.z_dist,-5);
}


Does somebody know how I can fix this??? tongue

Last edited by Random; 07/21/10 22:58.


Re: sliding [Re: Random] #334620
07/24/10 10:10
07/24/10 10:10
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
anybody???



Re: sliding [Re: Random] #334623
07/24/10 10:18
07/24/10 10:18
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Happy Birthday Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There is no reply because you did not post the important code, your movement/ gravity(!) code.
Btw that's not how you would like to code it, I guess your z_dist is set every frame by your movement code, that means your event will have no effect.
What is my.z_dist supposed to be anyway when you declare z_dist as a global vector?
(I guess you just copied my example code from "Neigung im Raum" and modified it?!)

z_dist = c_trace(my.x,vector(my.x,my.y,my.z-200),IGNORE_ME | IGNORE_PASSABLE)+my.min_z;
if(trace_hit && normal.z > 0.35) { // play with this value
place your sliding code here
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: sliding [Re: Superku] #334628
07/24/10 11:20
07/24/10 11:20
Joined: Feb 2010
Posts: 886
Random Offline OP
User
Random  Offline OP
User

Joined: Feb 2010
Posts: 886
He thanks that works! laugh




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