Gamestudio Links
Zorro Links
Newest Posts
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
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
2 registered members (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
workshop 2 problems #200875
04/05/08 23:28
04/05/08 23:28
Joined: Aug 2007
Posts: 56
Maine
NITRO_2008 Offline OP
Junior Member
NITRO_2008  Offline OP
Junior Member

Joined: Aug 2007
Posts: 56
Maine
Hi,
I am trying to learn lite-C but I had trouble compiling code pasted from the 2cnd workshop. So I did a search here and found out that I must save as a .c file. After I did that I got more errors.

It said that I was missing a bracket, but I cannot find where I am missing it. Here is a screenshot, tell me if you can read it, if you cannot I'll try a different resolution of screenshot.


Thanks

Re: workshop 2 problems [Re: NITRO_2008] #200876
04/05/08 23:37
04/05/08 23:37
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
line 9:

it must be a panel pointer

PANEL* pDisplay =


3333333333
Re: workshop 2 problems [Re: NITRO_2008] #200877
04/05/08 23:39
04/05/08 23:39
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
The first thing I can see is that you have:
PANEL pDisplay = {}
but it has to be a pointer:
PANEL* pDisplay = {}

Last edited by Slin; 04/05/08 23:39. Reason: too late -.- :P
Re: workshop 2 problems [Re: Quad] #200880
04/05/08 23:47
04/05/08 23:47
Joined: Aug 2007
Posts: 56
Maine
NITRO_2008 Offline OP
Junior Member
NITRO_2008  Offline OP
Junior Member

Joined: Aug 2007
Posts: 56
Maine
Yep thanks I had noticed that also and have fixed it in a previous file, but the
"script error missing bracket" message persists even when I make it a pointer. And the script still won't compile.

Any idea?

Now I get the same message as the one above only this time the syntax error is not there.

Re: workshop 2 problems [Re: NITRO_2008] #200883
04/06/08 00:00
04/06/08 00:00
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I just rewrote you code and it works without a problem:
 Code:
#include <acknex.h>
#include <default.c>

var a = 1;
var b = 2;
var c = 0;

PANEL* pDisplay =
{
	digits(35,10,"a = %0.f",*,1,a);
	digits(35,19,"b = %0.f",*,1,b);
	digits(35,28,"c = %0.f",*,1,c);
	flags = VISIBLE;
}

function main()
{
	video_mode = 6;
	screen_color.blue = 150;
	while(1)
	{
		c = a+b;
		wait(1);
	}
}


Other than that function is C-Script, use the datatype of the return value instead which doesn´t exist in your function main and thus "function" should be "void" in the case. But that has nothing to do with your problem...

Re: workshop 2 problems [Re: NITRO_2008] #200885
04/06/08 00:03
04/06/08 00:03
Joined: Aug 2007
Posts: 56
Maine
NITRO_2008 Offline OP
Junior Member
NITRO_2008  Offline OP
Junior Member

Joined: Aug 2007
Posts: 56
Maine
Oh wow. I figured it out and I will write it here in case anyone can tell me why. If you notice in the first screen shot the compiler was still trying to compile test.wdl even after I had changed the filename to test.c. It was very bizarre behavior. When I noticed that I actually had to delete the test.wdl file out of the directory in order for the compiler to only compile the file I was writing. As a result the level runs now.

Thanks a lot. Can anyone tell me why that happened? I guess it doesn't matter, I cannot reproduce it again.

Re: workshop 2 problems [Re: NITRO_2008] #200887
04/06/08 00:09
04/06/08 00:09
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
If you you have a .c file and a .wdl file with the same name (except for the file extension) the .wdl file is compiled too. This is required in the current official release as .wdl files are still needed for giving PATH and PLUGINDIR statements. The current beta version got rid of the need to have a .wdl file for this.

Last edited by Uhrwerk; 04/06/08 00:17. Reason: I am the one that posts faster as his shadow!! *evil-laughter*

Always learn from history, to be sure you make the same mistakes again...
Re: workshop 2 problems [Re: NITRO_2008] #200888
04/06/08 00:12
04/06/08 00:12
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
If there is a .wdl file with the name of the .c file it will be compiled first. This was needed to set things like the plugindir. Just look at the betapage for the PRAGMA_ defines which now replace the need for a .wdl file.
Other than that you can combine C-Script and Lite-C, but that is a bit different because the function main has to be in the .wdl file and you just include the .c file as any other script. That one needs a startup function which works as function main for the lite-c part because it is not possible to share functions or variables or such between them. But that allows for example to use the new postprocessing features in a c-script project.

And I was again too late :P

Last edited by Slin; 04/06/08 00:12.
Re: workshop 2 problems [Re: NITRO_2008] #200889
04/06/08 00:12
04/06/08 00:12
Joined: Aug 2007
Posts: 56
Maine
NITRO_2008 Offline OP
Junior Member
NITRO_2008  Offline OP
Junior Member

Joined: Aug 2007
Posts: 56
Maine
OK I have reposted the original screen shot with some painted blue lines to show you that the compiler seemed to be attempting to compile two scripts at once. See how it was trying to compile the old test_1.wdl?

I was not able to run the new script because the old one was interfering somehow.


I tried to retrace the it again by making new files and testing it but I could not reproduce the problem.

Oh well. Thanks a lot.

Re: workshop 2 problems [Re: Slin] #200892
04/06/08 00:17
04/06/08 00:17
Joined: Aug 2007
Posts: 56
Maine
NITRO_2008 Offline OP
Junior Member
NITRO_2008  Offline OP
Junior Member

Joined: Aug 2007
Posts: 56
Maine
 Quote:
If there is a .wdl file with the name of the .c file it will be compiled first. This was needed to set things like the plugindir. Just look at the betapage for the PRAGMA_ defines which now replace the need for a .wdl file.
Other than that you can combine C-Script and Lite-C, but that is a bit different because the function main has to be in the .wdl file and you just include the .c file as any other script. That one needs a startup function which works as function main for the lite-c part because it is not possible to share functions or variables or such between them. But that allows for example to use the new postprocessing features in a c-script project.

And I was again too late :P


 Quote:
If you you have a .c file and a .wdl file with the same name (except for the file extension) the .wdl file is compiled too. This is required in the current official release as .wdl files are still needed for giving PATH and PLUGINDIR statements. The current beta version got rid of the need to have a .wdl file for this.
Ohh OK. Now I get it. Thanks a lot.


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