MV Help with repositioning Control Timer

Hi, reading other threads I found this bit of code that's apparently supposed to change the timer's xy position:
JavaScript:
Sprite_Timer.prototype.updatePosition = function() {
    this.x = Graphics.width - this.bitmap.width;
    this.y = 0;
};
But after editing the values nothing happens when I add it to my game files whether I edit rpg_sprites.js directly or add it as a standalone plugin. Any help would be greatly appreciated
as plugin it should work, bit sure about bitmap part.
you can better test it when happens if you set Graphics.width - 400
to see if that takes effect.

if you want it to a specific place, just hardcode the numbers inside your plugin.

if you want a bit a more control over the timer, font, color, etc, you can look
into SRD_TimerUpgrade or CT_Bolt Timer or any other that can suit you.
as plugin it should work, bit sure about bitmap part.
you can better test it when happens if you set Graphics.width - 400
to see if that takes effect.

if you want it to a specific place, just hardcode the numbers inside your plugin.

if you want a bit a more control over the timer, font, color, etc, you can look
into SRD_TimerUpgrade or CT_Bolt Timer or any other that can suit you.
Unfortunately, the SRD timer seems to be incompatible with another plugin I'm using (Shaz' Multi timers). And the CT_Bolt Timer gives me this "$gameMultiPlayer is not defined" ReferenceError
1739561766849.png


Also I tried hardcoding in both the example you gave this.x = Graphics.width - 400 and this.x = (Graphics.width - this.bitmap.width) / 2 but the timer is still in the top right corner
Reference error means you made a typo in your event.
can you show a screenshot of your event? as it expect an eventId.
if you miss something, than we need to see what you miss.
Reference error means you made a typo in your event.
can you show a screenshot of your event? as it expect an eventId.
if you miss something, than we need to see what you miss.
Here's the event where I'm trying to use the plugin:
1739582429684.png

and the preset timer I created in the plugin parameters:
1739582487362.png

I wonder if it's another case of a plugin conflicting with the MultiTimers.js plugin I have installed?
"$gameMultiPlayer is not defined" ReferenceError
did you test that in a new save, or an old one? when you add new plugins to your project, you should always create new saves for your tests as some data only ever gets written into the file at the start of a new game.

Here's the event where I'm trying to use the plugin:
also your script calls seem a little confused.
Code:
$dataItems[$gameVariables.value(9)+9].id
the id of an item is going to be the same as its index within $dataItems
is there a reason youre using that instead of just:
Code:
$gameVariables.value(9)+9
?
did you test that in a new save, or an old one?
Yeah I test on a new save every time
is there a reason youre using that instead of just:
Code:
$gameVariables.value(9)+9
?
Also I think originally I wanted to store the items themselves and not just the number, I changed my mind but was too lazy to rewrite the script calls I guess lol so I just added .id ... nice catch
but you miss 1 further down.

Also beside that, how does the preset looks like in the CTB_Timers?
maybe you miss some settings in the CTB_Timers plugin, so we need
the setup there as well.
but you miss 1 further down.

Also beside that, how does the preset looks like in the CTB_Timers?
maybe you miss some settings in the CTB_Timers plugin, so we need
the setup there as well.
I only changed a couple settings in the timer presets, everything else is default
1739640984413.png
1739641014994.png

But now looking more closely at the files, the CT_Bolt plugin references this $gameMultiPlayer variable which is what's causing the error because $gameMultiPlayer is literally undefined. I found where all the variables the game uses are defined in rpg_managers.js, but $gameMultiPlayer is nowhere to be found (and doesn't appear in any other files either).
JavaScript:
var $dataActors       = null;
var $dataClasses      = null;
var $dataSkills       = null;
var $dataItems        = null;
var $dataWeapons      = null;
var $dataArmors       = null;
var $dataEnemies      = null;
var $dataTroops       = null;
var $dataStates       = null;
var $dataAnimations   = null;
var $dataTilesets     = null;
var $dataCommonEvents = null;
var $dataSystem       = null;
var $dataMapInfos     = null;
var $dataMap          = null;
var $gameTemp         = null;
var $gameSystem       = null;
var $gameScreen       = null;
var $gameTimer        = null;
var $gameMessage      = null;
var $gameSwitches     = null;
var $gameVariables    = null;
var $gameSelfSwitches = null;
var $gameActors       = null;
var $gameParty        = null;
var $gameTroop        = null;
var $gameMap          = null;
var $gamePlayer       = null;
var $testEvent        = null;
So I wonder if this plugin was made for an older version of RMMV? Or maybe the creator defined $gameMultiPlayer in their own project but didn't include it in the plugin so now it always throws an error
re-check your event, there is a mistake.

you use a plugin command, it should be a scriptcall.
so change that and it should work.
re-check your event, there is a mistake.

you use a plugin command, it should be a scriptcall.
so change that and it should work.
I still get the ReferenceError $gameMultiPlayer is not defined
try in a new project with only CTB_Timers and see what it does.
maybe his example online or see what is missing.

Edit:
did you use somewhere "startTimer" scriptcall as I only see a "changeTimer"?
try in a new project with only CTB_Timers and see what it does.
maybe his example online or see what is missing.

Edit:
did you use somewhere "startTimer" scriptcall as I only see a "changeTimer"?
This is what happens on a new project on a new save and no other plugins installed:
1739649659728.png
it does create one, but lets try to modify the plugin.

open the plugin to line 658 and place there the following line
JavaScript:
$gameMultiPlayer = null;

save the plugin and see what happens.

as the variable does exist on creation, it checked on mapload, it might crash
there of undefined, so adding that line should avoid crashing and hopefully
working.

otherwise, I need to do some tests on my end to see why it doesn't work.
but if this goes deeper, than a more advanced coder has to guide you.

as this can set multiple timers as well 🙂
well thats... odd...

the plugin references a fishing scene from one of Galv's plugins without checking if its installed. if you dont have it, it causes an error that prevents the rest of the plugin from running at the start, which leaves $gameMultiPlayer undefined.

remove lines 2260 to 2281 and it loads at least. not sure if its supposed to be a map scene function or is actually supposed to be fishing.
remove lines 2260 to 2281 and it loads at least
This fixed the issue!! No more errors and timer function is working
as this can set multiple timers as well 🙂
And yes now that it's working I finally see how useful it is, I wouldn't have known about this plugin had you not mentioned it so much thanks!

I can't thank you both enough for helping me troubleshoot this! :LZSproud::LZSproud:
remove lines 2260 to 2281 and it loads at least. not sure if its supposed to be a map scene function or is actually supposed to be fishing.
I had no idea this could mess around, but I ruled it out just in case.

but could always set a condition to if it's imported otherwise to avoid that crash.
but nice catch though =)

Original thread: https://forums.rpgmakerweb.com/threads/help-with-repositioning-control-timer.175439/