Gamestudio Links
Zorro Links
Newest Posts
blogherenowcenter
by 3s05bmmc. 06/05/24 06:08
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 742 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19057 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
´ENTITY´ undeclared identifier #368612
04/26/11 19:46
04/26/11 19:46
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
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:
Code:
...
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] #368613
04/26/11 20:05
04/26/11 20:05
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
make sure you've included acknex.h before pointers. Can't see other reason now

regards

Re: ´ENTITY´ undeclared identifier [Re: Walori] #368623
04/27/11 01:40
04/27/11 01:40
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 Walori!
You´re right: this particular error message disappeared when i included acknex.h, and just to be sure, i also included default.c too (just like in the workshops).
To be double sure, i COPIED the acknex.h and default.c scripts to my game folder, and shall do so to all included scripts inside those.
Problem is: those standard scripts have their own handles and predefined variable names, and i´m worried that sudddenly including them in my code may override or crash with my own variables and pointers... well, tought luck. I´m already receiving different error messages each run because of this wdl/lite-c transition, so it will be a while until i´ll be able to ACTUALLY run the game and see some runtime bugs again.
Thanks once again, dude.

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 Offline OP
Member
Ericmor  Offline 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:
Code:
material material_name 
  {...//options}


is now:
Code:
MATERIAL*  material_name =
  {...//options}


-----------------------------
Code:
text text_name
 {...//text options}


is now:
Code:
TEXT* text_name =
 {...//text options}



-----------------------------
Code:
var array_1[3] = 1,2,3;


is now:
Code:
var array_1[3] = {1,2,3};


--------------------------------------
Code:
string stringname = "-This string!";


is now:
Code:
STRING* stringname - "-This string!";


--------------------------------------
Code:
sound ding_som = <DING.WAV>;


is now:
Code:
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 Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Bumped in some scary ones now.

Code:
function messaging()
{
 PANEL_MESSAGE.visible=on;
 TEXT_WARNING.visible=off;
 TEXT_MESSAGE.visible=on;
 wait(1);
}


is now:
Code:
function messaging()
{
 set(PANEL_MESSAGE, SHOW);
 TEXT_WARNING.flags &= ~SHOW;
 set(TEXT_MESSAGE, SHOW);
 wait(1);
}


------------------------------
Code:
function changedialog()
 {
  text_name.pstring[0]="This...";
  text_name.pstring[1]="...is...";
  text_name.pstring[2]="...SPARTA!";
  wait(1);
 }


is now:
Code:
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:
Code:
...
  COMPILING VARIABLES.C... -[Esc] to abort...
  ERROR IN LINE 2435
  ´transparent´ is not a member of 'ENTITY' 
  ...



...such line that reads:

Code:
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

M
mercuryus
Unregistered
mercuryus
Unregistered
M



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 Offline OP
Member
Ericmor  Offline 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.

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