Hello.
Currently i am making a menu and require the menu to reflect numerical values along with the slider, such as if i am turning the volume down in the options menu i need that to show a numerical percent value for the current level so that people dont have to guess at the level to chick the sliders are at.
The same could go for if i am editing graphics options, and i only want 25, 50, 75, and 100%, so 4 in total, how would i go about making a slider that reflects the current state?
Please let me know if i need to clarify
Comments
As for adding a numbe beside it, just create a separate label. If your Slider's Slider affects property is set to Float Variable, then you can simply add that Variable's token text as the label's text.
The token text is a token that simply displays the Variable's value, and can be found within the properties of any Variable declared in the Variables Manager. It takes the form [var:ID], where ID is the unique identifier number.
Also i was loooking at the documentation for help with the Cycle method so that i can change the praphics options and for some reason all i come across is MenuSystem.cs script.
So i assume you would need to program that to affect the graphic quality in unity and reflect that in the menu cycle button?
Idk this is all very confusing as im not a programmer, just an artist that uses playmaker.
The changing of Music, SFX and Speech volumes are all built-into AC's Slider element. Look at the default Demo_MenuManager asset: The Options menu has sliders that affect all three without the need for Global Variables. These values are all decimals, not percentages, so their values can only be 0 - 1.
If you're using PlayMaker, know that you can also link AC's Global Variables to PlayMaker Global Variables. So if you update an AC variable using a Slider, it's assocated PlayMaker variable will also update. Just go to the Variable's properties and Link to to Playmaker Global Variable.
As for Playmaker, i dont understand why i would need to use that to control my graphics/ controls/ audio/ gameplay options, id rather do all that in AC.
I just need to be pointed into the direction so that i can get things linked to my options menu so it can be functional.
float graphicQuality = GlobalVariables.GetFloatValue (ID);
Where ID is the ID number of the Variable in question. I appreciate you're not a coder, but this is as simple as it can be made.
So what am i doing with "float graphicQuality = GlobalVariables.GetFloatValue (ID);"
Where do i put that? Do i make a script and link it in the menu element?
See when you just put a line of code i dont know where it goes or what im doing with it so i just end up sitting here breaking things trying to understand what you are "hinting" at.
Your tutorials are great, and im not asking for one on how to script cause i understand it cant be covered like that, but the docs show me nothing on how to do these things. So then i come here and have to wait 2 days in order to get help mostly every time i post, and anyone else.
I mean i hate to be rude but i have a fully functional game, i understand all of your mechanics and i love the kit, but i need steps to follow when it comes to these kinds of things.
Thank you for the support.
In response to your reply, i have watched videos on how to code and still do, but it is a hard concept to grasp as i dont know the terminology that i need for certain cases.
I never once asked for a cut and paste i simply asked to be shown what needs to be done specifically, not vaguely.
Your condescending remarks and lackluster reading should not permit you to reply to a thread in which you are not being constructive.
Have a good one.
Section 10.3 of the Manual covers the concept of "Menu scripting", which, again, assumes a knowledge of scripting. But we can at least get you started: create a new Button and set it's Click type to Custom Script. Then, open up the MenuSystem.cs script and prepare to make changes. (Be mindful that, when upgrading AC, you'll need to make a backup of this file, and replace it afterwards).
Look for the function OnElementClick. This function will be run when your new Button is clicked on. However, it'll also be run when any Button set to Custom Script is clicked on, so first you need to check that we've clicked the correct button. Assuming our new Button is called "ApplyButton", enter in this code:
if (_element.title == "ApplyButton")
{
float graphicQuality = GlobalVariables.GetFloatValue (ID);
if (graphicQuality < 0.5f)
{
// Low quality
}
else
{
// High quality
}
}
Again, where ID is your "Graphic Option" Variable's ID number. The comment statements would obviously need to be replaced with code that actually makes graphical changes, but that'd be the point where AC "ends" and more general Unity code begins, and I'd suggest posting on the official Unity forums for tips on adjusting the graphical quality through script.