I have an options menu where a choice is "Menu music:On/Off". I can make it so if music is set to off,the music isnt playing (and vice versa (did I spell that right?))in the options menu but how could I make it work on different projects (.3dr projects)? So if it is set to off, music doesnt play on any other menu.
This forum is now archived!
- Welcome to the archive!
News:
The 3DRad community can be found at classdev.net.
- 3D Rad - Free 3D game maker - Forum >
- General Category >
- 3D Rad - Optimization Tips >
- 'Remembering' settings?
Author Topic: 'Remembering' settings? (Read 1066 times)
Well in my opinion i think you have to play with counter i mean add cross over project and wehen you press lets say M kay for music mute the counter would change in every project to 1 and when value is 1 No music works i think you can handle it
tried that. Harder than you think,mostly because mine isnt about pressing a key you have to click actual buttons
same with buttons
whenn you press button counter shows to 1 right? than music stops now make a cross ower project
i dont know what to do in other project and only that so in theory when you set to 1 you get muted music when 0 you get music but i suggest EOV when counter reaches 1.1 until 1.5 (any of these walues) you reset so when you press again value sets to 0 and you get normal music i know its hard i want to know also what do to in the project but i will upload some strange files that could help you
after 10 mins or so
whenn you press button counter shows to 1 right? than music stops now make a cross ower project
i dont know what to do in other project and only that so in theory when you set to 1 you get muted music when 0 you get music but i suggest EOV when counter reaches 1.1 until 1.5 (any of these walues) you reset so when you press again value sets to 0 and you get normal music i know its hard i want to know also what do to in the project but i will upload some strange files that could help you
after 10 mins or so
Here are the files and Compiled project first play compiled than look at projects hope it will help you cuz i ddint understood if you will understand could you explain to me? anyways i found this project by searching old posts but nwm here it is
Quote
but how could I make it work on different projects (.3dr projects)? So if it is set to off, music doesnt play on any other menu.
are you talking about different "levels" (3dr project loaded by menus and other projects in the same game)...
if so you've gotta find some way to persist the values set in the option menu...
the simplest way is to write it out to global array and read it back in when each level starts... then turn the music on or off...
but this'll only persist during the time the game is being played...
if you want it to persist the next time the player loads up the game, the value will have to be written to a file, and read in at the start of the game...
--Mike
first you've gotta decide on the file structure...
since in 3DRAD we have only simple sequential access text files, i suggest a series of strings (or a string array)... with something in each string...
in options menu level... each time the user chooses an option, the string is set to a value...
then..
when user clicks on APPLY or OK you write out the string array to a file...
when the game loads (in the initialization) read in the file and set the global variables...
attached is a simple commented file io example...
good luck...
--Mike
since in 3DRAD we have only simple sequential access text files, i suggest a series of strings (or a string array)... with something in each string...
in options menu level... each time the user chooses an option, the string is set to a value...
then..
when user clicks on APPLY or OK you write out the string array to a file...
when the game loads (in the initialization) read in the file and set the global variables...
attached is a simple commented file io example...
good luck...
--Mike
Pages: [1]