Skip to content

Commit 295f1ca

Browse files
Update index.md
Improving English grammar and correcting typos.
1 parent ec29c53 commit 295f1ca

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

manual/scripting/visual/index.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Visual Scripting](media/vs-sample.png)
44

5-
Flax Engine supports fully Visual Scripting with lots of great features such as: hot-reloading, full-API access, debugging, Visject Surface UI, and more. In general, Visual Scriptng offers more **robust development** for rapid prototyping while mainting solid performance.
5+
Flax Engine supports fully Visual Scripting with lots of great features such as: hot-reloading, full-API access, debugging, Visject Surface UI, and more. In general, Visual Scripting offers more **robust development** for rapid prototyping while maintaining solid performance.
66

77
Follow this documentation section to learn how to create your own visual scripts and use them in a game. Also, if you see any code examples in the *Flax Documentation* that are written in C# you can similarly use them in visual scripts since the engine uses the same API in all languages.
88

@@ -16,15 +16,15 @@ Follow this documentation section to learn how to create your own visual scripts
1616

1717
### New Visual Script asset
1818

19-
**Visual Script** is an in-build binary asset that contains a graph with visual script nodes, properties and metadata. This graph is processed and executed at runtime by the engine. To create new Visual Script simply navigate to the *Content* directory, *right-click* and select option **New -> Visual Script**. Then specify it's name and confirm with *Enter*.
19+
**Visual Script** is an in-build binary asset that contains a graph with visual script nodes, properties and metadata. This graph is processed and executed at runtime by the engine. To create a new Visual Script simply navigate to the *Content* directory, *right-click* and select option **New -> Visual Script**. Then specify its name and confirm with *Enter*.
2020

2121
![New Visual Script](media/new-visual-script.png)
2222

23-
Now, editor allows you to pick the type of the visual script. You're asset will inherit from the specified base class. The default option is **Script** which fits in the most cases. You can also try extending Actor or any other type. Including custom game C++ and C# types for more robust scripting.
23+
Now, the editor allows you to pick the type of the visual script. You're asset will inherit from the specified base class. The default option is **Script** which fits in most cases. You can also try extending Actor or any other type. Including custom game C++ and C# types for more robust scripting.
2424

2525
![New Visual Script Type](media/new-visual-script-type.png)
2626

27-
Confirm dialog with **Create** button and *double-click* on the asset icon to open the editor window.
27+
Confirm the dialog with **Create** button and *double-click* on the asset icon to open the editor window.
2828

2929
### Visual Script editor window
3030

@@ -68,20 +68,20 @@ Controls in the Visual Script Editor generally match the controls of other tools
6868
| **Arrow keys** | Move selected nodes |
6969
| **//** | Create comment around selected nodes |
7070

71-
### Adding new node
71+
### Adding a new node
7272

73-
In order to add a new node **right click** on a surface background and select a node type from a popup or type its name to find it. Visual Scripts can use engine and game types API just like C++ and C# scripts.
73+
To add a new node **right click** on a surface background and select a node type from a popup or type its name to find it. Visual Scripts can use engine and game types API just like C++ and C# scripts.
7474
Also, when hovering the items with a mouse cursor the tooltip will show the documentation comments with details of every node.
7575

7676
![Adding New Visual Script Node](media/new-visual-script-node.png)
7777

7878
## Visual Scripting with Flax
7979

80-
Visual Scripts can override base class methods, have custom properties and methods full of visual code. To understand some basic concepts let's create a simple script that prints the custom message to the log when user clicks the mouse button.
80+
Visual Scripts can override base class methods, and have custom properties and methods full of visual code. To understand some basic concepts let's create a simple script that prints the custom message to the log when the user clicks the mouse button.
8181

8282
Firstly, create a new Visual Script (like in the tutorial above). Then open it and override the **OnUpdate** method - it's called on active scripts during every game update so we can use it to update the game logic.
8383

84-
To override method you can use the special button on the script functions list in the *Class Members* panel, or type the function name in the context menu and select the one under *Method Overrides* category. Both ways are correct.
84+
To override the method you can use the special button on the script functions list in the *Class Members* panel, or type the function name in the context menu and select the one under the *Method Overrides* category. Both ways are correct.
8585

8686
| Use button | Use context menu |
8787
|--------|--------|
@@ -94,36 +94,36 @@ Now, we can use the function output impulse box to run custom script logic.
9494
> [!Note]
9595
> See that all functions in the script graph are listed under the *Functions* group inside the *Class Members* panel. You can use it to easily navigate to them or edit them.
9696
97-
Next step is to add **If** node that will use **GetMouseButton** method (from **Input** class) result as a *Condition*.
97+
The next step is to add the **If** node that will use the **GetMouseButton** method (from the **Input** class) result as a *Condition*.
9898
You can *right-click* on *GetMouseButton* node and press **Convert to pure method**. This will change the method to not use input and output signals, which is useful for typical getter nodes that just return the state value.
9999
Set button to **Left** as input for *GetMouseButton* to check when that button goes down (is clicked by the user).
100100

101101
![Visual Script input if check for mouse button down](media/mouse-button-down-if-visual-script.png)
102102

103-
Then, let's add a property to the script with a message to print. To do this, press **Add parameter...** button and select the type of the parameter - use **String** in this example. Then *double-click* on the `New parameter` name label to rename it to **Message**.
103+
Then, let's add a property to the script with a message to print. To do this, press the **Add parameter...** button and select the type of the parameter - use **String** in this example. Then *double-click* on the `New parameter` name label to rename it to **Message**.
104104

105105
![Visual Script String Parameter](media/new-parameter.png)
106106

107-
Here you can specify the default message text we gonna print. It can be set also on instance of this script after adding it to the actor on the scene.
107+
Here you can specify the default message text we gonna print. It can be set also on an instance of this script after adding it to the actor on the scene.
108108

109-
Finally, let's use **Log** method from *Debug* class that prints the custom message.
109+
Finally, let's use the **Log** method from the *Debug* class that prints the custom message.
110110

111111
![Add Log Message Node Visual Script](media/log-message-add-new-node.png)
112112

113-
Then, connect it with *True* output of the *If* node that so the *Log* will be executed when user clicks the mouse button. Add **Get Message** node or drag and drop your new parameter into the surface to connect its value with the *message* input in the *Log* method.
113+
Then, connect it with the *True* output of the *If* node so the *Log* will be executed when the user clicks the mouse button. Add the **Get Message** node or drag and drop your new parameter into the surface to connect its value with the *message* input in the *Log* method.
114114

115115
![Visual Script Print Log](media/visual-script-print-log-message.png)
116116

117-
The last step is to add this script to an actor on the scene, set the Message property, and hit play to see the results! Every time user clicks the given mouse button it prints the custom log message.
117+
The last step is to add this script to an actor on the scene, set the Message property, and hit play to see the results! Every time the user clicks the given mouse button it prints the custom log message.
118118

119119
![Visual Script Message Log On Click Results](media/visual-script-tutorial-results.png)
120120

121121
Feel free to start coding your game logic in Visual Scripting language!
122-
Also, since Visual Scripting uses C# API of the engine you can use this [API reference](https://docs.flaxengine.com/api/FlaxEngine.html).
122+
Also, since Visual Scripting uses the C# API of the engine you can use this [API reference](https://docs.flaxengine.com/api/FlaxEngine.html).
123123

124124
## Events in Visual Scripts
125125

126-
When working with physics and gameplay you might want to handle collision or **trigger events** inside VIsual Script. To see how to do it follow this documentation section related to [Events](events.md).
126+
When working with physics and gameplay you might want to handle collision or **trigger events** inside Visual Script. To see how to do it follow this documentation section related to [Events](events.md).
127127

128128
## Interop with C\+\+
129129

@@ -132,7 +132,7 @@ To call Visual Script from C\+\+ you can do it as in the following example:
132132
```cpp
133133
#include "Engine/Content/Assets/VisualScript.h"
134134
..
135-
VisualScript* myScript = ..; // Assign it from editor or load asset manually
135+
VisualScript* myScript = ..; // Assign it from the editor or load the asset manually
136136
ScriptingObject* instance = nullptr; // Null for static methods, assign to object instance to call member function
137137
Span<Variant> parameters; // Here you can pass parameters to the function
138138
Variant result = VisualScripting::Invoke(myScript->FindMethod("My Func"), instance, parameters);

0 commit comments

Comments
 (0)