Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (vicknick), 1,290 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
'pan' nota a part of 'function' #371221
05/19/11 04:49
05/19/11 04:49
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
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.

Re: 'pan' nota a part of 'function' [Re: Ericmor] #371223
05/19/11 05:41
05/19/11 05:41
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
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.


no science involved
Re: 'pan' nota a part of 'function' [Re: fogman] #371235
05/19/11 09:29
05/19/11 09:29
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
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


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1