There are two separate, but related, elements introduced in this Suggestion.
Introducing
Suggesting a generic template Object between any property-laden block type, its GUI rendering, and external access/modification (as by Property Blocks).
Note that, though arranged as a JSON object, this is more akin pseudo-code.
(AI block is something like this)
[
(Individual object instances would appear as thus)
{
Property Block
{
Property Blocks, too, would be modifiable via GUI on selection, though they'd have only either one or two text input fields to designate the property they're targeting. If property name comparison is somehow too computation-heavy, they can be assigned values for a select list, based on their targeted Source Block.
I believe blocks that may target other blocks in a 1:n ratio with 'c'+'v' are called Control Blocks. A Property Block would be one of these.
[Bobby AI-Block] <------ [Property Block] <------ [Logic Block]
Things occur in this order
Taking the possible reverse order into account, that would be...
[Bobby AI-Block] ------> [Property Block] ------> [Logic Block]
A fully-controllabe Bobby AI-Block setup would look something like this:
Source Block, Property Block, Logic Block
[AI] <---- [Type.turret] <------ [0/1]
|b | <---- [Type.ship] <-------- [0/1]
|l | <---- [Activated] <-------- [0/1]
|o | <---- [Target.any] <------- [0/1]
[k ] <---- [Target.selected] <-- [0/1]
If a property block has two fields, the first may supply the property name, and the next its selection, should the property refer to a select list. If a single input field, then perhaps a standard '.' may act as a delimiter between the two values in the single provided string. Or a ':', or whichever, really doesn't matter.
And there you go!
And there you go! Properties programmable through in-game logic blocks! Woohoo!
This first occurred to me after an AI-controlled turret fired on a neutral ship, because I didn't know what I was doing and focused on it with 'f'. I realized the utility of being able to activate or deactivate AI blocks remotely, and fitting that into the game's Logic blocks would be ideal.
In any case, this could see utility for all sorts of things. If any block with its own GUI-changeable properties could also be modified via Logic Blocks, the interstellar void is the limit!
Not to mention, if the generic template setup is also in place, it'll be ready for the eventual modding community's adding their own blocks, expecting to be able to work them all into more complex in-game, logic-controlled behavior.
Introducing
- GUI/Properties Template
- Property Block
- Source Block (e.g. AI block; not sure what the naming convention is for this type of block)
- Logic Block
- GUI/Properties Template
- Property Block
Suggesting a generic template Object between any property-laden block type, its GUI rendering, and external access/modification (as by Property Blocks).
Note that, though arranged as a JSON object, this is more akin pseudo-code.
(AI block is something like this)
[
{
{
{
]name:'Type',
type:'select',
options:[
default:'turret'
},type:'select',
options:[
'turret',
'ship'
],'ship'
default:'turret'
{
name:'Activated'
type:'checkbox',
default:false
},type:'checkbox',
default:false
{
name:'Target'
type:'select',
options:['any','selected'],
default:'any'
}type:'select',
options:['any','selected'],
default:'any'
(Individual object instances would appear as thus)
{
Type:'turret',
Activated:true,
Target:'selected'
}Activated:true,
Target:'selected'
Property Block
{
propertyName:<text input>
}Property Blocks, too, would be modifiable via GUI on selection, though they'd have only either one or two text input fields to designate the property they're targeting. If property name comparison is somehow too computation-heavy, they can be assigned values for a select list, based on their targeted Source Block.
I believe blocks that may target other blocks in a 1:n ratio with 'c'+'v' are called Control Blocks. A Property Block would be one of these.
[Bobby AI-Block] <------ [Property Block] <------ [Logic Block]
Things occur in this order
- Logic Block signal fires (say, from 0 to 1)
- Property block receives signal, and sends a message to Bobby AI-Block containing the property name and its new value
- Bobby AI-Block receives message, and acts on these rules:
- select-list properties
- 0: set to default value or do nothing
- 1: set to item in list matching Property Block's property name
- checkbox properties
- 0: set to false (uncheck)
- 1: set to true (check that box!)
[Bobby AI-Block] ------> [Property Block] ------> [Logic Block]
- Player changes AI-Block property through the GUI
- AI-Block sends a message to all Property Blocks it's pointing to
- Receiving Property Blocks check the message (property-name:value) against their own set property name, and, if matching, fire off that value to any Logic Blocks they're pointing to under these rules:
- select-list properties
- name matches: fire 1
- name does not match: do nothing
- checkbox properties
- name matches: fire passed value (0 or 1)
- name does not match: do nothing
Source Block, Property Block, Logic Block
[AI] <---- [Type.turret] <------ [0/1]
|b | <---- [Type.ship] <-------- [0/1]
|l | <---- [Activated] <-------- [0/1]
|o | <---- [Target.any] <------- [0/1]
[k ] <---- [Target.selected] <-- [0/1]
If a property block has two fields, the first may supply the property name, and the next its selection, should the property refer to a select list. If a single input field, then perhaps a standard '.' may act as a delimiter between the two values in the single provided string. Or a ':', or whichever, really doesn't matter.
And there you go!
And there you go! Properties programmable through in-game logic blocks! Woohoo!
This first occurred to me after an AI-controlled turret fired on a neutral ship, because I didn't know what I was doing and focused on it with 'f'. I realized the utility of being able to activate or deactivate AI blocks remotely, and fitting that into the game's Logic blocks would be ideal.
In any case, this could see utility for all sorts of things. If any block with its own GUI-changeable properties could also be modified via Logic Blocks, the interstellar void is the limit!
Not to mention, if the generic template setup is also in place, it'll be ready for the eventual modding community's adding their own blocks, expecting to be able to work them all into more complex in-game, logic-controlled behavior.