Black Screen when Test Runing in Lite-C

Posted By: deyshawn

Black Screen when Test Runing in Lite-C - 11/15/08 15:21

Hi,
I am trying to make a basic flight game. I am using the mig.hmp model from the litech workshops and a terrain level which is my own. I have borrowed a lot of code from the Litech workshops. When I test run it, the test run screen is black. but when I run the unmodifyed workshops, they seem to work fine. I deleated the #include <acknex.h> line at the top to see if I could get an error, but i still got the black screen. Does the black screen signify that there is an error with my code, or is there something wrong with the SED itself?

Here is my code:

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

VECTOR jet_speed;
ENTITY* jet;

function main()
{
fps_max = 140;
level_load("riverbed.hmp");
wait (2);
jet = ent_create ("mig.hmp", vector(-400,0,100), NULL);
ph_setgravity (vector(0,0, -386));
phent_settype (jet, PH_RIGID, PH_CUBE);
phent_setmass (jet, 3, PH_CUBE);
phent_setfriction (jet, 80);
phent_setdamping (jet, 40, 40);
phent_setelasticity (jet, 50, 20);
while(1)
{
jet_speed.x = 25 * (key_a - key_d);
jet_speed.y = 25 * (key_w - key_s);
jet_speed.z = 25 * (key_cuu - key_cud);
phent_addtorqueglobal (jet, jet_speed);
camera.x = jet.x - 300;
camera.y = jet.y;
camera.z = jet.z;
camera.tilt = -60;
wait (1);
}
}
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 11/15/08 18:35

Originally Posted By: deyshawn
Does the black screen signify that there is an error with my code, or is there something wrong with the SED itself?

For sure not. Errors are signalized through error messages. Make sure you run the file you're editing by pressing alt + f5. You have to include acknex.h. And it's default.c not defualt.c. Dunnow if that's just a typo here or in your code.
Posted By: MattyTheG

Re: Black Screen when Test Runing in Lite-C - 11/15/08 18:41

I'm actually having the same problem. I was making a game and I wanted a panel which needs to be in a .c file apparently. Anyway I made it .c and then physics didn't work so I put the physics commands in a separate .wdl, but now the level won't load.

I ran the lite-c workshop and it worked fine but when I put it into my script it doesn't work anymore.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 11/15/08 20:25

Uhrwerk: I fixed that problem with #include but I still get a black screen. Also, it isn't just this script that gives, its anything that I try and make. Is is a bug in a7 or the free Lite-C version? Or could there be something wrong with my machine? I am using an Acer Notebook with a processor speed of 1.73GHz, 1014 MG of RAM, and a 32-bit operating system. I have Windows Vista.
Posted By: Hallucinogen

Re: Black Screen when Test Runing in Lite-C - 11/15/08 23:52

level_load("riverbed.hmp");

i may be mistaken but to load a level does it not have to be the .wmb file that it loads? hmp is a terrain file
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 11/15/08 23:59

Originally Posted By: Hallucinogen
level_load("riverbed.hmp");

i may be mistaken but to load a level does it not have to be the .wmb file that it loads? hmp is a terrain file


I am not sure. I am a beginner at programming. If so, how would I compile the terrain.hmp with a sky layer like blood_gorge+6.tga (that is from a workshop). Also, my computer does not recognize .tga and .pcx files. Is this a problem?
Posted By: heinekenbottle

Re: Black Screen when Test Runing in Lite-C - 11/16/08 01:29

Never mind, i just read in help that Level_load accepts .hmp and .hmp was not listed in the help on ent_create.
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 11/16/08 01:56

Well, although I wouldn't use vista with an 1.7 GHz processor your laptop should be fine. And I've never heard of a bug like that. Please click on teh gears icon in the top toolbar of sed with the name "preferences" and ensure there is the file you want to run given under "Main Script to run / publish". A black engine window with nothing more is normally the result of an empty script. If that doesn't work, try a "printf("test");" at the very beginning of your main function. Is there then a message box appearing saying "test"? Also ensure you saved your file with the extension ".c".
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 11/16/08 02:25

Originally Posted By: Uhrwerk
Well, although I wouldn't use vista with an 1.7 GHz processor your laptop should be fine. And I've never heard of a bug like that. Please click on teh gears icon in the top toolbar of sed with the name "preferences" and ensure there is the file you want to run given under "Main Script to run / publish". A black engine window with nothing more is normally the result of an empty script. If that doesn't work, try a "printf("test");" at the very beginning of your main function. Is there then a message box appearing saying "test"? Also ensure you saved your file with the extension ".c".


There was no file given under "Main Script to run / publish" however, when I chose the script I have been wanting to run (I called it "flightscript.C")and then test run, I still get a black screen. The "printf("test");" didn't do anything.
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 11/16/08 02:37

Ensure you have the file name including the complete path to the script selected "Main Script to publish / run". Alternatively press Alt + F5 when you got your script opened in the editor. as long as the test message does not appear and you don't get error messages the engine is not running your script. If that doesn't fix the problem maybe your installation is corrupted. What version of Game Studio do you use?
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 11/16/08 22:03

I use the Free Lite0C version of the a7 game engine. I did as you suggested in you last post, but that did not fix anything. I guess it is possible that the installation was corrupted, however, it runs the workshops fine.
I can only open the samples to the workshops, not the actual tutorials themselves. When I try, it says "there is a problem with your internet connection", but my internet connection is working. I wondering if the 2 problems are related. I downloaded both in the "Download" section of this site.
Posted By: sadsack

Re: Black Screen when Test Runing in Lite-C - 11/16/08 22:25

Make sure you are using .c files, If you do not save your files like this
(filename.c) they will not save as a .c file. and when you try to run it you get a black screen.
renny
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 11/17/08 02:35

Please try the following:
1. Open sed and create a new empty script.
2. Paste the follwing code into your empty script:
Code:
#include "acknex.h"
void main()
{
  printf("It's working! :-)");
}

3. Save the script on your desktop (or somewhere else you get fast access to) under the name "test.c". Make sure you select .c file as extension under the file name in the save dialog and type the .c at the end of the file name additionally.
4. Click the gears icon to go to the preferences.
5. Select the file test.c that you have just created as "File to run / publish".
6. Check the checkbox that says diag. After cheking it there should be "-diag" under command line options.
7. Close the dialog with the ok button.
8. Hit the black triangle in the top toolbar to launch the engine.
9. There should be a message box popping up. (If it doesn't there is something wrong. Just continue with 10. We'll try to fix that...)
10. Go to your desktop or whereever you saved the file and look for a file "acklog.txt".
11. Post the content of this file in this thread.
Posted By: nebulus

Re: Black Screen when Test Runing in Lite-C - 11/19/08 14:56

Hi all,

Make sure you save your code with the .c at the end before you execute/compile it. Every time you make a change save it and the execute/compile. It works for me.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/01/08 16:49

Sorry I have replayed sooner. I will do as you say when I get to my computer.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/01/08 21:51

I did all of your steps in order and it wouldn't run. Here's what the acklog said:

Log of Atari Lite-C 1.10.2 run at Mon Dec 01 16:47:55 2008
Jake on Windows NT/2000/XP version 6.0 Build 6000
Options test.c -eq -diag -te

App C:\Program Files\Lite-C\acknex.exe in C:\Users\Jake\Desktop\
MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
Atari Lite-C - Free Edition V1.10.2 - Jul 10 2008
Development version

Mouse found
Speakers (Realtek High Definition Audio) opened
Mobile Intel(R) 965 Express Chipset Family pure T&L device 1ff9 detected
D3D device Mobile Intel(R) 965 Express Chipset Family 1ff9 selected.
PATH C:\Program Files\Lite-C\code\
Compiling TEST.C - [Esc] to abort..
Error in 'MAIN' line 1: Include file acknex.h not found

< #include "acknex.h"
>

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

< printf("It's working! :-)");
>
.. 0.003 sec
Can't compile TEST.C
Startup failure - any key to abort
Posted By: pewpew

Re: Black Screen when Test Runing in Lite-C - 12/01/08 23:15

I have had a few problems loading levels. The problem was (and still is) directory issues. For some reason i couldnt leave the MODELS for a specific level in ANY other folder, than the location of the scripts themselves.

Try putting all required files into a same directory and see how you go..
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 12/02/08 13:39

I am sorry. My fault. It has to be

Code:
#include <acknex.h>
#include <stdio.h>
void main()
{
  printf("It's working! :-)");
}

Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/02/08 22:08

Alrght, I did it again with the new code. Here are the results:

Log of Atari Lite-C 1.10.2 run at Tue Dec 02 17:06:48 2008
Jake on Windows NT/2000/XP version 6.0 Build 6000
Options test.c -eq -diag -te

App C:\Program Files\Lite-C\acknex.exe in C:\Users\Jake\Desktop\
MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
Atari Lite-C - Free Edition V1.10.2 - Jul 10 2008
Development version

Mouse found
Speakers (Realtek High Definition Audio) opened
Mobile Intel(R) 965 Express Chipset Family pure T&L device 1ff9 detected
D3D device Mobile Intel(R) 965 Express Chipset Family 1ff9 selected.
PATH C:\Program Files\Lite-C\code\
Compiling TEST.C - [Esc] to abort.. ...
_filbuf: function not found
_flsbuf: function not found. .. 0.168 sec
Running TEST.C.
2 objects
Main started
D3D_Init Window: 640x480 -> Window: 1x640x480x32
Video memory found: 248 MB
Main loop..........ok
1st frame - 253952K.. ok
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 12/03/08 22:00

Excellent. You got it running. From here you can paste you own code line by line into the new file you just created. This way you can exactly identify the line that is causing the trouble.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/03/08 23:36

It stops working at this line:

video_mode 7;

Here is the whole thing again:

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

VECTOR jet_speed;
ENTITY* jet;

function main()
{
video_mode 7;
set(pSplash,VISIBLE);
wait (3);

printf("test");
fps_max = 140;
level_load("riverbed.hmp");
ent_createlayer("blood_gsmall+6.tga", SKY | CUBE | VISIBLE, 0);
wait (2);
jet = ent_create ("mig.hmp", vector(-400,0,100), NULL);
ph_setgravity (vector(0,0, -386));
phent_settype (jet, PH_RIGID, PH_CUBE);
phent_setmass (jet, 3, PH_CUBE);
phent_setfriction (jet, 80);
phent_setdamping (jet, 40, 40);
phent_setelasticity (jet, 50, 20);
while(1)
{
jet_speed.x = 25 * (key_a - key_d);
jet_speed.y = 25 * (key_w - key_s);
jet_speed.z = 25 * (key_cuu - key_cud);
phent_addtorqueglobal (jet, jet_speed);
camera.x = jet.x - 300;
camera.y = jet.y;
camera.z = jet.z;
camera.tilt = -60;
wait (1);
}
}

i don't know what I did wrong or I would fix it. I don't get the black screen, just an error message. up until this point, it displayed both the message you gave me and the black screen.
Posted By: DJBMASTER

Re: Black Screen when Test Runing in Lite-C - 12/04/08 01:55

it has to be "video_mode = 7;"
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/04/08 03:26

I changed it but I still get the black screen.
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 12/04/08 21:08

Please post the new content of the ackog.txt again...
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/04/08 21:56

here is the contents of the acklog:

Log of Atari Lite-C 1.10.2 run at Wed Dec 03 18:33:30 2008
Jake on Windows NT/2000/XP version 6.0 Build 6000
Options test.c -eq -diag -te

App C:\Program Files\Lite-C\acknex.exe in C:\Users\Jake\Desktop\
MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
Atari Lite-C - Free Edition V1.10.2 - Jul 10 2008
Development version

Mouse found
Speakers (Realtek High Definition Audio) opened
Mobile Intel(R) 965 Express Chipset Family pure T&L device 1ff9 detected
D3D device Mobile Intel(R) 965 Express Chipset Family 1ff9 selected.
PATH C:\Program Files\Lite-C\code\
Compiling TEST.C - [Esc] to abort..
Error in 'MAIN' line 12: syntax error

< video_mode 7;
>
.. 0.096 sec
Can't compile TEST.C
Startup failure - any key to abort
Program aborted
Close level,DLL,objects
Free input,funcs,panels,defs,syns,views,strings,vars..ok
Free sounds,bmaps,fonts,hash,defs1,script..ok
Close dx,multimedia,D3D,engine,physics,nexus..ok
Atari Lite-C - Free Edition V1.10.2 - Jul 10 2008
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
Close window

But I know that that is not right because I changed the "video_mode 7;" to "video_mode = 7;" but it doesn't say that in teh acklog, which makes me think that is for someone reason not recognizing the enw code. Also, when I run, i don't get any errors like the acklog says, just the black screen. I am wondering if I just had a bad install (though I can still play the examples in the workshops).
Posted By: Uhrwerk

Re: Black Screen when Test Runing in Lite-C - 12/04/08 22:44

If you corrected video_mode = 7; and this is really the file you're running then I am at the end of ideas. Sorry. Only advice: doublecheck everything written here so far.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/06/08 15:13

Ok, thankyou for your help. I will try uninstalling and reinstalling both it and the workshops. If they still both act weird, then I will asume that it is my machine that is the problem. Again, thankyou for your help.

-deyshawn
Posted By: testDummy

Re: Black Screen when Test Runing in Lite-C - 12/06/08 16:03

Code:
jet = ent_create ("mig.hmp", vector(-400,0,100), NULL);

jet / mig is not .mdl!?
turn splash screen off
use [ code ] [ code ] tags

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

VECTOR jet_speed;
ENTITY* jet;

function main() {
	video_mode = 7;
	//set(pSplash,VISIBLE);	// splash screen on
	//wait(-3);
	//reset(pSplash, VISIBLE);	// splash screen off
	
	printf("test");
	fps_max = 140;
	level_load("riverbed.hmp");
	ent_createlayer("blood_gsmall+6.tga", SKY | CUBE | VISIBLE, 0);
	wait(2);
	jet = ent_create ("mig.mdl", vector(-400,0,100), NULL);
	ph_setgravity (vector(0,0, -386));
	phent_settype (jet, PH_RIGID, PH_CUBE);
	phent_setmass (jet, 3, PH_CUBE);
	phent_setfriction (jet, 80);
	phent_setdamping (jet, 40, 40);
	phent_setelasticity (jet, 50, 20);
	while(1) {
		jet_speed.x = 25 * (key_a - key_d);
		jet_speed.y = 25 * (key_w - key_s);
		jet_speed.z = 25 * (key_cuu - key_cud);
		phent_addtorqueglobal (jet, jet_speed);
		camera.x = jet.x - 300;
		camera.y = jet.y;
		camera.z = jet.z;
		camera.tilt = -60;
		wait (1);
	}
}

Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/06/08 16:15

I checked and yes it is a .mdl, so I changed and still get the black screen. Does it matter that my script is a .wdl format? I thought it was the same as .c but I wanted to check.
Posted By: testDummy

Re: Black Screen when Test Runing in Lite-C - 12/06/08 16:20

Try turning off the splash screen, if it is on. (see above)
The file should probably be saved as .c, not .wdl (C-Script).
#include (<- this is .c -like syntax)

Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/06/08 19:40

I did what you siad to turn off th splash screen, but that didn't seem to change anything. Also, how do I change a file from a .wdl to a .c? I can't change it in the properties and I can't change when I try to overite it in a new save.
Posted By: DJBMASTER

Re: Black Screen when Test Runing in Lite-C - 12/06/08 19:59

open the .wdl file in SED. go to file>save and explicitly type ".c" after the filename, and press save. It should save as a seperate .c file.

You will want to rename or delete the .wdl file. If a .c file finds a .wdl file with the same name in the same directory it will attempt to read that file also.
Posted By: deyshawn

Re: Black Screen when Test Runing in Lite-C - 12/06/08 20:50

Thankyou very much. I changed to a .c and I don't get a black screen anymore! I get error messages! YAY! But no worries, it's just my crappy code. It doesn't like my "set(pSPLASH, VISIBLE);" line, nor any other line after. But, Oh well. I will eventually figure all of that out. Oh, I figured out how to see those workshops. All I had to do was unblock them in the properties menu. Thanks again everyone for all of your help.
-Deyshawn
© 2024 lite-C Forums