Difference between revisions of "Programmable Block"
(saved draft) |
m |
||
Line 74: | Line 74: | ||
''Details section'' – In this area the script exception will be shown (if any will occur) | ''Details section'' – In this area the script exception will be shown (if any will occur) | ||
+ | |||
+ | ==== Editor ==== | ||
{| style="width: 80%;" | {| style="width: 80%;" | ||
− | |||
− | |||
− | |||
| | | | ||
[[File:Steamworkshop webupload previewfile 360966557 preview (1).jpg|500px]] | [[File:Steamworkshop webupload previewfile 360966557 preview (1).jpg|500px]] | ||
Line 90: | Line 89: | ||
|} | |} | ||
==== Browse Workshop ==== | ==== Browse Workshop ==== | ||
− | {| | + | {| style="width: 80%;" |
| | | | ||
[[File:Browse workshop.jpg|200px]] | [[File:Browse workshop.jpg|200px]] | ||
Line 104: | Line 103: | ||
|} | |} | ||
==== Details (local script) ==== | ==== Details (local script) ==== | ||
− | {| | + | {| style="width: 80%;" |
| | | | ||
[[File:Details (local script).jpg|500px]] | [[File:Details (local script).jpg|500px]] | ||
Line 119: | Line 118: | ||
* ''Open in Workshop'' – it will open the current script workshop page. | * ''Open in Workshop'' – it will open the current script workshop page. | ||
* ''Close'' – it will close the screen | * ''Close'' – it will close the screen | ||
− | + | ||
== Media == | == Media == | ||
Line 148: | Line 147: | ||
== Update History == | == Update History == | ||
+ | <div style="-webkit-border-image: none;-webkit-box-shadow: rgba(0, 0, 0, 0.046875) 0px 1px 1px 0px inset;background-color: #eeeeee;border-bottom-color: #AFAFAF;border-bottom-left-radius: 3px;border-bottom-right-radius: 3px;border-bottom-style: solid;border-bottom-width: 1px;border-left-color: #AFAFAF;border-left-style: solid;border-left-width: 1px;border-right-color: #AFAFAF;border-right-style: solid;border-right-width: 1px;border-top-color: #AFAFAF;border-top-left-radius: 3px;border-top-right-radius: 3px;border-top-style: solid;border-top-width: 1px;box-shadow: rgba(0, 0, 0, 0.046875) 0px 1px 1px 0px inset;color: #333;display: block;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size: 1em;height: auto;line-height: 20px;margin-bottom: 5px;margin-left: 8px;margin-right: 8px;margin-top: 0px;min-height: 20px;padding-bottom: 4px;padding-left: 4px;padding-right: 4px;padding-top: 4px;width: auto;"> | ||
+ | {| class="wikitable" style="width: 100%" | ||
+ | |style="text-align: left;width: 8%"| [[Update 01.063]] ||style="padding-left: 10px;padding-right: 10px;"| | ||
+ | * Programmable Block Introduced | ||
+ | |} | ||
+ | |||
+ | </div> |
Revision as of 13:21, 29 November 2015
Contents
Overview
A Programmable Block can be programmed to do different functions, like switching lights and controlling doors. It can also be used by entering the control panel in the Terminal. It has almost unlimited functionality.
Usage
Programmable Block scripts run in a single update (single frame) and any that take too long to complete are aborted. This means it is impossible for a single run of the script to 'wait' on any event. If you want your script to run when something happens, you need to either find a way of getting another block to trigger it at the right time (an 'interrupt-driven' approach via eg. a sensor block), or modify your script to check for a precondition and set up a timer to run it regularly (a 'polling' approach). Depending on what your script is doing, one approach may be the preferred or even the only way to do it.
- Since Update 01.067 each programmable block has a maximum limit of 50,000 characters for any in-game script.
GUI Overview
The programmable block terminal panel screen currently contains two buttons:
Edit – it will open the editor for editing scripts and the ability to save/load scripts from and to disk. Also, you can upload your scripts to workshop and download subscribed scripts.
Run – it will run the script that was remembered in editor. It will run the script only once. However this button is terminal action, so you can attach it to sensor, timer block, and button or add it to toolbar.
Details section – In this area the script exception will be shown (if any will occur)
Editor
Code editor contains these buttons:
|
Browse Workshop
This screen is similar to blueprint screen and contains these buttons :
|
Details (local script)
This screen will show up when you press details for local script and contains the following buttons:
|
Details (workshop script)
This screen will show up when you press details for script from workshop and it contains these buttons:
- Open in Workshop – it will open the current script workshop page.
- Close – it will close the screen
Media
Tips
Known Issues
- Foreach not working at 64- bit: - Problem:
Currently using of foreach loop inside script will cause “bad program exception” at some configurations and prevent script from running. We are working of fixing this issue. Workaround: All our interfaces used in in-game scripting are using lists as collections. Please use For loop for iteration across these lists
- Lambda functions not working - Problem:
Currently lambda functions are not supported, if you use them in script, exception will be thrown and script will not run. Workaround: Please use method instead of lambda function if possible.
- User defined variables are not saved - Problem:
None of the user defined variables inside script are saved, therefore after loading game they are reset to their default values. Workaround: We added string variable called "Storage" that will be loaded and saved when the block is loaded and saved.
See Also
Programming
Update History
Update 01.063 |
|