3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: 'Remembering' settings?  (Read 1066 times)

« on: November 06, 2011, 06:46:26 AM »
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.
« Reply #1 on: November 06, 2011, 07:15:08 AM »
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
::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
« Reply #2 on: November 06, 2011, 07:20:42 AM »
tried that. Harder than you think,mostly because mine isnt about pressing a key you have to click actual buttons
« Reply #3 on: November 06, 2011, 07:28:28 AM »
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 ;)
::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
« Reply #4 on: November 06, 2011, 07:33:09 AM »
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

::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
« Reply #5 on: November 06, 2011, 09:46:12 AM »
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
« Reply #6 on: November 06, 2011, 10:30:12 AM »
how do i write to file and make it read it?
« Reply #7 on: November 06, 2011, 10:35:41 AM »
There is a demo i think ;)
::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
« Reply #8 on: November 06, 2011, 10:47:34 AM »
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
« Reply #9 on: November 06, 2011, 10:52:03 AM »
Why thankyou Dear Mike that is verry usefull ;)
::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
Pages: [1]