I know i started this in the other topic but felt it best to start a new topic as my problems wandered so far from the old topic description that its possible people wouldnt bothere reading if it didnt interest them...
Basically im learning this Lite-C malarky and have become quite stuck:
================================================================
#include <acknex.h>
#include <default.c>
ENTITY* FLOOR;
typedef struct
{
ENTITY* model;
} box;
function new_box()
{
box my_box;
my_box.model = "cube.x";
my_box.model.x = -400;
my_box.model.y = 0;
my_box.model.tilt = 145;
my_box.model.z = 2800;
phent_settype (my_box.model, PH_RIGID, PH_BOX); // set the physics entity type
phent_setmass (my_box.model, 3, PH_BOX); // and its mass
phent_setfriction (my_box.model, 80); // set the friction
phent_setdamping (my_box.model, 40, 40); // set the damping
phent_setelasticity (my_box.model, 50, 20); // set the elasticity
}
function main()
{
video_mode=7;
level_load("");
FLOOR = ent_create ("plain3d1.x", vector(-400, 0, 100), NULL); // create the ball
set(FLOOR,LIGHT);
wait(2);
camera.x = 7500;
camera.y = 250;
camera.z = 1250;
camera.pan = 180;
FLOOR.scale_x=5000;
FLOOR.scale_y=5000;
FLOOR.scale_z=30;
FLOOR.z = -5;
FLOOR.red = 0;
FLOOR.green =0;
FLOOR.blue =0;
FLOOR.ambient = 25;
FLOOR.z=-50;
ph_setgravity (vector(0, 0, -6086)); // set the gravity
while (1)
{
// CONTROLS
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
camera.pan -= mouse_force.x * 2;
camera.tilt += mouse_force.y * 2;
if (key_w) camera.y += 12 * time_step;
if (key_s) camera.y -= 12 * time_step;
if (key_a) camera.x += 12 * time_step;
if (key_d) camera.x -= 12 * time_step;
on_e = new_box;
wait(1);
}
}
==============================================================
the two models are cubes and the program is supposed to create a new box every time the E key is pressed. However running the code above, lite-c simply gives the error:
"Malfuntion w1600
Entity not a physics object in main"
OK - CANCEL
What does this mean? :s