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 (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 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
Why is this not working? #238733
11/29/08 20:13
11/29/08 20:13
Joined: Nov 2008
Posts: 25
M
MrTwiggy101 Offline OP
Newbie
MrTwiggy101  Offline OP
Newbie
M

Joined: Nov 2008
Posts: 25
Hey everybody! I just recently began learning C++/Lite-C scripting/programming. I read on some tutorials and sites that the best thing to do, is to start small, like create a pong game. So, that is exactly what I am doing. I am going to create a simple pong game to give me a little bit of practice and experience, but early on, I have run into some problems o.O

So, this is what I have so far.

Quote:
#include <achnex.h>

var tops_score = 0;
var bottoms_score = 0;
BMAP left_border = "border_left.bmp"
PANEL border_left =
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = left_border
flags = VISIBLE
}

function main()
{

screen_color.blue = 150;
}


Now, the function main part is fine, it does what it is supposed to do. I have already created the 'graphics' for the game, such as the ball, pong, border, etc... and I put them in the same folder as the script. But, when I try to test run that, it comes up with like a whole bunch of errors saying why it can't run the test thing, and this is like what it says.

< BMAP left_border = ''border_left.bmp'' PANEL border_left = {>
PING_PONG_TEST.WDL 8:0 (): Parameter unknown BMAP bad keyword in {}

and then it says that about everything else, like the pos_x =, the layer =, the pos_y =, the flags, it says that it is a parameter unknown pos_x or flags bad keyword in {}. I am using the stuff exactly as it says in the workshop stuff, and it isn't working? How come?

Re: Why is this not working? [Re: MrTwiggy101] #238736
11/29/08 20:51
11/29/08 20:51
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
BMAP must followed by a star
Code:
BMAP* name = "filename.ending";


Same for PANEL, STRING, SOUND...



And remember to pu a ; at the end of every parameter and code line.

Last edited by xXReapeRXx; 11/29/08 20:52.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Why is this not working? [Re: MrTwiggy101] #238737
11/29/08 20:53
11/29/08 20:53
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
You obviously saved your script as *.wdl file instead of a *.c-file. *.wdl is C-Script, *.c is Lite-C, so you have to save it as *.c-file if you want to use Lite-C.

Errors in your script:
Code:
#include <achnex.h>

var tops_score = 0;
var bottoms_score = 0;
BMAP* left_border = "border_left.bmp" // asterisk and semicolon missing
PANEL* border_left = // asterisk
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = left_border; //semicolon
flags = VISIBLE; //semicolon
}

function main()
{

screen_color.blue = 150;
}


EDIT: xXReapeRXx was faster...

Last edited by Lukas; 11/29/08 20:54.
Re: Why is this not working? [Re: Lukas] #238740
11/29/08 21:08
11/29/08 21:08
Joined: Nov 2008
Posts: 25
M
MrTwiggy101 Offline OP
Newbie
MrTwiggy101  Offline OP
Newbie
M

Joined: Nov 2008
Posts: 25
Thank you soooo much!!!! Wow, this community is so helpful, quick, and very knowledgable ine what they do laugh

I just have one more question. I did what you guys said, I switched it to .c extension, and I put the semicolons on, and then I put the asteriks* on BMAP and PANEL, but now, when I try it, there are 2 errors.

This is how the code looks now:

Quote:
#include <achnex.h>

var tops_score = 0;
var bottoms_score = 0;
BMAP* left_border = "border_left.bmp";
PANEL* border_left =
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = left_border
flags = VISIBLE
}

function main()
{

screen_color.blue = 150;
}


This is what it says when I try to test run it.

Compiling PING_PONG_TEST2.C...
Error in 'MAIN' line 2: Include file achnex.h not found

<#include <achnex.h> >

Error in 'MAIN' line 4: 'var' undeclared identifier

< var tops_score = 0; >

.
Can't compile PING_PONG_TEST2.C
Startup failure - any key to abort



PS: I took out the #include <achnex.h> line of code, and it cut out that error when trying to run it, so I guess I didn't need that. But now, it still says that my 'var top_score = 0;' that 'var' is undeclared identifier. What does this mean?

Last edited by MrTwiggy101; 11/29/08 21:11.
Re: Why is this not working? [Re: MrTwiggy101] #238745
11/29/08 21:32
11/29/08 21:32
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
you spelt "acknex.h" wrong. It cant use a var because it doesnt know what the structure is like, which is given in acknex.h.

add these 2 lines at the beginning of your script...

#include <acknex.h>
#include <default.c>

Re: Why is this not working? [Re: DJBMASTER] #238748
11/29/08 21:42
11/29/08 21:42
Joined: Nov 2008
Posts: 25
M
MrTwiggy101 Offline OP
Newbie
MrTwiggy101  Offline OP
Newbie
M

Joined: Nov 2008
Posts: 25
...Oh wow...Ok, lets remember this. ALWAYS DO SPELL CHECK xD Don't I feel stupid :P

Thank you laugh

Now, I am sorry to bother you guys again. But another error came up o.O

This is the code now:

Quote:
var top_score = 0;
var bottom_score = 0;
BMAP* left_border = "border_left.bmp";
PANEL* border_left =
{ // This is PANEL for Left Border
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = left_border
flags = VISIBLE
}






function main()
{//This is the blue screen color
screen_color.blue = 150;
}


This is the error that comes up:

Compiling PING_PONG_TEST2.C...
< bmap = left_border flags = VISIBLE }>
PING_PONG_TEST2.C 6:-1 (): Script error last line
.
Startup failure - any key to abort

Thanks for the help guys. Now, if only someone could help me with this last error! laugh

Re: Why is this not working? [Re: MrTwiggy101] #238749
11/29/08 21:46
11/29/08 21:46
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
where are your ";" after "bmap = left_border" & "flags = VISIBLE"?

Every statement has to end with ;

Re: Why is this not working? [Re: DJBMASTER] #238753
11/29/08 21:53
11/29/08 21:53
Joined: Nov 2008
Posts: 25
M
MrTwiggy101 Offline OP
Newbie
MrTwiggy101  Offline OP
Newbie
M

Joined: Nov 2008
Posts: 25
*SMACKS HEAD*

Thanks :P

But now, when I run it, it doesn't show any errors. But it loads up, shows a black screen, then it says this:

acknex.exe has stopped working

and then it says that it stopped working and closes it?

I think it might have something to do with my image. I made it in photoshop, its a simple line that is supposed to be the border of the left side of the game, its red, and I saved it as a .bmp. Whats wrong?

Re: Why is this not working? [Re: MrTwiggy101] #238761
11/29/08 22:27
11/29/08 22:27
Joined: Nov 2008
Posts: 25
M
MrTwiggy101 Offline OP
Newbie
MrTwiggy101  Offline OP
Newbie
M

Joined: Nov 2008
Posts: 25
...xD Omg. I just spent the last 20 minutes trying to figure out why it kept on crashing...when finally, I saw it.

Quote:

var top_score = 0;
var bottom_score = 0;
BMAP* left_border = "left_borderr.pcx";
PANEL* border_left =
{ // This is PANEL for Left Border
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = border_left;
flags = VISIBLE;
}



Lol, I had originally identified and defined the bitmap as left_border, but then for the panel, I told it to look for border_left xD Oh well, I guess this is how you learn eh? :P

Re: Why is this not working? [Re: MrTwiggy101] #238762
11/29/08 22:34
11/29/08 22:34
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Gotta love the hard way smile


Click and join the 3dgs irc community!
Room: #3dgs

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