[Relz/Alpha] How to Patch Animations at Load Time

Post » Sat Jul 10, 2010 5:59 pm

In this post I have included most of my source code, but not all because some of it isn't relevant enough for someone to understand how it works.
There is a tendency for the program to cause an error on exit of the game.
The source code is meant to be put inside a .DLL and, the .DLL injected into Fallout 3.

Only tested on Patch 1.7 English, OS used was Windows 7 x64 Professional

Let me know if this works for you too. I won't be releasing the actual program until I get a bit more done.

Copyright 2010 Nilla Cakester
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

See .

typedef int (__cdecl * Sub_54C5C0_Prototype)(int, char*);Sub_54C5C0_Prototype Sub_54C5C0_Pointer = NULL;std::vector<std::string> pathList;int nCounter = 0;int __cdecl Sub_54C5C0_Detour(int id, char* Str){	std::string str1copy;	str1copy.append(Str);	size_t found;	found = str1copy.find("mt"); //mt means movement, so all movement animations will be found this way		if (found != std::string::npos )	{		if(nCounter == 2)			nCounter = 0;				DWORD ret;		char* chpTest = new char[pathList[nCounter].length()+1];		memcpy(chpTest, pathList[nCounter].c_str(), pathList[nCounter].length()+1);					try		{		_asm pushad;		ret = Sub_54C5C0_Pointer(id, chpTest);		_asm popad;		}		catch (char* strException)		{			MessageBox(NULL, strException, "Error", MB_OK);		}nCounter++;delete [] chpTest;		return ret;		}		_asm pushad;		DWORD ret2 = Sub_54C5C0_Pointer(id, Str);	_asm popad;			return ret2;}  DWORD WINAPI LoopFunction(LPVOID param){		MessageBox(0, "Starting", "ok", MB_OK); //When You inject, you should see this first thing		//change the paths with different animations if you want	pathList.push_back("Characters\\_male\\2haattackloop.kf");	pathList.push_back("Characters\\_male\\1gtattackthrow.kf");	pathList.push_back("Characters\\_male\\2hrattack3.kf");	Sub_54C5C0_Pointer = (Sub_54C5C0_Prototype)DetourFunction((PBYTE)0x54C5C0, (PBYTE)Sub_54C5C0_Detour); //DetourFunction is from MS Detours	while(1)	{		Sleep(200);	}	   pathList.clear();	return TRUE;}



For videos of me testing:
http://www.youtube.com/watch?v=lI9kYoR5QRY
http://www.youtube.com/watch?v=8P2BBQa2tms
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am

Post » Sat Jul 10, 2010 10:39 pm

I think I just figured out that this isn't useful. We can already safely override the player animations and maintain the original .kf in our meshes archive. uh...
:(
User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am

Post » Sat Jul 10, 2010 11:32 am

We can run playidle to play specific animations, and we can override using SpecialAnims, but I don't believe we can change the the player's action anims on the fly. The guy working on the hover-chair was looking for a way to sit down and still shoot, which you seem to have figured out, so it's definitely useful.
User avatar
Kieren Thomson
 
Posts: 3454
Joined: Sat Jul 21, 2007 3:28 am

Post » Sat Jul 10, 2010 11:41 pm

We can run playidle to play specific animations, and we can override using SpecialAnims, but I don't believe we can change the the player's action anims on the fly. The guy working on the hover-chair was looking for a way to sit down and still shoot, which you seem to have figured out, so it's definitely useful.


I don't know what exactly caused the sit down and still shoot. But this hack will only be effective once. By that I mean the game only loads all the animations the first time you load a saved game. And the function I chose, can't force a reload.
I will have to do more digging maybe.
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Sat Jul 10, 2010 11:10 pm

Fair enough then. Bit of a shame, but c'est la vie.
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am


Return to Fallout 3