Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
error with script or bug? #210897
06/13/08 18:36
06/13/08 18:36
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
I have made a simple script but i keep getting a error but there is nothing wrong with the script.
It maybe just me but i need to make sure.
I'm really new to programing but i cant see a problem, could it be a bug?.
Please Help.

the error says
<FONT* arial_font = "Arial#20b";>
PROJECT1.WDL 72:0 (); Keyword unknown FONT*
then a few more lines of error after that becuase of this line.

Heres my Script i made
#include <acknex.h> // include these predefined, needed files in our project
#include <default.c>

ENTITY* gplayer;
var walk_percentage;
var can_move;
var can_walk = 0;

Function main()
{
video_switch(7,0,1); // set full screen and 800/600 with no depth change
fps_max = 200; //set the frame rate this way game will run the same on all pc's
load_level("Project1.wmb"); //load the level
wait(2); // wait until the level is loaded
vec_set(camera.x,vector(-231 ,4 ,131));
camera.tilt = -12;
camera.pan = 0;
wait(-1);
while(1)
{
if (can_move < 100)
{
camera.x -=8 * time_step;
can_move +=8 * time_step;
wait(1);
}
else
{
can_walk = 1;
}
wait(1);
}

}


action player_actions
{
gplayer = me;//ponit the model is gplayer
my.shadow = on;
while(1)
{
if (can_walk == 1)
{
if (key_w) //if keyboard W is pressed move forward
{
c_move(my,vector(5.4* time_step,0,0),nullvector,glide);
ent_animate(my, "walk", walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 6 * time_step; // 3 = animation speed for "walk"
}
else
{
ent_animate(my, NULL, 0, 0); // reset all the animations
}

if (key_a) //if keyboard A is pressed pan + 2
{
my.pan+=4 * time_step;
}

if (key_d) //if keyboard A is pressed pan - 2
{
my.pan-=4 * time_step;
}

wait(1); //wait to next frame
}
wait(1);
}
}

FONT* arial_font = "Arial#20b"; // Arial, bold, a character has a height of 20 points
STRING* worldtext_str = "My First Project";
TEXT* world_txt =
{
pos_x = 10;
pos_y = 10;
string (worldtext_str) ;
flags = VISIBLE;
font = arial_font;
}

Re: error with script or bug? [Re: FireArm] #210898
06/13/08 18:42
06/13/08 18:42
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
PROJECT1.WDL save it as .c and imported is to remove the wdl
(make sure you have a back up map somwhere)


"empty"
Re: error with script or bug? [Re: flits] #210901
06/13/08 18:53
06/13/08 18:53
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
ok i saved it as project1.c and now when i run i get a new error which says

Error in "Main" line 9 'Function' undeclared identifier
<Function main()>

What does that mean?
i know when the script is .wdl instead of .c it works with out the text part, so my script is fine but why do i get this error in .c

Last edited by FireArm; 06/13/08 19:30.
Re: error with script or bug? [Re: FireArm] #210919
06/13/08 19:54
06/13/08 19:54
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Lite-c is case-sensitive so make sure you define all of your objects correctly.
"Function" with a capital "F" is wrong for creating a function, that's why the compiler is complaining. Use "function" instead of "Function".

C-script didn't care about what case the names of objects were, but lite-c is very strict on it. You get this in higher languages like C++ so it's good programming sense.

Last edited by DJBMASTER; 06/13/08 19:57.
Re: error with script or bug? [Re: DJBMASTER] #210923
06/13/08 20:31
06/13/08 20:31
Joined: Jul 2006
Posts: 76
uk london
F
FireArm Offline OP
Junior Member
FireArm  Offline OP
Junior Member
F

Joined: Jul 2006
Posts: 76
uk london
Originally Posted By: DJBMASTER
Lite-c is case-sensitive so make sure you define all of your objects correctly.
"Function" with a capital "F" is wrong for creating a function, that's why the compiler is complaining. Use "function" instead of "Function".

C-script didn't care about what case the names of objects were, but lite-c is very strict on it. You get this in higher languages like C++ so it's good programming sense.


Thank's mate you learn some new every day!.
i get some error on line 38 now, i guess i got a lot of stuff to check.

i use the syntax check and it finds it to be clean, but when i run the script it reports there is a syntax error on line 38.

Solved

Last edited by FireArm; 06/13/08 21:00.

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

Gamestudio download | 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