For some reason, the keys of cloned players are set to the first player's keys in the clown car subroutine, which happens after onTick. Because of that, the cloned players will always mimic player 1, even if their keys are modified during onInputUpdate. To fix this issue, I patched the clown car subroutine to skip the key updating code and I rewrote it in the UpdateInputFinishHook procedure to make sure it is executed right before onInputUpdate.
Example using the supermario4 cheat code and the following lua code:
function onInputUpdate()
if Player.count() > 2 then
Player(3).keys.right = KEYS_PRESSED
end
end
Nice work, this looks good. Only super minor issue in the changes looks to be it's using tab characters in place of spaces, mixing the indentation types in the files.
For some reason, the keys of cloned players are set to the first player's keys in the clown car subroutine, which happens after
onTick
. Because of that, the cloned players will always mimic player 1, even if their keys are modified duringonInputUpdate
. To fix this issue, I patched the clown car subroutine to skip the key updating code and I rewrote it in theUpdateInputFinishHook
procedure to make sure it is executed right beforeonInputUpdate
.Example using the
supermario4
cheat code and the following lua code:Before:
After: