Ok so looking at your script, particularly this section here...
JavaScript:
var Imported = Imported || {};
Imported.Eli_SuperTIler = true;
var Eli = Eli || {};
// TIP : the below line should just be Eli.SuperTImer = {};
// The way it's written insinuates that this name space may already be taken,
// which would only happen if the end user has your plugin installed twice. :x
Eli.SuperTImer = Eli.SuperTImer || {};
// TIP : I would change this to ...
// Eli.SuperTimer.Parameters = PluginManager.parameters('Eli_SuperTimer');
// the reason being, if you make another plugin, and do the same thing,
// you are going to overwrite the parameters for one of the pluigns, which
// could lead to some problems.
Eli.Params = PluginManager.parameters('Eli_SuperTimer');
Eli.SuperTimer.Params = {
Features: JSON.Parse( Eli.Parameters['Feature'] ),
// PROBLEM IS BELOW CODE:
StartCommonEvent: Number( Eli.Parameters['Start Common Event'] ),
MiddleCommonEvent: Number( Eli.Parameters['Middle Common Event'] ),
PauseCommonEvent: Number( Eli.Parameters['Pause Common Event'] ),
EndCommonEvent: Number( Eli.Parameters['End Common Event'] )
// Insert other parameters here( too lazy ).
}
The issue here is as you stated, you moved these parameters from the main plugin parameters values to a struct.
The way a struct works is just like a javascript object, meaning that these parameters moved into the "Feature" struct. the way you would access them would be as follows.
JavaScript:
Eli.SuperTimer.Params = {
Features: JSON.Parse( Eli.Parameters['Feature'] ),
// Below we are still saying that start common event is set at "Start Common Event", and it's not :
StartCommonEvent: Number( Eli.Parameters['Start Common Event'] ),
}
// the correct way to do this would be like so...
Eli.SuperTimer.Params = {};
Eli.SuperTimer.Params.Features = JSON.Parse( Eli.Parameters['Feature'] ),
Eli.SuperTimer.Params.StartCommonEvent = Number( Eli.Params.SuperTimer.Features['Start Common Event'] );
}
The reason, for this is that all of your parameters are now inside the feature parameter, which you turned into a javascript object, by using JSON.Parse, so now all your parameters must be accessed through that features object that you created.
It's kind of a pain to do this for every plugin, so you can use this code if you'd like it'll automatically parse out your object for you whenever you pass a string to it.
JavaScript:
//--------------------------------------------------------------------------
function Parse( object )
{ // parse all data in an object
//--------------------------------------------------------------------------
try {
object = JSON.parse( object );
} catch (e) {
object = object;
} finally {
if ( Array.isArray( object ) ) {
var l = object.length;
for ( var i = 0; i < l; i++ ) { object[i] = Parse( object[i] ); };
} else if ( typeof object === 'object' ) {
for ( var key in object ) { object[key] = Parse( object[key] ); };
}
}
return object;
};
just add this to your plugin, and just type out...
JavaScript:
Eli.SuperTimer.Params = Parse( PluginManager.parameters('Eli_SuperTimer') );
Edit : sorry my code might be all over the place, xD I accidentally pressed enter so I had to try to type it out quickly so it all made sense, also I was a bit lazy in typing it from the screenshot. :x