Getting Started With Nottorus
Getting Started With Nottorus
Getting Started
V1.00
2016
1. Introduction
Nottorus Script Editor is a visual plugin for generating and debugging C# Unity scripts. This plugin
allows designers, artists or programmers without any limitation create C# scripts of any complexity, but
require some basic programming skills. It contains all the features of the C# language.
2. Installing
Download and import plugin unitypackage from the Asset Store. After installation all plugin
components it will be located in %ProjectFolder%/Assets/Nottorus folder. Plugin options and scripts
autosaves will be located in %ProjectFolder%/Nottorus folder.
3. Updating plugin
Just import the updated unitypackage from Asset Store. If you have some troubles with updating plugin
please delete the plugin folder Assets/Nottorus.
4. Launching
Nottorus script editor can be launched from Unity top menu bar Tools/Nottorus/Nottorus script
editor or select any Nottorus script data file (with extension .nts) and pres Open in Nottorus button in
Inspector panel.
6. Creating scripts
6.1.1. Class
Basically each script contains class. A class is a construct that enables you to create your own custom
types by grouping together variables of other types, properties, functions etc. A class is like a blueprint. It
defines the data and behavior of a type.
6.1.2. Struct
Structs share most of the same syntax as classes, although structs are more limited than classes. For
more information check structs documentation page.
6.1.3. Constructors
Constructor is called when a class or struct is created. A class or struct may have multiple
constructors that take different arguments.
6.1.6. Properties
A property is a member that provides a flexible mechanism to read, write, compute the value or
execute some code before setting or getting it.
6.1.7. Indexers
Indexers allow instances of a class or struct to be indexed just like arrays. Indexers resemble
properties except that their accessors take parameters.
6.1.8. Enums
The enum keyword is used to declare an enumeration, a distinct type that consists of a set of named
constants called the enumerator list.
6.1.9. Delegates
A delegate is a type that represents references to methods with a particular parameter list and return
type. When you instantiate a delegate, you can associate its instance with any method with a compatible
signature and return type. You can invoke (or call) the method through the delegate instance.
6.1.10. Interfaces
An interface contains only the signatures of functions, properties, events or indexers. A class or struct
that implements the interface must implement the members of the interface that are specified in the
interface definition.
Entry node cant be duplicated in edit graph, unlike return node, which can be copy-pasted and used
at any place in the code. Entry and return nodes cant be completely deleted from edit graph.
All sequence nodes must be linked with white bold line, which starts from entry node connector and
goes from one node to another. This line displays nodes execution order. The connection is made by
dragging one connector to other. One of connectors must be in direction and other is out direction:
Data nodes have one out pin and must be connected to in pin of other nodes. The color of line is
defined by type of data variable:
6.4. Using nodes
All available nodes can be found in New Node Menu, which opening by clicking right mouse button
on edit graph:
Above in the list the default nodes are located. Most of them are the standard functionality of C#
language.
Flow control nodes used for controlling sequence of code and can be executed by sequence
connector;
Data nodes used for data calculation, conversion, binary operations, etc.
After default nodes goes other nodes, which generated (by C# reflection) from used assemblies (dll).
They provide access to all functions, properties, constructors of Types from those assemblies.
7. State Machine
A finite state machine (SM) used for simplifying creation of gameplay logic or A.I. behavior. It must be
created in class that derived from Monobehaviour by pressing Add state machine button:
State machine change node (state) to other through links (transitions) if it passes link condition. State
will wait until any first link will pass the condition then transfer to other state. If there are few links pass
condition state will use the first priority link. Entry node its an entry point of sequence in state
machine.
Transitions have 5 modes for transition:
Never transition is disabled. Can be used for temporary disabling transition;
Always always allow to transit;
Conditions transition allowed if all conditions will be passed. Each condition checks the value of
script variable;
Code Condition transition permission based custom script function, which returns bool value;
Trigger based on bool variable. After trigger pass, the value of this variable will be set to false.
Switch to Code Condition button will check on Code Condition option and opening this function.
Each state and transition has events, which can be used for executing nodes in Nottorus Script Editor:
Nodes events:
Do Before Entering calls before SM enter to this node;
Do Before Leaving calls before SM leaves from this node;
State Loop calls while SM stay in this node (waiting for any link will pass condition). Will not be
called if SM enters to node which has any out link that pass the condition.
Transition events:
On Start Transit calls before SM will use this link for transition;
On End Transit calls after SM ends transition using this transition;
Transition Loop calls while SM transit using this link (if transition has Transition time option)
and gives transition delta value.
8. Debugging
Visual debugging is a powerful tool, which allows debugging sequence of code, data values of each
parameter in nodes and sequence of state machine.
To enable visual debug the script must be compiled with Debug: On option at the top of toolbar. The
chosen value of the filter Object of debug will define the object which we want to debug. In case
Monobehaviour scripts we can select a GameObject with our script on, otherwise we can chose Any object,
which allows receiving debug from any script (if we create editor plugin or other script which cant be used
on GameObjects).
We will receive debug information while script will work.
9. Autosaves
Nottorus Script Editor automatically makes backup of a saves (every 5 min by default) into
%ProjectFolder%/NottorusEditor/Autosaves folder with the possible compression as zip file. Autosave
delay and other option of this feature can be found in Options dialog of editor.
10.Saving scripts
Nottorus Script Editor saves all script objects, nodes, and other plugin system data to the files with
extension .nts. After compiling .cs script file will be created in a same folder as .nts file.
All editor scripts (Inspector scripts, editor Plugins and all related with them) must be located in any
Editor folder in project. These scripts will be ignored during building the game and not be compiled to
build. Plugin check their location while saving new script and show message in case invalid location.
Monobehaviour script class must be named as its file name, otherwise this script cant be used on
GameObjects.
11.Examples
Example scripts and scenes can be found in Assets/Nottorus/Examples folder. Read Examples.pdf
for more details.