2018-07-17 20:57:31

so i'm making a game to experiment with

but it's giving me weird errors, m_pro is the include i used to make the menu. if you could tell me the problems so i can fix i would apriciate it.
thanks!

----------
“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)

2018-07-17 20:59:00

the db link is
https://www.dropbox.com/sh/sdxpvpyc5ape … Kq0Oa?dl=0

----------
“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)

2018-07-17 22:31:20

1, when you start a class instance you don't put the semicolon between the type and the variable, or else you're defining 2 different statements.
The correct code should be:
dynamic_menu_pro menu;
when you define directories, use the slash (/) instead.

Paul

2018-07-17 23:14:15 (edited by redfox 2018-07-17 23:15:04)

i fixed everything you said and wen running it these are the errors

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 8 (1)
Line: sound_pool spool;
Error: Identifier 'sound_pool' is not a data type

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 139 (1)
Information: Compiling void dynamic_menu_pro::play_click_sound()

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 143 (6)
Line: spool.play_stationary_extended(click_sound, false, 0, (menu_position*100/get_item_count())-50, 0, 100, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 145 (6)
Line: spool.play_stationary(click_sound, false, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 148 (1)
Information: Compiling void dynamic_menu_pro::play_edge_sound()

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 152 (6)
Line: spool.play_stationary_extended(edge_sound, false, 0, (menu_position*100/get_item_count())-50, 0, 100, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 154 (6)
Line: spool.play_stationary(edge_sound, false, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 157 (1)
Information: Compiling void dynamic_menu_pro::play_enter_sound()

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 161 (6)
Line: spool.play_stationary_extended(enter_sound, false, 0, (menu_position*100/get_item_count())-50, 0, 100, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 163 (6)
Line: spool.play_stationary(enter_sound, false, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 256 (1)
Information: Compiling int dynamic_menu_pro::run_extended(string, bool, int, bool)

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 358 (6)
Line: spool.play_stationary(open_sound, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 721 (6)
Line: spool.play_stationary(wrap_sound, false);
Error: Illegal operation on 'int&'

File: C:\Downloads\BGT\include\m_pro.bgt
On line: 753 (6)
Line: spool.play_stationary(wrap_sound, false);
Error: Illegal operation on 'int&'

File: E:\finger on the trigger\src\fott.bgt
On line: 3 (1)
Information: Compiling void main()

File: E:\finger on the trigger\src\fott.bgt
On line: 11 (5)
Line: menu.enable_sidescrolling = true;
Error: 'enable_sidescrolling' is not a member of 'dynamic_menu_pro'

File: E:\finger on the trigger\src\fott.bgt
On line: 19 (14)
Line: if (abcd = 0 or abcd = 3)
Error: No conversion from 'int' to 'bool' available.

File: E:\finger on the trigger\src\fott.bgt
On line: 19 (14)
Line: if (abcd = 0 or abcd = 3)
Error: No conversion from 'int' to 'bool' available.

File: E:\finger on the trigger\src\fott.bgt
On line: 19 (12)
Line: if (abcd = 0 or abcd = 3)
Error: Expression is not an l-value

----------
“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)

2018-07-17 23:24:59

Right let me restart because I sucked and didn't explain like  I should have.

1. fix the datatype of the menu.
Since your code defines a semicolon after dynamic_menu_pro, it won't be assigned to the variable menu.
you should do this:
dynamic_menu_pro menu;
2. use the slash (/) sign instead for the directories.
3. it's enable_side_scrolling, not enable_sidescrolling
4. when you are in a conditional statement you should use == instead of =.
Hope I didn't suck this time. big_smile

Paul

2018-07-17 23:32:57

thank you for the help that explains a lot, i'll fix all this wen i'm done eating, btw, wow really fast reacting to my post

----------
“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)

2018-07-18 12:28:20

The error your getting which says sound_pool is not a data type, You need to include that sound_pool class into your game like this: #include"sound_pool.bgt"

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2018-07-18 17:05:59

ok i fixed everything that you too said, and the following errors occured
File: E:\finger on the trigger\src\fott.bgt
On line: 4 (1)
Information: Compiling void main()

File: E:\finger on the trigger\src\fott.bgt
On line: 19 (6)
Line: abcd == menu.run("main menu. use your right and left arrows to move, and enter to activate an option.", true);
Warning: 'abcd' is not initialized.



the current source is

#include"m_pro.bgt";
#include"sound_pool.bgt";

void main()
{
dynamic_menu_pro menu;
menu.wrap == true;
menu.wrap_sound == "sounds/menu/wrap.ogg";
menu.click_sound == "sounds/menu/click.ogg";
menu.enter_sound == "sound/menu/enter.ogg";
menu.add_music("sounds/menu/music.ogg");
menu.enable_side_scrolling == true;
menu.enable_left_and_right == true;
menu.allow_escape == true;
menu.add_item_tts("play");
menu.add_item_tts("settings");
menu.add_item_tts("exit");
int abcd;
abcd == menu.run("main menu. use your right and left arrows to move, and enter to activate an option.", true);
if (abcd == 0 or abcd == 3)
{
menu.fade_music(20);
exit();
}
}

----------
“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)

2018-07-18 20:57:14

I said use )) in the conditional statement, not in the variables
so you want to do
int abcd ) not ))

Paul

2018-07-18 22:39:07

i'm not quite understanding, could you eddit the fott.bgt in the db folder, the link is in the second post

----------
“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)

2018-07-18 23:26:38

I'll just add the lines where the error is
instead of:
int abcd;
abcd == menu.run("main menu. use your right and left arrows to move, and enter to activate an option.", true);
make:
int abcd = menu.run("main menu. use your right and left arrows to move, and enter to activate an option.", true);
or like you did before:
int abcd;
abcd = menu.run("main menu. use your right and left arrows to move, and enter to activate an option.", true);
Hope I helped you out big_smile

Paul

2018-07-19 13:01:12

You're getting this error because you created

int abcd

but have not assigned it a value.

You try to assign it a value, but are mistakenly using the

==

operator instead of

=

.

The

=

operator is the assignment operator, like

a = 5;

.

The

==

operator is for equality check and tests if the two operands are equal. So writing

a==5

evaluates to "Is a equal to 5?"

You're getting the initialization warning because you're testing if

abcd

is equal to whatever value the menu function returns. This is fine, since in most high-level languages a declared variable is initialized to its default value, but the compiler is warning you to be careful because you haven't explicitly assigned anything to your

abcd

variable.

So, replace

==

with

=

and it'll work.

2018-07-19 17:24:27

Why do you want to have people edit the code for you, then you learn nothing. Learning programming concepts is an active, not a passive process. This means you should be writing out all your own code, not copying and pasting from other places, or having people fix your errors.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-07-19 19:12:57

@13 I was going to look at the changes and se what paul ment, but i think i've figured it out now, thanks to everyone except ironcross who litterally only posts in my topics to try and say i'm doing everything wrong.

----------
“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)

2018-07-19 19:26:51

ok i fixed it, and it runs, but it won't let me move in my menu

----------
“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)