Hello,
Is there a way to control the speed of the timer for timed choices in the settings? I would like to include an option to be able to turn them off or change the speeds. I thought I would be able to just put in [var:10] into the timer and change it in the options menu but that doesn't seem to be the case. (I included this option in a previous game I made in Ren'py after it was requested by a couple of players with disabilities).
Sorry for the newbie question; I'm not very familiar with Unity yet.
Comments
To be clear: are you referring to the "Is timed?" option for Conversations?
A Conversation's timer can be modified, but only through script. Inside Conversation.cs, it's the timer float variable. A custom script could therefore store this initial value, and multiply it by a factor:
http://pasteall.org/965367/csharp
If you then use a Global float Variable to act as the factor (between 0 and 1), you can then read its value and update all such scripts:
float factor = GlobalVariables.GetFloatValue (2); // Global float variable ID = 2
ConvTimerChanger[] allTimeChangers = FindObjectsOfType <ConvTimerChanger>();
foreach (ConvTimerChanger convTimeChanger in allTimeChangers)
{
convTimeChanger.SetTimerFactor (factor);
}
Any Global Variable can have its Link to field set to Options Data, which means its value will be stored in your game's PlayerPrefs, as opposed to individual save files. A Slider menu element can be mapped to a variable, and a custom Action or event can then be used to run the above code when it is changed by the user.
A tutorial on creating custom options can be found here.
The pasteall.org link no longer works?
I believe this was it:
Took me a while to realize that Conv Timer Changer had to be attached to every conversation that had a timer. (Even after a year, when this was originally posted, I'm still terrible with the code side of Unity...)
Thank you for all your help.