Hello there i am trying to get my head around this programming language if thats what it really is... but am quite stuck. I am modifying lesson 19 of the litec workshops pack but have run into a problem.... you will need this file:

http://slcrinkle.googlepages.com/slab.mdl

to be placed in the "workshop19" folder and replace "script19.c" with the code below. (For some reason it MUST have that filename otherwise gives an error... which seems somehow like incredibly bad programming!!!)

I am trying to add a cube type shape to the game and apply physics to it... however scaling the object does not seem to scale the physics, how would this be done? So far i have:
================================================================

///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////////////////////////////////////

VECTOR ball_speed;
ENTITY* ball;
ENTITY* Slab;

function main()
{
fps_max = 200;
level_load("roller.wmb"); // load the level
wait (2); // wait until the level is loaded
ball = ent_create ("ball.mdl", vector(-400, 0, 100), NULL); // create the ball
ph_setgravity (vector(0, 0, -426)); // set the gravity
phent_settype (ball, PH_RIGID, PH_SPHERE); // set the physics entity type
phent_setmass (ball, 3, PH_SPHERE); // and its mass
phent_setfriction (ball, 199); // set the friction
phent_setdamping (ball, 20, 20); // set the damping
phent_setelasticity (ball, 20, 5); // set the elasticity
Slab = ent_create ("Slab.mdl", vector(-400, 0, 100), NULL); // create the ball
phent_settype (Slab, PH_RIGID, PH_BOX); // set the physics entity type
phent_setmass (Slab, 3, PH_BOX); // and its mass
phent_setfriction (Slab, 199); // set the friction
phent_setdamping (Slab, 20, 20); // set the damping
phent_setelasticity (Slab, 20, 5); // set the elasticity
Slab.scale_x = 5;
Slab.scale_y = 15;
Slab.scale_z = 5;

while (1)
{
ball_speed.x = 35 * (key_cur - key_cul); // move the ball using the cursor keys
ball_speed.y = 35 * (key_cuu - key_cud); // 25 sets the x / y movement speeds
ball_speed.z = 0; // no need to move on the vertical axis
phent_addtorqueglobal (ball, ball_speed); // add a torque (an angular force) to the ball
camera.x = ball.x - 400; // keep the camera 300 quants behind the ball
camera.y = ball.y; // using the same y with the ball
camera.z = ball.z + 100; // and place it at z = 1000 quants

camera.tilt = -5; // make it look downwards
wait (1);
}
}

=============================================================

I have tried changing "settype" and "setmass" to PH_POLY also, but this just made the object fall through the floor once settled on the ground... which is bad physics really.

Any help is appreciated!


I am a noob to this... Blitz3D is where i am best at!