Hi all,
I'm having problems with booleans but I really can understand why.
I've this parameters
* @param UseExtraVariable
* @text Do you want to set a custom Variable?
* @desc You can set up an extra variable for the Parallel Event
* @type boolean
* @Default true
*
* @param ExtraVariableNumber
* @text Var# for the extra Variable
* @desc Set the variable that stores the custom value
* @Default 7
*
* @param ExtraVariableValue
* @text Variable value for extra Variable
* @desc The value to set the extra variable.
* @Default 1
*
* @param UseExtraSwitch
* @text Do you want to set a custom Switch?
* @desc You can set up an extra switch for the Parallel Event
* @type boolean
* @Default false
*
* @param ExtraSwitchNumber
* @text Switch# for the extra Switch
* @desc Set the Switch that stores the custom value
* @Default 7
*
* @param ExtraSwitchValue
* @text Switch value for extra Switch
* @desc The value to set the extra switch.
* @type boolean
* @Default true
that get read in the function
var useExtraVariable = parameters['UseExtraVariable'] === 'true';
var extraVariableNumber = parseInt(parameters['ExtraVariableNumber'] || 7);
var extraVariableValue = parseInt(parameters['ExtraVariableValue'] || 1);
var useExtraSwitch = parameters['UseExtraSwitch'] === 'false';
var extraSwitchNumber = parseInt(parameters['ExtraSwitchNumber'] || 7);
var extraSwitchValue = parameters['ExtraSwitchValue'] === 'true';
and at the end of the plugin tey should be used
// Set extra variable if enabled
if (useExtraVariable) {
$gameVariables.setValue(extraVariableNumber, extraVariableValue);
}
// Set extra switch if enabled
if (useExtraSwitch) {
$gameSwitches.setValue(extraSwitchNumber, extraSwitchValue);
}
But they get ignored.
I tried to remove them from the IF condition and the Variable works correctly but the Switch doesn't, so I'm assuming I'm having some kind of problems with the booleans. I tried different approach but really can't understand what I'm doing wrong
I'm having problems with booleans but I really can understand why.
I've this parameters
* @param UseExtraVariable
* @text Do you want to set a custom Variable?
* @desc You can set up an extra variable for the Parallel Event
* @type boolean
* @Default true
*
* @param ExtraVariableNumber
* @text Var# for the extra Variable
* @desc Set the variable that stores the custom value
* @Default 7
*
* @param ExtraVariableValue
* @text Variable value for extra Variable
* @desc The value to set the extra variable.
* @Default 1
*
* @param UseExtraSwitch
* @text Do you want to set a custom Switch?
* @desc You can set up an extra switch for the Parallel Event
* @type boolean
* @Default false
*
* @param ExtraSwitchNumber
* @text Switch# for the extra Switch
* @desc Set the Switch that stores the custom value
* @Default 7
*
* @param ExtraSwitchValue
* @text Switch value for extra Switch
* @desc The value to set the extra switch.
* @type boolean
* @Default true
that get read in the function
var useExtraVariable = parameters['UseExtraVariable'] === 'true';
var extraVariableNumber = parseInt(parameters['ExtraVariableNumber'] || 7);
var extraVariableValue = parseInt(parameters['ExtraVariableValue'] || 1);
var useExtraSwitch = parameters['UseExtraSwitch'] === 'false';
var extraSwitchNumber = parseInt(parameters['ExtraSwitchNumber'] || 7);
var extraSwitchValue = parameters['ExtraSwitchValue'] === 'true';
and at the end of the plugin tey should be used
// Set extra variable if enabled
if (useExtraVariable) {
$gameVariables.setValue(extraVariableNumber, extraVariableValue);
}
// Set extra switch if enabled
if (useExtraSwitch) {
$gameSwitches.setValue(extraSwitchNumber, extraSwitchValue);
}
But they get ignored.
I tried to remove them from the IF condition and the Variable works correctly but the Switch doesn't, so I'm assuming I'm having some kind of problems with the booleans. I tried different approach but really can't understand what I'm doing wrong
