2 registered members (OptimusPrime, AndrewAMD),
14,580
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Why is this not working?
#238733
11/29/08 20:13
11/29/08 20:13
|
Joined: Nov 2008
Posts: 25
MrTwiggy101
OP
Newbie
|
OP
Newbie
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. #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
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
BMAP must followed by a star 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.
|
|
|
Re: Why is this not working?
[Re: Lukas]
#238740
11/29/08 21:08
11/29/08 21:08
|
Joined: Nov 2008
Posts: 25
MrTwiggy101
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 25
|
Thank you soooo much!!!! Wow, this community is so helpful, quick, and very knowledgable ine what they do  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: #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: DJBMASTER]
#238748
11/29/08 21:42
11/29/08 21:42
|
Joined: Nov 2008
Posts: 25
MrTwiggy101
OP
Newbie
|
OP
Newbie
Joined: Nov 2008
Posts: 25
|
...Oh wow...Ok, lets remember this. ALWAYS DO SPELL CHECK xD Don't I feel stupid :P Thank you  Now, I am sorry to bother you guys again. But another error came up o.O This is the code now: 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! 
|
|
|
Re: Why is this not working?
[Re: MrTwiggy101]
#238761
11/29/08 22:27
11/29/08 22:27
|
Joined: Nov 2008
Posts: 25
MrTwiggy101
OP
Newbie
|
OP
Newbie
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. 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
|
|
|
|