'pan' nota a part of 'function'

Posted By: Ericmor

'pan' nota a part of 'function' - 05/19/11 04:49

Hi folks,
I´m translating a large old C-script project into the new Lite-C engine language, and stumbled into a problem.
The engine error says that 'pan' is not a part of 'function', and points to the following line:
Code:
vec_to_angle(npc1_dir.pan,temp_npclookatplayer);


I´ve used several angle functions in the last scripts of the same project, and the engine never complained.
The npc1_dir was a VECTOR when it was declared earlier, and i changed it to a VAR, but to no avail.
The use inside vec_to_angle is the same in all the manual examples! What´s wrong?
Here´s the code:
Code:
function NPC_LOOKATPLAYER()
{
 VECTOR* temp_npclookatplayer;
temp_npclookatplayer.x=player_A.x-my.x;
temp_npclookatplayer.y=player_A.y-my.y;
temp_npclookatplayer.z=0;
vec_to_angle(npc1_dir.pan,temp_npclookatplayer);
if(my.pan>npc1_dir.pan+10||my.pan>npc1_dir.pan-10){vec_to_angle(my.pan,temp_npclookatplayer);}
if(my.pan<npc1_dir.pan+10||my.pan<npc1_dir.pan-10){vec_to_angle(my.pan,temp_npclookatplayer);}
wait(1);
}


Any help is appreciated... thanks in advance.
Posted By: fogman

Re: 'pan' nota a part of 'function' - 05/19/11 05:41

Try:
ANGLE npc1_dir;

Pan, tilt and roll are parts of an angle, not of a vector.
X, y and z are parts of a vector.
[0], [1] and [2] are parts of a var-array.
Posted By: Ericmor

Re: 'pan' nota a part of 'function' - 05/19/11 09:29

Thanks fogman!
...a new variable? One EXCLUSIVE for angles?!?!
Ok... but how could i miss that!??!? I searched the entire manual for PAN/TILT/ROLL related issues... is this too new?
Thanks again laugh
© 2024 lite-C Forums