Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
1,000,000 undeclared identifiers! #183667
02/13/08 11:12
02/13/08 11:12
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline OP
Member
Impaler  Offline OP
Member
I

Joined: Aug 2006
Posts: 128
Papua New Guinea
I have noticed some posts where undeclared identifiers and syntax errors
occur in lite-c even though the syntax is sound according to the manual.
I have just started migrating to lite-c, and almost every single thing I type in gives me the 'undeclared identifier' error upon compilation. I would like to know which of the following lines of code would be responsible for this, and maybe some forewarning about other code differences.(This is the only code in my .c file.)

Code:

action player_soldier()
{
var vel[3] = (0, 0, 0);//velocity in x, y, z
var accel[3] = (0, 0, 0);//velocity in x, y, z
var timer = 0;//general timer
my.skill9 = 100;
while(1)
{
accel[0] = key_w;//control acceleration by keyboard
accel[1] = key_d;
accel[0] -= key_s;
accel[1] -= key_a;
vel[0] += accel[0];
vel[1] += accel[0];
vel[0] = max(vel[0], -20);
vel[0] = min(vel[0], 20);
vel[1] = max(vel[1], -20);
vel[1] = min(vel[1], 20);
my.x += vel[0] * cos(my.pan)* time;
my.y += vel[1] * sin(my.pan) * time;
camera.z = my.z + 100;
camera.x = my.x;
camera.y = my.y;
wait(1);}
}




Murphey's Law:
<< if anything can go wrong, it will >>

(Murphey was an optimist).
Re: 1,000,000 undeclared identifiers! [Re: Impaler] #183668
02/13/08 11:34
02/13/08 11:34
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I'm not sure, but I think you have to include <acknex.h> and <afuncs.h>, or some engine functions will be undeclared.

Re: 1,000,000 undeclared identifiers! [Re: Excessus] #183669
02/13/08 11:41
02/13/08 11:41
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline OP
Member
Impaler  Offline OP
Member
I

Joined: Aug 2006
Posts: 128
Papua New Guinea
sorry, I forgot to mention that I also had a starter script in which those files were included. It looked like this:

Code:
 

#include <acknex.h>;
#include <default.c>;
#include "WWII_fps.c";
var video_mode = 6;
var video_depth = 16;
STRING level_str = "Caen.wmb";
function main()
{
tex_share = 1;
level_load(level_str);

}





Murphey's Law:
<< if anything can go wrong, it will >>

(Murphey was an optimist).
Re: 1,000,000 undeclared identifiers! [Re: Impaler] #183670
02/13/08 14:37
02/13/08 14:37
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
max(...) -> maxv(...)
min(...) -> minv(...)


time -> time_step


STRING -> STRING*


var video_mode = 6;
var video_depth = 16;
->
function main ()
{
video_mode = 6;
video_depth = 16;
...
}




Re: 1,000,000 undeclared identifiers! [Re: Impaler] #183671
02/13/08 14:39
02/13/08 14:39
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
I'm pretty sure that a "*" is required behind that STRING declaration. So it woud be STRING*


you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly
Re: 1,000,000 undeclared identifiers! [Re: oldschoolj] #183672
02/13/08 20:10
02/13/08 20:10
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline
Serious User
PrenceOfDarkness  Offline
Serious User

Joined: Aug 2004
Posts: 1,305
New York
var vel[3] = (0, 0, 0);//velocity in x, y, z

I think should be

var vel[3] = {0,0,0};
or if just enter 1 0 they are all set to zero (i do this and it works)

var vel[3] = {0};


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: 1,000,000 undeclared identifiers! [Re: oldschoolj] #183673
02/14/08 11:53
02/14/08 11:53
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline OP
Member
Impaler  Offline OP
Member
I

Joined: Aug 2006
Posts: 128
Papua New Guinea
Thanks, guys, those are very helpful! It's nice to know about the differences in syntax like that.


Murphey's Law:
<< if anything can go wrong, it will >>

(Murphey was an optimist).

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