well it would be a simple as modifying the choice box script. basically you have an internal time inside the choice box that will invoke the "defualt" option once it hits zero. now we need to be is telling the box whether it should be on a timer or not and for how long. just in case you want different time to think on a puzzle or something.
I made a rough script that does this well,
Code:
//=============================================================================
// Timed Choices
//=============================================================================
/*:
* @plugindesc Timed Choices for RPGmaker MV
* @author SilverKnightArcher
*
* *
* @param timed?
* @desc will choices be timed by defult iunless explicitystated other wise
* defualt: false
* @defualt false
*
*
* @param Defualt Time
* @desc how long the window will wait for when timed in seconds.
* defualt: 10.0
* @defualt 10.0
*
* @param Defualt Choice Index
* @desc which choice (numbered down from zero - six) will be selected on eding of a timer
* defualt: 0
* @defualt 0
*
*=============================================================================
*
*=============================================================================
*/
var Imported = Imported || {};
Imported.DSE4_AudioCore = true;
var DSEIV = DSEIV || {};
DSEIV.TimedChoices = DSEIV.TimeChoices || {};
//=============================================================================
// Params
//=============================================================================
DSEIV.TimedChoices.Timed = false;
DSEIV.TimedChoices.TimeRemaining = 10.0;
DSEIV.TimedChoices.defaultChoice = 0;
DSEIV.TimedChoices.currentTimer = null;
//=============================================================================
// DSEIV.TimedChoices.Timer
//=============================================================================
DSEIV.TimedChoices.Timer = function() {
this.initialize.apply(this, arguments);
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.initialize = function() {
this._working = DSEIV.TimedChoices.Timed;
this._timeRemaining = DSEIV.TimedChoices.TimeRemaining * 60;
this._choice = 0;
this._OnEnd = null; //when timer ends call back
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.update = function () {
if(this._working) {
this._timeRemaining--;
if(this._timeRemaining < 0) {
this.expire();
}
}
};
//-----------------------------------------------------------------------------
// Set Working
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.SetWorking = function(bool) {
console.log('working set to ' + bool);
this._working = bool;
};
//-----------------------------------------------------------------------------
// Set Choice
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.SetChoice = function(index) {
console.log('choice set to ' + index);
this._choice = index;
};
//-----------------------------------------------------------------------------
// Get Choice
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.SetChoice = function() {
return this._choice;
};
//-----------------------------------------------------------------------------
// Set Duration
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.SetDuration = function(seconds) {
console.log('duration set to ' + seconds);
this._timeRemaining = seconds * 60;
};
//-----------------------------------------------------------------------------
// Add On End Lister
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.addOnEndListerner = function(listener, instance) {
console.log('adding listener');
this._OnEnd = listener.bind(instance);
};
//-----------------------------------------------------------------------------
// Expire
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Timer.prototype.expire = function () {
console.log("expireed!");
this._working = false;
if(this._OnEnd) {
this._OnEnd();
}
this._onEnd = null;
};
//=============================================================================
// Window_ChoiceList
//=============================================================================
// The Window used for making Choices
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
DSEIV.TimedChoices.Window_ChoiceList_start = Window_ChoiceList.prototype.start;
Window_ChoiceList.prototype.start = function() {
DSEIV.TimedChoices.Window_ChoiceList_start.call(this);
if(DSEIV.TimedChoices.currentTimer == null) {
DSEIV.TimedChoices.currentTimer = new DSEIV.TimedChoices.Timer();
}
DSEIV.TimedChoices.currentTimer.addOnEndListerner(this.invokeDefaultChoice, this);
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
Window_ChoiceList.prototype.update = function() {
this.ProcessTimer();
Window_Command.prototype.update.call(this);
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
Window_ChoiceList.prototype.ProcessTimer = function() {
if(DSEIV.TimedChoices.currentTimer) {
DSEIV.TimedChoices.currentTimer.update();
}
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
Window_ChoiceList.prototype.invokeDefaultChoice = function() {
console.log(this);
this.select(DSEIV.TimedChoices.currentTimer.GetChoice());
this.processOk();
};
//=============================================================================
// END OF FILE
//=============================================================================
it doesn't any any plugin commands per se but it work by creating a Timer before calling your choices then runs them. its pretty rough and haven't fully tested i, so they will probably be a few bugs /crashes with this but it works.
this is basically how you use it. each time you want a timed Choice window , you will need to set up the timer for it. the Timer is set up with 4 lines of code as you can see in the screenshot. First line creates the timer, that's all.
Working (2nd line) tells the timer whether it should work or not. True means it will tick, false means it won't.
Choices (3rd Line)are what is defined as the default choice. by default it is 0 (the first choice).
Duration (4th line) is the number of seconds the timer will last until it fires off the "default ' choice, this is set to 10 seconds by default but in the screen shot it is set to 5.