I have the following code to send a block of text to a users' game console (Crysis Wars):
CMCCPlayer(player, "================================================================================================================");
CMCCPlayer(player, "$4#### ### ### ###### ####");
CMCCPlayer(player, "$4## ### ### ## ## ##");
CMCCPlayer(player, "$4## ### ### ## ##");
CMCCPlayer(player, "$4## ### ##### ###### ### ##");
CMCCPlayer(player, "$4## ### ### ## ##");
CMCCPlayer(player, "$4## ### ### ## ## ## ");
CMCCPlayer(player, "$4#### ### ### ###### ####");
CMCCPlayer(player, "================================================================================================================");
But I get this result:
This problem has practically plagued the Crysis Wars developer community, and there have been no real solutions to this. The code formats fine if I do it straight from C++ as opposed to Lua to C++,, so this must be a problem Lua-side.
I have tried timing the messages to 1ms apart, and this resulted in some messages going missing (probably because recent messages override the old ones). Do you guys have any suggestions or solutions to this issue? If you provide a working solution, you'll be pretty famous within the Crysis Wars developer community as you would have solved a pretty annoying bug :). I would offer some of my reputation but unfortunately I awarded the bounty this morning to someone for solving another issue.
Function code for sending the messages:
function CMCCPlayer(player, msg)
g_gameRules.game:SendConsoleMessage(player.id, g_gameRules.game:CentreTextForConsole(msg));
end
If this helps for anything, here's the C++ SendConsoleMessage code:
int CScriptBind_GameRules::SendConsoleMessage(IFunctionHandler *pH, ScriptHandle playerId, const char *msg)
{
CGameRules *pGameRules=GetGameRules(pH);
if (!pGameRules)
return pH->EndFunction();
int channelId=pGameRules->GetChannelId((EntityId)playerId.n);
pGameRules->SendTextMessage(eTextMessageConsole, msg, eRMI_ToClientChannel, channelId);
msg=0; //Null the message.
return pH->EndFunction();
}
Edit:
Please note that this isn't to do with the text used to center and that the image and text block below is only provided as an example; this issue occurs on every piece of code that is sent.