I had a hard time getting ODE to work just 1 week ago so I think I can be of help here.
Ok, first of all compile yourself or find a dll for your windows/linux version of ode with double precision (I don't know why. It has to be double) and for Windows I had to rename it
libode1.dll and put it in the main folder (together with the other .dlls).
Don't ask me why. If i leave it ode_double.dll (original name found in lib/ ode source folder) game doesn't use physics.
Here's mine.
Simple qc code to use a ball:
Code: Select all
void() AnimateItem=
{
physics_enable(self, 1);
};
void() physobject_ball {
setmodel(self, "models/phys/ball.iqm");
self.velocity = '0 0 0';
self.movetype = MOVETYPE_PHYSICS;
self.solid = SOLID_PHYSICS_SPHERE;
self.mass = 0.25;
self.bouncefactor = .4;
self.think = AnimateItem;
self.nextthink = time + 0.2;
};
create an object in radiant with classname
physobject_ball and you should be ok
let me know if it worked
PS: I noticed that writing something like this:
Code: Select all
self.origin_z = self.origin_z + 6;
make the object stand still in the mid air
PPS: your youtube's qc tutorials are GREAT. I learned a lot! Next?
EDIT: to play a little, go to your PutClientInServer function and comment
Code: Select all
//self.solid = SOLID_SLIDEBOX;
//self.movetype = MOVETYPE_WALK;
and add this
Code: Select all
//PLAYER ODE PHYSICS
self.geomtype = GEOMTYPE_CAPSULE;
self.movetype = MOVETYPE_PHYSICS;
self.bouncefactor = 0;
self.mass = 40;
now in PlayerPreThink function (client.qc file) add this:
Player walks as slow as an old turtle, when he stops he continues walking a little, when he felt from up he bounce like a rubber ball... but he can now play soccer!