2019-07-10 04:39:29

Hi guys. So I added a logo to my game, and I don't want it to play if I don't want it to. I already declared an int variable that you can change to 0 if you don't want it to play the logo, and change to 1 if you want it to. The problem I am having is I am coding an options menu with the option to enable and disable the logo (change the variable). I don't know how I can do it. I am using the menu.bgt. I don't know if I have to use if (mres==1), or if (m.get_item_name(mres)=="then the name of the option. I just don't know. and whoever said to stop using bgt, I am not going to. So yeah don't know but if you can help, cool.

I like bop it.

Thumbs up

2019-07-10 05:09:44

Both is fine. get item name however is more reliable as you might mistake the item positions when doing mres==1 or so. Simply check when the item is "disable playing of logo" set the int to 0 and go back to the menu, and when it is "enable playing of logo" set the int to 1 and again go back to the main menu

Add me on skype: kianoosh.shakeri2
Or follow me on twitter @kianoosh shakeri

2019-07-10 16:47:24

But how do you make it where it saves your settings. When I hit escape in the options menu, it exits and doesn't save the settings. So don't know

I like bop it.

Thumbs up

2019-07-10 21:44:02

You need a saves system.

-----------
I'm the true source of dark evil. Beware.
Have a nice day peeps

2019-07-11 03:46:54

I suggest reading serialization tutorial.

Coding is not hard. No, not at all.
What is hard is making code that accepts different and sometimes unexpected types of input and still works.
This is what truly takes a large amount of effort on a developer's part.

Thumbs up

2019-07-11 08:52:12

This is just some example code to get you started. I'm not sure how your system works but here goes.

if(m.get_item_name(mres)=="playlogo") {
playlogo=(playlogo==1?0:1);
speak("Logo "+(playlogo==1?"on":"off"));
savesettings();
optionsmenu();
}

Ivan