Hi David.
I have good news and bad news. The bad news is that the way this property is handled, it needs to be applied separately to every instance of every sub-param in the struct. The good news is that the property is exposed via the params.getParam(OID, INDEX).setStream(true/false) script call.
This example panel turns-off streaming for most parameters in the struct right after they are created. The relevant part is in the tag at the top:
for (var i = 0; i < params.getElementCount(‘playerList’); i++) {
params.getParam(‘playerList.’ + i + ‘.name’, 0).setStream(false);
params.getParam(‘playerList.’ + i + ‘.identifier’, 0).setStream(false);
params.getParam(‘playerList.’ + i + ‘.position’, 0).setStream(false);
}
The entire panel is here:
for (var i = 0; i < params.getElementCount('playerList'); i++) {
params.getParam('playerList.' + i + '.name', 0).setStream(false);
params.getParam('playerList.' + i + '.identifier', 0).setStream(false);
params.getParam('playerList.' + i + '.position', 0).setStream(false);
}
Value 1
Value 2
Value 3
function handler(tObj, rowIndex, subOid, paramObj, index)
{
ogscript.debug("CHANGE TO: " + subOid + " [" + rowIndex + "]");
}
var raceParam = params.getParam(‘playerList’, 0);
raceParam.addSubParamListener(raceParam, handler, null);
if (event.isMessageEvent()) {
ogscript.debug("GOT " + event.getBytesAsString());
}
selection
identifier,name,position
var structCount = params.getElementCount('playerList');
if (structCount == 1 && params.getValue(‘playerList.0.identifier’, 0) == “”) // If this is the first element and it has not been set yet
{
structCount = 0;
}
var newValue = {
“name”: "Name " + structCount,
“identifier”: "ID " + structCount,
“position”: "Position " + structCount,
“stats”: [
{
“name”: “Stat 1”,
“value”: 0
}
]
};
params.setValue(‘playerList’, structCount, newValue);
params.setValue(‘selection’, 0, 0);
var empty = [{“name”:“”, “identifier”:“”, “position”:“”, “stats”:[{“name”: “”, “value”: 0}]}];
params.setAllValues(‘playerList’, empty);
params.updateParamView('stats-table', 'playerList.' + params.getValue('selection', 0) + '.stats', 0);
var selection = params.getValue('selection', 0);
var structCount = params.getElementCount('playerList.' + selection + '.stats');
var newValue =
{
“name”: “Stat 1”,
“value”: 0
};
params.setValue(‘playerList.’ + selection + ‘.stats’, structCount, newValue);
var selection = params.getValue(‘selection’, 0);
var empty = [{“name”: “”, “value”: 0}];
params.setAllValues(‘playerList.’ + selection + ‘.stats’, empty);
var oldValue = params.getAllValues(‘playerList’);
var newArray = ;
for (var i = 0; i < oldValue.length; i++)
{
newArray.push(oldValue[i]);
}
var newValue = {
“name”: "Name " + oldValue.length,
“identifier”: "ID " + oldValue.length,
“position”: "Position " + oldValue.length,
“stats”: [
{
“name”: “Stat 1”,
“value”: 0
}
]
};
newArray.push(newValue);
params.setAllValues(‘playerList’, newArray);