Hello community, hope everyone is having a nice warm day
.
is it possible to make a built in brightness option using adventure creator menu system? just like the "speech and music" slider elements in the option menu that automatically save when adjusted?
Comments
Further options are certainly possible, though as there's no end to what users would need AC takes the approach of allowing users to add their own with simple scripting. A tutorial on creating a "screen resolution" option can be found here.
It seems to work but it doesn't work! When I move the slider to the end, it only switch to white (rgbValue), but not the other way round (black color). What I want is a gradual increase and decrease(from black to white and reverse) . Hm, I missing something... by the way, thank's Chris
If you want the Action to run over time, you'll have to set the Action's "isRunning" bool to True, and return "defaultPauseTime" instead of zero. This will cause the Action to re-run the next frame, and will only cease once you set "isRunning" back to False and return zero. See the original ActionTemplate file for more. Once you have the Action running over multiple frames, you can change the brightness gradually instead of instantly.
Alternatively, you can move this all to a separate script and rely on a regular "Update" function. The Action just needs to be able to pass the intended brightness to it, which can be done without running over time.
Hell guys,
After some research I found a really nice way to create a Brightness/gamma menu. Here's what I did and then the questions to link it to AC.
First: we are using URP. We didn't download the Post Processing Package. We didn't mess around with any camera.
After we put all the lights, I've created an empty object and added the "Volume" script (I think it comes with URP).
Then I added the following options (after creating a profile):
Then the script: The script is easy enough. I will post here just the part I did: the post exposure. Basically each option should be one other float/int and one more "linking" in the update().
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class BrightnessOptions : MonoBehaviour
{
public Volume volume;
public ColorAdjustments CA;
[Range(-2, 2)] public VolumeParameter postExposureOut = new VolumeParameter();
[Range(-2, 2)] public float postExposureValue = 0;
}
Now the questions:
1) I would like to cycle it like a Music/SFX/Speech. I found that after creating the variable (which originally was a "float", It couldn't find the variable because it wasn't an int. Any way to do it with floats?
2) The script works at runtime but I'm finding it hard to link it through the Action List. I mean, each number of the int should be the Global Variable value. This is var17, it's Global, int (want to be float actually).
I'm finding it hard to do that linking between numbers.
Any help on the above will be great. Yes, I've read the screen resolution tutorial but I think that one is even harder than this.
Thanks a lot! I think many people will make use of this, so when I'm finished I will post here the final script but so far, we are on the right track!
AC 1.75.4
Unity 2020.3.27f1
Universal Renderer Pipeline needed!
For question 1)
I just found "Cycle" is not the actual option I should use, rather "Slider". Now I can use floats
Now the question regarding this is: any chance negative values are also taken in consideration when "filling" the bars? As of now, I can only move forward even though I set it at -20 and +20. Maybe go 0 to right and 0 to left. Because as far as I can see it now, it starts at -20 and then goes all the way to 20.
And for the second part regarding question 1): the number of steps for the following scenario, what does it mean for floats?
Thanks a lot!
You'll need to rely on an AC Global Variable so that you can sync its value with Options Data - see the Manual's "Options data" chapter for details.
Variables can be read through script - see the Manual's "Variable scripting" chapter for details. If the variable was named "Brightness", your script could be adapted to something like:
Slider elements of the type "Float Variable" can be given minimum and maximum values in the Menu Manager. Alternatively, you can keep its range (and that of the AC variable) to 0 -> 1, and convert it before applying to postExposureOut:
I made it work. Let me explain what I did, and then the questions:
I made a custom "Options" menu with a button which will bring me to the video part where I have labels, sliders and buttons. The Labels are the Gamma, etc etc etc. The Sliders are the, well, sliders. Each one has a minimum value and a maximum which should be replicated in the script (below) and the AC menus. So all three have to have the same min and max. Then the button is just an action list which will give me the default button (0 in all cases). I didn't need to do anything crazy and works.
Also, this same menu has a prefab which has to be consistent in all scenes and basically tweaks the values. This is the prefab which has this script and is in the Menu and the scene. Any change on the scene (options menu or video options menu) will affect the prefab hence the scene. If you don't have the prefab of the video in the scene, when the menu turns off, the changes are discarded. Simply prefabing this object with the script and the "Volume" script is enough. Pictures below.
1) But, Chris, I found a problem: the buttons activate a simple action list which just sets the Variable to Zero, but everytime I click, I can see the player behind the menu moving one frame. Every click is one click moving. I noticed that even when transitioning between Pause and Options (Options is inside Pause), it also moves the player one frame inbetween. I can't make it "freeze" even though the Pause menu has the "pause gameplay".
In the screenshot I'm showing below, you can check how the character slowly moves everytime I press on a button. All "default buttons" do the same for different variables. If I go back to the menu, again moves a bit.
2) For some reason this only works on gameplay lights, not menus. I may have to research harder because UI elements just like our inventory (wallet) and the menus are not affected
https://imgur.com/a/P7ynwvh
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using AC;
public class BrightnessOptions : MonoBehaviour
{
public Volume volume;
public ColorAdjustments CA;
public WhiteBalance BA;
public LiftGammaGain LGG;
}
Uncheck Unfreezes 'Pause' menus? in the properties of your ActionLists.
This isn't AC-related, but a Canvas's Render Mode needs to be set to Screen Space Camera for it to react to post-processing.
I can't believe I've never saw this ever!. Man thanks!!!
https://imgur.com/a/7IG6ktD
As for question 2, yes I knew it wasn't AC related in advance, but your words were the trigger I needed to at least look in the right direction. I also knew from following the forum the brightness is not AC related, yet someone can now find a good working method and everything they could need to make it work. Thank you both for helping me add a nice feature to the game.
Have a good day!