Hello,
I'm working on a dashboard panel for baseball scoring. I want to add an inning-by-inning score; however, I'd like to create the parameters as the game progresses instead of adding them to the parameter list. My thought process behind doing it as the game progresses is 1) if a game goes into extras, it'll automatically add the innings and b) if the bottom of an inning isn't played (either due to weather or the home team leading in the top of the 9th), I want it to be a string ("X") instead of an integer ("0").
I've tried going through the documentation and I've attempted (all separately):
var home_innScore_1 = params.createParam(INT32);
myOID = params.toOid('home_innScore_1');
params.createCopy('game_innScore_template_num', 'home_innScore_');
The only one I've had some success for, is params.createCopy('game_innScore_template_num', 'home_innScore_');. However, I cannot get it to work when I put it into an if statement that determines if it's the top or the bottom of the inning:
ogscript.debug('BUTTON PRESSED');
var innStatus = params.getValue('game_inn_status_full', 0)
// Checks if it's the top of the inning
if (innStatus == 1)
{
params.createCopy('game_innScore_template_num', 'away_innScore_');
ogscript.debug('BOT GOOD');
}
// Checks if it's the bot of the inning
else if (innStatus == 3)
{
params.createCopy('game_innScore_template_num', 'home_innScore_');
ogscript.debug('BOT GOOD');
}
I can see the ogScript debug message appear, but none of the parameters are created. I would appreciate any help that could help me figure out why this isn't working, what is the best way to add the inning number to the OID and then how to delete all of them once a game is complete.
Thank you for your help.
Rob Rowe