All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Allow
jump
orcall
when specifying a default choice forchoose
. - Support for Functions in expressions and substitutions.
- Add
DropStack
which allows stacks to be manually discarded during execution, useful for turning calls into jumps. - Add
KeepLastStack
which drops all but the current stack.
- Internally,
ControlNode
s no longer store node blocks; the children nodes are flattened out into their own blocks like it is done forAddChoiceNode
s. - The character
-
can now be used in identifiers. - The ability to clear a specific choice has been added, which also changed the
signature of
OnClear
. RumorState.DefaultSpeaker
is now public.
- Fixed bug where choosing would unintentionally pop the stack frame.
OnFinish
is only called once after execution finishes.- Fixes blocks being appended to each other when they shouldn't due to
improperly implemented hash codes and equality testing (such as is the case
with two
choice
s which only contain anif
statement). choice
andif
/elif
/else
code which contains the same code as another are no longer combined.- Leading and trailing whitespace is no longer removed from quoted strings in substitutions.
5.0.0 - 2021-03-01
- Added support for automatically advancing the dialog.
- Added
GetVars
toRumorScope
as a way for getting all of the variables. - Added
Choosing
,Waiting
, andPausing
flags to see what kind of yield is currently active. - Added serialization support for Rumor.
- Added ability to set a timeout and default jump on choose. For example,
choose in 2 seconds or jump foobar
. - Added
call
command, which moves execution to the specified label and returns back after execution of the label is completed. This is the same behaviour that it had in Rumor 3.X.
- Choices may now be empty.
- The
Label
andText
properties onAddChoiceNode
are now public. - Changed
jump
to work to move execution to the specified label and not return back after execution of the label is completed. This is the same behaviour that it had in Rumor 3.X. choose
andpause
now require the{}
block syntax when specifying an amount of time.choice
no longer uses>
to prefix every line; instead, it works similar to:
and+
commands.
- Injecting nodes clears the current yield and continues execution instead of getting stuck.
Exodrifter.Rumor.Engine.Util
is now internal instead of public.
4.0.0 - 2021-02-12
Rumor has been completely rehauled in this release. It now features...
- Simplified syntax
- Simplified engine API (it no longer requires the use of a coroutine)
- Stronger type checking
...among many other changes which will soon be described in detail on the wiki.
Some features have been lost in the rehaul. Specifically:
- You can no longer bind any function you want; they can only use the types
bool
,double
, andstring
(this will likely never be re-added). - You can no longer serialize the state (this will be fixed in a future release).
3.0.1 - 2018-11-06
- Fix
true
andfalse
always being treated as variables when they should be a boolean literal - Fix scope serialization not working when .NET 4.x runtime is selected
3.0.0 - 2018-09-29
==
now only works when comparing values of the same type, with the notable exception of Int and Floats which can be compared to each other.
- Fix compilation error when comment directly follows a statement expecting a block
- Fix pauses not ending if a choice has been picked
- Better parsing errors
- Allow function and variable names to start with keywords
- Fix math operator precedence
null + null
returnsnull
instead of throwingInvalidOperationException
- Fix comparing any non-empty string with another, different non-empty string
with
==
would always returntrue
instead offalse
- Fix
>=
and<=
not working due to comparing the wrapper type instead of the wrapped values - Fix using
!
on a non-null object would throw an exception clear choices
andclear dialog
compile instead of throwing a compilation error
2.0.1 - 2018-04-15
- Compiler performance improvements
- Fix
elif
andelse
compilation errors
2.0.0 - 2018-01-15
- You can now add the enum argument
cant_skip
to the end of a pause statement to ignore advances until the pause ends - You can now add the enum argument
no_wait
to the end of an add or say statement to auto advance the dialog - Variable substitution with
{
and}
in strings is now supported
- The compiler no longer uses a tokenizer except when parsing expressions
- Compiler errors are more specific and descriptive
- The
Exodrifter.Rumor.Lang
namespace has been renamed toExodrifter.Rumor.Language
- All unit tests and examples are wrapped in a
UNITY_EDITOR
ifdef to make it easier to use this repository as a submodule in non-unity project - Bindings are no longer stored in
Rumor
; instead, it is now stored inBindings
Rumor.Run
has been renamed toRumor.Start
in order to match the language used in C#Thread.Start
and Unity'sStartCoroutine
method to improve consistency
1.1.2 - 2017-12-23
- More descriptive error for tokens after string
- If conditional statements no longer require a following else or elif statement
- Compiler tokenizes commas correctly now
1.1.1 - 2017-12-23
- Full Unity scene example
- Fix
+=
,-=
,*=
,/=
operators not working - Fix exception when script execution finishes in some cases
1.1.0 - 2017-12-19
- Added
OnAddChoice
andOnRemoveChoice
events to RumorState
- Fix unit test failures caused by Tokenize performance optimization code
- Fix Rumor bindings no longer attempting to convert arguments
1.0.1 - 2017-12-19
Rumor.CallBinding
no longer calls DynamicInvoke and is much faster- Tokenize step of compilation is much faster
- Fix
Rumor.Choosing
throwing an error if Rumor has not been started - Fix scope not being initialized when passed as null when constructing Rumor
- Fix Add statements behaving like Say statements
- Fix null pointer exception in Equals expression
- Fix incorrect equality checking
- Fix improper deserialization of values caused by wrapper types (Json.NET will wrap object values in its own type, JValue, which causes logic to fail)
- Rumor no longer clears the scope when starting
- Null ObjectValues are now treated the same as an uninitialized (null) variable
1.0.0 - 2017-08-16
- Added the ability to specify a clear for just dialog or just choices
- Added the default binding
_choice
, which returns the contents of the last chosen choice - Added the
-=
,+=
,/=
, and*=
assignment operators - Added the
<
,<=
,>
, and>=
comparison operators
- The
OnClear
event in RumorState has been changed to use aClearType
enum, which specifies if everything, just choices, or just dialog was cleared - The Pause command will now wait for an advance if the time is less than or equal to 0
- Multiple methods of the same name can be binded as long as they have a different number of input parameters
0.2.1 - 2016-11-14
- Added an
OnDialogAdd
,OnDialogSet
, andOnClear
events to RumorState - Added the Clear command
- Added an
OnWaitForAdvance
andOnWaitForChoose
event to Rumor - Added a
Cancelled
property to Rumor
- AutoAdvance is now a time instead of a toggle, which indicates the amount of time before the Rumor will attempt to automatically advance
- Bindings are now stored in the Rumor instead of the Scope
- Fix null variables not handled properly in expressions
- Fix no boolean literals parsing in
RumorCompiler
- Fix nodes not checking for null values
- Fix
If
conditional not checking for null values
0.2.0 - 2016-11-05
- Added an
AutoAdvance
property to Rumor that causes it to automatically advance if possible - Added
Cancel
andFinish
methods to Rumor - Added
CancelCount
andFinishCount
properties to Rumor - Added a
Choose
node - Added the ability to use one-line comments
- Added
SetupDefaultBindings
convenience method to Rumor for common bindings Choice
nodes no longer automatically wait for a choice at the end of a chain of choices. Instead, use theChoose
node to wait for a choice
0.1.1 - 2016-10-31
- Added a
Running
property to Rumor - Added
OnStart
andOnFinish
events to Rumor - Added
OnVarSet
event to Scope
Rumor.Run()
will restart the script instead of throwing an exception if it is already runningJumpToLabel
andCallLabel
are now exposed publicly, and work even if the Rumor has not been started yet- Rumor constructors now provide a convenience method that takes a string directly
- You can now pass Rumor a scope to use
- The RumorCodeExample has been removed as it's potentially misleading/confusing
0.1.0 - 2016-10-23
Initial release.
The following actions are available in this initial release:
- Label - Specifies a location
- Say - Replaces the dialog in the current state
- Add - Appends text to the end of the dialog in the current state
- Choice - Adds a choice and all following choices to the current state
- Pause - Pauses execution for a short amount of time
- Jump - Modifies the stack so that execution will continue at the specified label
- Call - Pushes a new stack frame onto the stack with the children nodes from the specified label
- Return - Exits the current stack frame
You can also:
- Bind methods to a Rumor's scope
- Subscribe to events on each new node
For examples of how Rumor works, see the Examples/
folder.