2012-02-07 10:55:38

Hi,
I am trying to make a stopwatch for my computer simulator, but it fales. It gives one of the errors that I hate. Can somebody look at this? Also, it gives this error in a few voids, so if there is not an error, I will post the other voids.
void stopwatch() {
timer stopwatchtimer;
stopwatchtimer.pause();
sound clock;
clock.load("vista/clock.wav");
v.speak_wait("Welcome to the stopwatch! Press space to pause/resume the timer, press t to learn how much time was elapsed in miliseconds, and press escape to quit.");
while(true) {
if(key_pressed(KEY_SPACE)) {
if(stopwatchtimer.running==true) {
stopwatchtimer.pause();
clock.pause();
v.speak_wait("Timer paused.");
}
else {
stopwatchtimer.resume();
clock.play_looped();
v.speak_wait("Timer resuming.");
}
}
if(key_pressed(KEY_T)) {
clock.pause();
stopwatchtimer.pause();
v.speak_wait(stopwatch.elapsed()+"miliseconds were elapsed.");
stopwatchtimer.resume();
clock.play_looped();
}
if(key_pressed(KEY_ESCAPE)) {
clock.stop();
stopwatchtimer.pause();
stopwatchtimer.restart();
v.speak_wait("Exiting...");
programs();
}
wait(5);
}
}
}

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2012-02-07 17:37:08

That code sounds correct to me Burak. I have had my share of BGT errors, what with running my scripts and such. So this computer simulator game is a VM of sorts in BGT? If I could only get it working...That would be so cool!

“Can we be casual in the work of God — casual when the house is on fire, and people are in danger of being burned?” — Duncan Campbell
“There are four things that we ought to do with the Word of God – admit it as the Word of God, commit it to our hearts and minds, submit to it, and transmit it to the world.” — William Wilberforce

2012-02-07 19:10:40

What's the problem with running it?

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2012-02-07 19:27:05

hi burak,
considerably a very good effort, keep on working like that.

well i dont have any suggestions related to code to give at this time, what kind of errors you get

He picked up the wrench and broke the guy’s wrist with it, one, and then the other wrist, two, and turned back and did the same to the guy who had held the hammer, three, four. The two men were somebody’s weapons, consciously deployed, and no soldier left an enemy’s abandoned ordnance on the field in working order.

2012-02-08 00:57:33

I can't run source code games, remember? I get the "does not define void main ()" error with every script I run.

“Can we be casual in the work of God — casual when the house is on fire, and people are in danger of being burned?” — Duncan Campbell
“There are four things that we ought to do with the Word of God – admit it as the Word of God, commit it to our hearts and minds, submit to it, and transmit it to the world.” — William Wilberforce

2012-02-08 19:23:59

Hi,
I get the following:
File: C:\Documents and Settings\Admin\Desktop\programlar\oyunlar\Computer_simulator_1.1\Computer simulator\computer_simulator.bgt
On line: 168 (1)
Information: Compiling void programs()

File: C:\Documents and Settings\Admin\Desktop\programlar\oyunlar\Computer_simulator_1.1\Computer simulator\computer_simulator.bgt
On line: 192 (1)
Line: void setup_sim() {
Error: Expected expression value

File: C:\Documents and Settings\Admin\Desktop\programlar\oyunlar\Computer_simulator_1.1\Computer simulator\computer_simulator.bgt
On line: 220 (1)
Line: void games() {
Error: Expected expression value

File: C:\Documents and Settings\Admin\Desktop\programlar\oyunlar\Computer_simulator_1.1\Computer simulator\computer_simulator.bgt
On line: 236 (1)
Line: void stopwatch() {
Error: Expected expression value

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page

2012-02-10 21:38:24

ah, you have  probably used a brace in the wrong place
you didn't close the programs function, so you have wryten several functions in the same function

2012-02-10 23:37:15

Aw! I will look at it later.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page