2020-06-30 00:58:01

hello guys. i was experementing with bgt, and i struggled with errors. as soon as i try to fix one, two others apeer, and when i try to change a string, errors come and blow my mind down, then i go like, what in the world of pikacchus is rong with this thing. any ways here is the code
string name;
void main() {
name=input_box("hello","please enter your name in the box bellow");
if(name=="bla"); {
alert("hey you","that's not your name");
exit();
}
alert("hey"+" "+name+","+"how are you doing today");
}
and here's the error pac that made me see the sun of the night
File: C:\Users\ilyas\practise1.bgt
On line: 2 (1)
Information: Compiling void main()

File: C:\Users\ilyas\practise1.bgt
On line: 4 (16)
Line: if(name=="bla"); {
Error: If with empty statement

File: C:\Users\ilyas\practise1.bgt
On line: 8 (1)
Line: alert("hey"+" "+name+","+"how are you doing today");
Error: No matching signatures to 'alert(string)'

File: C:\Users\ilyas\practise1.bgt
On line: 8 (1)
Information: Candidates are:

File: C:\Users\ilyas\practise1.bgt
On line: 8 (1)
Information: bool alert(const string&in, const string&in)

hope i figure it out.
oh, and note, i didn't learn from the bgttutorial. if that helps
goodday evry one

I am a hunter named Grunt. I didn't realize that until now.

2020-06-30 01:00:58

You don't need semicolons after if statements and you had way too many "+ in the alert call. . Here is your fixed code.
string name;
void main() {
name=input_box("hello","please enter your name in the box bellow");
if(name=="bla") {
alert("hey you","that's not your name");
exit();
}
alert("he y "+name+", "how are you doing today");
}

2020-06-30 02:50:55

Also, it'd probably help if you read the tutorial first...

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2020-06-30 20:59:56

ah. ok thanks for the help and suggestion. this will be the topic for all my bgt errors

I am a hunter named Grunt. I didn't realize that until now.

2020-07-02 07:30:31 (edited by lukas 2020-07-02 07:31:10)

Actually, the fix from post 2 still wouldn't work because that still leaves the second alert call with just one string parameter, not two. Here goes the offending line again:
alert("hey "+name, "how are you doing today");
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2020-07-02 12:35:37

hey. this is a game for my brother that i am building for him. please help me with the code. i want your opinions in it because if i compile it it produces sounds errors because i didn't provide sounds yet (cuting each sound on it's own and) yeah so. here is the code?
pikabox=input_box("enter some text for pikachu to respond to");
void main()
{
if (pikabox==("hi!"));
sound.load("sounds\pikahi.ogg");
sound.play
}
if pikabox==("what's your name?") {
sound.load("sounds\mynamepikachu.ogg");
sound.play
}
if pikabox==("use thunderbolte") {
sound.load("sounds\thunderbolte.ogg");
}

I am a hunter named Grunt. I didn't realize that until now.

2020-07-02 15:20:20

I personally will not fix your code unless you actually read the tutorial, which from the looks of what you posted you haven’t.

2020-07-02 16:09:13

i couldn't understand that tutorial

I am a hunter named Grunt. I didn't realize that until now.

2020-07-02 19:48:31

How? That tutorial is one of the easiest to understand Tutorials I've found, and I've looked througgh a good amount.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2020-07-02 19:52:09 (edited by amerikranian 2020-07-02 20:31:38)

What exactly confuses you? We need more details in order to be able to assist you.

2020-07-02 21:18:55

i don't know what a class does and what is good for, and i don't know what do handels do

I am a hunter named Grunt. I didn't realize that until now.

2020-07-02 21:38:05

It’s a good thing that you don’t have to learn about them yet. Start off with the basics. Don’t skip sections.

2020-07-02 23:41:04

do you meen i don't need classes and handles to make a game like that?

I am a hunter named Grunt. I didn't realize that until now.

2020-07-02 23:44:15

You do, but you need to understand the basics first. If you can't write a simple program you have shown correctly here correctly, classes are way beyond you. Like I said, go back to the earlier sections of the tutorial, you need to learn the basics first.

2020-07-03 00:21:06 (edited by redfox 2020-07-03 00:21:42)

If you're talking about the program you were talking about earlier in this topic, then I'm dying on the floor laughing. You barely need a function to make that game.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)