Load level

Posted By: Des_Tiny

Load level - 06/03/06 17:49

Hi,

I would like to load some entities into my level with a script. I created a new WDL file and I included it, where the othere "include"s are. Then I wanted to call my level load function at the end of the main function, but when I run the game I get an error:


My function looks like this:
Code:
 
function loadlevel()
{
ent_create("feld1.wmb", vector(0,-1024,-128));
ent_create("feld1.wmb", vector(0,1024,-128));
ent_create("wand1.wmb", vector(-992,0,64));
ent_create("wand1.wmb", vector(992,0,64));
}



If I comment out the "loadlevel();" line in the main function it works. Whats wrong?
Posted By: Des_Tiny

Re: Load level - 06/03/06 18:14

Oh, I forgot to declare an action.
Posted By: Iron Chancellor

Re: Load level - 06/03/06 18:17

You have to assign an action or a function to the entities you create. If they don't need one, try:

ent_create("feld1.wmb", vector(0,-1024,-128), null);
ent_create("feld1.wmb", vector(0,1024,-128), null);
ent_create("wand1.wmb", vector(-992,0,64), null);
ent_create("wand1.wmb", vector(992,0,64), null);
Posted By: Des_Tiny

Re: Load level - 06/03/06 19:21

Thank you.

An other question: Why do I get the error message "Missing/wrong parameter comma unexpected" for this code:
Code:
 
result = c_move(my, nullvector, nullvector, IGNORE_YOU);


I know, it doesn't make sence to take the nullvector twice, but it doesn't work with other vectors, too.
Posted By: Xarthor

Re: Load level - 06/03/06 20:02

I guess you're using the Sybex A6 extra version?
If you do so: Sorry c_* commands (such as c_move, c_trace ..) are not working in the Sybex A6 extra as far as I know.
Posted By: Des_Tiny

Re: Load level - 06/03/06 20:15

Yes I do so.
Ok then, I will use ent_move
Posted By: Des_Tiny

Re: Load level - 06/03/06 21:55

I am using ent_move now, but the collision doesn't work:



The entity I am stearing only stops, when the middle of it is at the wall.
I read something in the documentation of GS about Bounding Boxes. Now I wan't to set the boxes bigger, but it still don't work.
My code:

Code:
 var t_speed_x;
var t_speed_y;
define speed_x, skill1;
define speed_y, skill2;

entity* schlaegel_s;
action a_schlaegel_s
{
schlaegel_s = my;
my.speed_x = 3;
my.speed_y = 3;
while(1)
{
my.max_x = 256;
my.max_y = 32;
my.max_z = 64;
my.min_x = -256;
my.min_y = -32;
my.min_z = -64;
t_speed_x = key_cur * my.speed_x - key_cul * my.speed_x;
t_speed_y = key_cuu * my.speed_y - key_cud * my.speed_y;
move_mode = IGNORE_YOU;
ent_move(vector(t_speed_x, t_speed_y,0),nullvector,0));
wait(1);
}
}


© 2024 lite-C Forums