-
[Released]Dumped Menu Files
it wasn't using regex, but thanks I've updated the archive on mediafire. oh, seemingly I need to update again edit: updated with new files, same mediafire link.
-
[Released]Dumped Menu Files
visible things are not working indeed... until aerosoul94 fixes that (and reuploads it, the mediafire link has died), heres a version of his, with all the menus in individual files. I can't post links yet, so heres the mediafire id: 56iamisqrddzj14 http://www.mediafire.com/?56iamisqrddzj14
-
[CODE] GSC 'unknown function' reporting
2nd post, the count is off.... I've been waiting in the background for some time... welcome I guess they are used for caching
-
[CODE] GSC 'unknown function' reporting
thought I might as well contribute currently if you make a function type in gsc, you get an error 'unknown function' it doesn't tell you the name or what file the error is from, though heres a patch to do just that (displays function name and file name): Index: PatchMW2ScriptCompileDebug.cpp =================================================================== --- PatchMW2ScriptCompileDebug.cpp (revision 122) +++ PatchMW2ScriptCompileDebug.cpp (working copy) @@ -10,6 +10,7 @@ // ========================================================== #include "StdInc.h" +#include "Script.h" const char* currentScriptFilename; @@ -152,6 +153,68 @@ Com_Error(5, "script compile error\n%s\n%s\n(see console for actual details)\n", msgbuf, scriptFilename); } +DWORD FunctionLookupStartRetn = (DWORD)0x612DB6; +DWORD FunctionLookupUnkStubRetn = (DWORD)0x612E92; +DWORD FunctionLookupUnkStub2Retn = (DWORD)0x612EA7; + +int functionRef; +char* functionStr; + +void FunctionLookupUnkFunc() +{ + functionStr = SL_ConvertToString((unsigned short)functionRef); + + char scriptFilename[512]; + + if (strstr(currentScriptFilename, ".gsc") == 0) + { + _snprintf(scriptFilename, sizeof(scriptFilename), "%s.gsc", currentScriptFilename); + } + else + { + strcpy(scriptFilename, currentScriptFilename); + } + + Com_Printf(23, "\n"); + Com_Printf(23, "******* script compile error *******\n"); + Com_Printf(23, "Howdy there, fella' - it seems you made a mistake!\n"); + Com_Printf(23, "Error: unknown function %s in %s\n", functionStr, scriptFilename); + Com_Printf(23, "************************************\n"); + + Com_Error(5, "script compile error\nunknown function %s\n%s\n", functionStr, scriptFilename); +} + +void __declspec(naked) FunctionLookupUnkStub() +{ + __asm + { + call FunctionLookupUnkFunc + mov edx, [ebx] + jmp FunctionLookupUnkStubRetn + } +} + +void __declspec(naked) FunctionLookupUnkStub2() +{ + __asm + { + call FunctionLookupUnkFunc + jmp FunctionLookupUnkStub2Retn + } +} + +void __declspec(naked) FunctionLookupStart() +{ + __asm + { + mov eax, [esp-8] + mov functionRef, eax + sub esp, 0Ch + push 0 + push edi + jmp FunctionLookupStartRetn + } +} void PatchMW2_ScriptCompileDebug() { scriptSetFileNameHook.initialize(scriptSetFileNameHookLoc, ScriptSetFileNameHookStub, 7); @@ -163,6 +226,11 @@ compileErrorHook.initialize(compileErrorHookLoc, CompileError); compileErrorHook.installHook(); + // unknown function reporting + call(0x612DB0, FunctionLookupStart, PATCH_JUMP); // to get the function name + call(0x612E85, FunctionLookupUnkStub, PATCH_JUMP); // first occurence + call(0x612E9C, FunctionLookupUnkStub2, PATCH_JUMP); // second occurence + // increase various stack bits as we push/pop ebx as well now #define ADD_STACK_BYTE(address) *(BYTE*)address += 4; #define ADD_STACK_DWORD(address) *(DWORD*)address += 4; hopefully nta will add it officially
-
hi
True, but that was only to play the game. Now I've joined the forums.
-
hi
I'm zebra, happy to join this community of cool people.
zebra
Игрок
-
Зарегистрирован
-
Посещение