MV Does Message/Log Window in MV not like starting with text?

Using action sequences, I tried

eval: BattleManager._logWindow.addText("Dice Roll: " + $gameVariables.value(1) + "! <CENTER>");

Which won't work, unless i do this

eval: BattleManager._logWindow.addText($gameVariables.value(1) + "! <CENTER>");

So i tried using a message instead, this works:

eval: $gameMessage.add($gameVariables.value(1) + ' Rolled');

but this doesnt

eval: $gameMessage.add("Dice Roll: " + $gameVariables.value(1));
eval: BattleManager._logWindow.addText("Dice Roll: " + $gameVariables.value(1) + "! <CENTER>");
This displays perfectly for me as a script call in my test project.
This displays perfectly for me as a script call in my test project.
Really? ive just copied it back and it won't show at all..

Maybe because im launching battle from troops menu?
It displays perfectly for me in a Battle Test.

Admittedly, not visually perfectly since I have no plugins installed so the <CENTER> tag from whatever plugin does nothing. But it displays the battle log as intended.

So, like most of the time when code from the default engine doesn't seem to be working as you expect, you probably want to troubleshoot with plugins disabled then work from there to see what's causing it. 😉
Looking at the code of my copy of YEP Battle Engine Core (v1.50), I believe this is because of how the plugin parses action sequences (DataManager.convertSequenceLine). I see a greedy, any-character match:
JavaScript:
  if (line.match(/[ ]*(.*):[ ](.*)/i)) {
This makes the eval start after the last colon on the line, rather than the first. Try this?

eval: BattleManager._logWindow.addText("Dice Roll = " + $gameVariables.value(1) + "! <CENTER>");
(Potential fixes: /[ ]*([^:]*):[ ](.*)/i to exclude colons, or /[ ]*(.*?):[ ](.*)/i for a non-greedy match. I don't know if these would break something else, though.)

Original thread: https://forums.rpgmakerweb.com/threads/does-message-log-window-in-mv-not-like-starting-with-text.170519/