Programable Block Inputs

PriorUniform721 shared this feedback 2 years ago
Submitted

For players that are not familiar w/ programming/scripting it can be quite daunting to go in an edit a script to change variables. Script authors provide helpful comments and guides on Steam but none the less "go to line 123123 and edit..." or "find numberOfPistons and..." is quite off putting.

Even using "arguments" or "Custom Data" is pretty kludgey and probably discourages use.

Script authors should be able to declare inputs that go on the control panel of the programming block just like anything else. Nothing fancy, think HTML style inputs.

Text - Just text to input, perhaps min/max length

Integer - Accepts and integer value w/ min/max bounds

Float - Accepts a float value w/ min/max bounds

Block Select - Lets the user select a specific block, the programmer should be able to specify which type of blocks. For example an "Ore Container" input might be limited to selecting from cargo containers.

Group Select - Similar to block but for selecting a group, again w/ requirement that a group contain all of the same block.

Object Select - Like the select box on the sorter.

Boolean - On off, true false, enable disable. Perhaps subclasses of TrueFalse OnOff EnableDisable or give the programmer the ability to set display text for the true/false values.

Since PBs are full C# scripts the script authors could actually provide their own validators. But it would be nice to have some canned options for common things.

Even better, this would go nicely with Visual Programming. These would just be "input" "blocks" or "elements", whatever terminology is used by a particular visual language.

Thanks,

-Alan

Replies (2)

photo
2

I use custom data as an ini file, it works even better that what you are offering and is actually made for that!

It's the data that is custom to the PB!

It's an easy read/write and doesn't take a lot of lines of code.

photo
2

Oh! I know what you're talking about. :3


What if... a properly formatted Custom Data could be parsed by the client and dynamically link certain INI keys as editable fields (below the usual fields, buttons, switches and the like)?


For instance, a piece of custom data like this:

[FirstDataSection]
;This is a comment. It is not parsed by the class.
;@SomeKey:String
SomeKey=The value of this key

;The field signatures must be placed on the line directly
; before the key itself for client to recognize it.
;@AnotherKey:String[36]
AnotherKey=Another value, limited by 36 charac-

[AnotherSection]
;@SomeKey:Integer
SomeKey=15

;@SomePositiveKey:Integer[0:]
SomePositiveKey=99999

;@SomeWeirdFloat:Float[-2.3:48.1516]
SomeWeirdFloat=42.108

;This will be a switch!
;@BooleanKey:Boolean
BooleanKey=true

;This will allow the player to select a block.
; A flexible system of tags allows to fine-tune the
; block selection.
;@GridBlock:Block[grid=CurrentConstruct, type=(Warhead|Timer)]
GridBlock=Warhead 3

;@"Readable name":"This comment is completely useless. But hey, it's a comment!"
;@ACommentedKey:Integer[1:3]
ACommentedKey=1

...would... Well, I hope it's pretty self-explanatory. :3


This could work for all blocks, not just the PB's - for instance, consider a script that lets you control a rotor-based turret with your mouse. You run a PB once, the script recognizes it's being run for the first time and then adds an INI template to itself. Your game parses the template and dynamically adds dropdown block selectors below the PB's other keys. You choose your turret's rotors, pistons and gun groups, run the block again, and it adds INI templates to THOSE blocks, which turn into fields that you can now edit as well to fine-tune the script's parameters as it wants you to!

And removing all those extra fields is as simple as clearing the CustomData - it remains plain text, after all. :3

photo
photo
1

All terminal blocks already have lists of properties and actions. I don't know why devs didn't allow exposing PB script properties and actions. That would be a major improvement in PB usability.

Leave a Comment
 
Attach a file