Small problem

Posted By: Deku_Boy

Small problem - 02/11/07 15:56

I have no idea why, but for some reason, I keep getting a "number syntax error" for this script:

entity* player;

var player_x;
var player_y;
var player_z;

action carl
{while(1)
{player = my;
player_x = my.x;
player_y = my.y;
player_z = my.z;
my.x += key_force.y * time;
my.y += key_force.x * time;
wait(1);
}
}

view player_camera
{layer = 1;
pos_x = 0;
pos_y = 0;
size_x = 256;
size_y = 192;
arc = 45;
aspect = 1;
offset_x = 0;
offset_y = 0;
ambient = 10;
fog = 10;
flags = visible;

pan = 0;
tilt = -10;
roll = 0;

x = (player_x + 5); //the error comes up right here
y = 0;
z = 0;
}



I don't understand why it's doing this, considering that player_x is a global variable and should be able to be used in initializing other variables, right?
Posted By: Puppeteer

Re: Small problem - 02/11/07 16:25

x? is it a defined var?
Posted By: Deku_Boy

Re: Small problem - 02/11/07 16:27

x is the x position of the camera. I would find it weird that it would find a problem with me calling that one x, when I just refer to the other position values as y and z with no problems.
Posted By: Puppeteer

Re: Small problem - 02/11/07 16:35

By the way: Are you german?
yes, of course...
ever tried deleting the ()? (brackets <- right ?? )
Posted By: Deku_Boy

Re: Small problem - 02/11/07 16:39

I only put them because it wouldn't work without them, so I thought it might work if I added them... but it didn't.

As for being German, no, I'm not.
Posted By: demiGod

Re: Small problem - 02/11/07 16:39

x is predefined, call it another thing.
Posted By: Puppeteer

Re: Small problem - 02/11/07 19:12

Good job demiGod
i didn't realized
© 2023 lite-C Forums