This is forbidden and error is shown that “Not allowed type was used in script”. In this case System.IO.Directory was used to delete some directory. In the error dialog the Line number error and description of the error is shown.Īfter compilation, the code is checked for usage of disallowed namespaces and types. This is the wrong language construction and the compilation failed. It this case “aaa” string is placed before Main method. If there are any errors during compilation the following dialog is shown: There are two steps of the compilation process:įirst the code inside editor is compiled by c# compiler for language errors. When the “Check code” button is pressed, the code will be compiled and the result of the compilation will be shown. The Storage variable is unique in that it will store the data as a string for use between saved sessions and recompile. For example, if the variable needs to keep its value between separate runs of the script, it needs to be defined outside the methods.Īfter pressing “Remember & Exit” or “Remember” buttons, the previous script will be overwritten and all Global variables will be lost.Īll variables, local and global except for the built-in Storage variable will lose their value or return to their default value when recompiling the code and between saved game loads. Global (outside the methods) these variables will keep their values during the lifetime of script. Value will be “lost” when the method ends. Local (inside the methods) these variables will keep their value only during execution of a method. There are two types of variables for scripting: If Main method is removed / renamed, the script will not run and you will be notified in the programmable block details area.Ĭustom methods/variables can be defined and used, but only the Main method will be called by the program. This Main method is the entry point that will be called when executing script. The code in the editor becomes the body of the Program class definition. When the editor is opened for first time on a block, the Program constructor and the Main method are present inside the code editor. If someone else has an editor for the current block open and someone else tries to open that block's editor, a notification will be shown that the editor is already open. Only one player can edit the same script at a time. 2.3 Same block class for different SubTypeID.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |