armoha / euddraft

System for pluginizing eudplib codes.
Other
29 stars 4 forks source link

SetPNamef is Not Working in Multiple Players Game #9

Closed KanzakiYui closed 4 years ago

KanzakiYui commented 4 years ago

Code

foreach(currentPlayer : EUDLoopPlayer("Human", Force1)) { 
    setcurpl(currentPlayer);
    const playerId = getuserplayerid();
    SetPNamef(playerId, "ABC");
    const str = StringBuffer(1024);
    str.insert(0);
    str.append(PName(playerId));
    str.Display();
}

Issue

It works in Single Player game, while not work in Multiple Players game

KanzakiYui commented 4 years ago

I did lots of tests and noticed why... So actually SetPNamef is not indeed modified user's nick name (or player name), it's just replace it with given name immediately when needed.

However, there is a minor UI bug, that is, suppose:

  1. my player name is 'ABC'
  2. I use SetPNamef to change name to DEF.

when I type message and show on screen, a weird UI bug occurs:

  1. it initially showed ABC on screen.
  2. and immediately (after ~0.3sec) replace the ABC with DEF 😂

^ is this supposed to be? 🤔

armoha commented 4 years ago

It is intended. Unlike 1.16, there's no way to edit player name directly. So we're using workaround.

Use hypertrigger to run trigger frequently. Apply EUDTurbo to run trigger once every 42ms, with Fastest game speed. (Write [EUDTurbo] at plugins list of eds/edd.)

KanzakiYui commented 4 years ago

It is intended. Unlike 1.16, there's no way to edit player name directly. So we're using workaround.

Thanks! Good to know 👍