1 registered members (AndrewAMD),
742
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
´ENTITY´ undeclared identifier
#368612
04/26/11 19:46
04/26/11 19:46
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
I´m trying convert my old game project from .wdl to Lite.c, and this time i can´t understand what´s happening. I have several entity pointers declared on the starter script, like:
...
ENTITY* camera_arrow;
ENTITY* player_weapon;
ENTITY* playershield;
...
...but this time, the engine crashes and says that 'entity' is a undeclared identifier! What the hell! In .wdl, those pointers needed to be declared in the starterscript, outside any functions, like a variable... but now... now, what?!? In the manual, the ENTITY* pointer has the same format... what´s happening? Manual hasn´t been updated correctly? I made a mistake? Pointer need to be inside MAIN or another function?!? Any help is appreciated, thanks in advance.
|
|
|
Re: ´ENTITY´ undeclared identifier
[Re: Ericmor]
#368625
04/27/11 02:31
04/27/11 02:31
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
The amount of syntax changes is scary. Still, is far more pratical to change every single one of them than re-code the entire game mechanics. I thinking on using this very thread to record most of them. I already fixed five, so far:
material material_name
{...//options}
is now:
MATERIAL* material_name =
{...//options}
-----------------------------
text text_name
{...//text options}
is now:
TEXT* text_name =
{...//text options}
----------------------------- is now:
var array_1[3] = {1,2,3};
--------------------------------------
string stringname = "-This string!";
is now:
STRING* stringname - "-This string!";
--------------------------------------
sound ding_som = <DING.WAV>;
is now:
SOUND* ding_sound = "DING.wav";
...and so forth. I know, minimal changes, etc... but to FIND the correct syntax example in the manuals and replace ALL them, every frigging engine change, is plain torture.
|
|
|
Re: ´ENTITY´ undeclared identifier
[Re: Ericmor]
#368626
04/27/11 05:32
04/27/11 05:32
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Bumped in some scary ones now.
function messaging()
{
PANEL_MESSAGE.visible=on;
TEXT_WARNING.visible=off;
TEXT_MESSAGE.visible=on;
wait(1);
}
is now:
function messaging()
{
set(PANEL_MESSAGE, SHOW);
TEXT_WARNING.flags &= ~SHOW;
set(TEXT_MESSAGE, SHOW);
wait(1);
}
------------------------------
function changedialog()
{
text_name.pstring[0]="This...";
text_name.pstring[1]="...is...";
text_name.pstring[2]="...SPARTA!";
wait(1);
}
is now:
function changedialog()
{
(text_name.pstring)[0]="This...";
(text_name.pstring)[1]="...is...";
(text_name.pstring)[2]="...SPARTA!";
wait(1);
}
I think i´ll stop bugging you guys with the problems that i ACTUALLY solved. The process is simple: engine report syntax error, you start to search over the ENTIRE godamn manual to anything remotely similar to what you´re doing until you find the nearest example and guess how it should fit in your code. Now i have this:
...
COMPILING VARIABLES.C... -[Esc] to abort...
ERROR IN LINE 2435
´transparent´ is not a member of 'ENTITY'
...
...such line that reads:
function fast_fadein(A,B)
{
...
my.transparent=on;
...
}
Aparently, the 'transparent' flag isn´t used anymore, and i have no clue to where i should refer in to find the new syntax (i don´t even remember where this damn fast fadein where used, in entities, particles or panels). Add this to replacing 15.000 lines of the same problem, and now i understand why so many projects where abandoned.
|
|
|
Re: ´ENTITY´ undeclared identifier
[Re: Ericmor]
#368628
04/27/11 05:51
04/27/11 05:51
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
set (me, TRANSLUCENT); // TRANSLUCENT not TRANSPARENT!
|
|
|
Re: ´ENTITY´ undeclared identifier
[Re: ]
#368720
04/27/11 19:37
04/27/11 19:37
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Thanks mercuryus, it helped! While looking into yet another syntax error, i found a part of the manual describing all steps and some tools to convert .wdl to lite-c: "You can use text conversion software for making this easier. ReplaceEm ( f.i. at http://www.freeware-archiv.de/BKReplaceEm-Dateien.htm) is a free tool that can be used to almost automatically cleaning up your C-Script code and then converting it to lite-C. Here are two replace tables for this tool: wdl_to_wdl.txt fixes sloppy code in your C-Script file, and wdl_to_c.txt converts it to lite-C afterwards. Still, in many cases the conversion will require manual steps as described below, but the two automatic replace operations should cover 70% of the task." Problem is, the ReplaceEm tool is all in a GERMAN download page and i couldn´t get the program. Someone know if there´s a english version? Where to get it? Thanks again.
Last edited by Ericmor; 04/28/11 04:12.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|