New Feature: Modulus and Is Even commands#976
Open
Arylos07 wants to merge 5 commits into
Open
Conversation
This issue seemed simple to tackle and the feature would be nice to add depending on what audio you use. The dopplering effect is minor with the built-in sound clips, but amplified with things like typewriters. * Added a Lerp Writer Audio bool. * When enabled (default), the WriterAudio uses the default behaviour of using MoveTowards for volume. * When disabled, the WriterAudio sets the audio volume to the target volume while writing, removing the lerp effect. This setting is enabled by default on the say dialogue prefab Fungus spawns by default and therefore cannot be set at runtime.
* The Modulus command runs the same operation as x % y == z. This will allow checking whole numbers and other such fun operations like checking list indexes. * Added an Is Even conditional command that checks an inputted variable and returns true if the number is even.
* Changed IsEven and Modulus command input variable names to input, this way it's more concise. * Fixed Modulus' summary displaying Fungus.FloatData when a variable was not set.
* Changed from one Modulus to Modulus int and modulus float. This prevents some random issues with having different variable types. Alas, you cannot modulo a int and a float together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added 2 new Math commands that can be useful for some operations.
What is the current behavior?
There is no behaviour for this right now. The current best solution is to do something like this.

What is the new behavior?
Modulus Int/Float - You can now input a float/int and get a remainder from it using a modulus operation. Due to casting issues, there are 2 versions of the command; float and int. Float takes 2 float inputs and Int takes 2 integer inputs. The result is the same, however and both will output to a float or integer variable, so you can take 2 ints and output a float, if needed.


Is Even - Here you can take either a float or int variable and check if it's even. There is no numerical input since, let's be real here, you're going to check using a variable.

Important Notes
Other information
Important: because I did a silly, this PR includes changes from PR #934 which contains an optional boolean to Writer Audio. When merging this branch, 934 can be deleted as this already contains it.
Future updates could include having specific say commands ignore the text limits, just in case your Say Dialog is using Best Fit and you want just a couple commands to be a little longer than the rest, if such a feature is not added prior to merging this PR.