12. Read and save the entered name
The Use this name button will read name_box, trim the outside spaces and store the result in visitor_name. The visitor label already contains $$visitor_name, so it will display the new value.
| Step | Job |
|---|---|
| Read | Get the current text from register_panel / name_box. |
| Check | Reject an empty or all-space answer. |
| Store | Write the cleaned String into visitor_name. |
| Report | Put a short confirmation in feedback. |
1. Create a native GDScript record with ID save_name and Name Save Name.
2. Replace its source with the complete script on the next page.
3. Validate/apply the script and save the project.
4. Set Use this name's Click behavior to the built-in run-visual-script and Click Target to save_name.
5. Run the game, enter a name and press Use this name.
Figure 20. The saved visitor is Joey, while the active adventure character is still Builder. They are separate values.
The built-in behavior has an older name, run-visual-script, but this release can dispatch the named GDScript record too. The catalog Run Visual Script action also offers a Script selector for the shared script types.
