View Full Version : removing sniper rifle sway when zoomed
caliber1942
7th November 2006, 00:45
i haven't messed with it much but i haven't been able to narrow down the code or DMA that is controlling the sway. looking in the .TWEAK file for the rifles i find the following:
rem ---BeginComp:DefaultGunSwayComp ---
ObjectTemplate.createComponent DefaultGunSwayComp
ObjectTemplate.sway.gunSwayUseZoom 1
ObjectTemplate.sway.gunSwayPitchSteps 26
ObjectTemplate.sway.gunSwayPitchFactor 4
ObjectTemplate.sway.gunSwayPitchMax 3
ObjectTemplate.sway.gunSwayPitchDirModifier 1
ObjectTemplate.sway.gunSwayPitchDirThreshold 1
ObjectTemplate.sway.gunSwayLrRandomMin -4.31602e+008
ObjectTemplate.sway.gunSwayLrRandomMax -4.31602e+008
rem ---EndComp ---
but i cannot modify the settings with the console like we can other things (even with the unlocker.dll)
trying various things while within the game (checking for 0 then 1 when zoomed then unzoomed, etc.) got me to several lines of code, but none of them controlled the sway directly. some help here or discussion would be nice-
some interesting areas of code were:
renddx9.dll
3c917e1 mov esi,[ecx+0x274]
3c917f0 mov [ecx+0x274],esi
3c93f01 mov eax,[ebx+0x274]
3c954b0 mov eax,[ecx+0x274]
3c93fd7 mov eax,[ebx+0x274]
bf2142.exe
83dc20 mov eax,[ecx+0xC]
5d1110 cmp dword ptr [ecx+0xC],0x0
5d142e mov eax,[esi+0xC]
5d148d cmp dword ptr [esi+0xC],0x0
but they only controlled the overlay it seems-
some help bros-
best,
Cal
Kaz
8th November 2006, 08:37
Thanks for the help :) I'm currently looking into this as well.
peek
9th November 2006, 22:09
i haven't messed with it much but i haven't been able to narrow down the code or DMA that is controlling the sway. looking in the .TWEAK file for the rifles i find the following:
rem ---BeginComp:DefaultGunSwayComp ---
ObjectTemplate.createComponent DefaultGunSwayComp
ObjectTemplate.sway.gunSwayUseZoom 1
ObjectTemplate.sway.gunSwayPitchSteps 26
ObjectTemplate.sway.gunSwayPitchFactor 4
ObjectTemplate.sway.gunSwayPitchMax 3
ObjectTemplate.sway.gunSwayPitchDirModifier 1
ObjectTemplate.sway.gunSwayPitchDirThreshold 1
ObjectTemplate.sway.gunSwayLrRandomMin -4.31602e+008
ObjectTemplate.sway.gunSwayLrRandomMax -4.31602e+008
rem ---EndComp ---
but i cannot modify the settings with the console like we can other things (even with the unlocker.dll)
trying various things while within the game (checking for 0 then 1 when zoomed then unzoomed, etc.) got me to several lines of code, but none of them controlled the sway directly. some help here or discussion would be nice-
some interesting areas of code were:
renddx9.dll
3c917e1 mov esi,[ecx+0x274]
3c917f0 mov [ecx+0x274],esi
3c93f01 mov eax,[ebx+0x274]
3c954b0 mov eax,[ecx+0x274]
3c93fd7 mov eax,[ebx+0x274]
bf2142.exe
83dc20 mov eax,[ecx+0xC]
5d1110 cmp dword ptr [ecx+0xC],0x0
5d142e mov eax,[esi+0xC]
5d148d cmp dword ptr [esi+0xC],0x0
but they only controlled the overlay it seems-
some help bros-
best,
Cal
Hello
Here is piece of code from demo, it will be same or similar on full game, just search for opcodes:
.text:005D32F9 8B 46 0C mov eax, [esi+0Ch]
.text:005D32FC 8B 90 A0 01 00 00 mov edx, [eax+1A0h]
.text:005D3302 8D 88 A0 01 00 00 lea ecx, [eax+1A0h]
.text:005D3308 57 push edi
.text:005D3309 FF 92 30 01 00 00 call dword ptr [edx+130h]
.text:005D330F D8 4D F8 fmul [ebp+var_8]
.text:005D3312 D9 46 5C fld dword ptr [esi+5Ch]
.text:005D3315 8B 46 20 mov eax, [esi+20h]
.text:005D3318 D8 4E 30 fmul dword ptr [esi+30h]
.text:005D331B 8B 7D 10 mov edi, [ebp+arg_8]
.text:005D331E 8B 8F 00 01 00 00 mov ecx, [edi+100h]
.text:005D3324 83 E1 20 and ecx, 20h
.text:005D3327 D8 48 24 fmul dword ptr [eax+24h]
Above is fmul instruction what use gunSwayPitchFactor value, if value is set to 0 then "breath" effect will gone :)
.text:005D332A 33 D2 xor edx, edx
.text:005D332C 8B C1 mov eax, ecx
.text:005D332E 0B C2 or eax, edx
.text:005D3330 DE C9 fmulp st(1), st
.text:005D3332 D8 4D FC fmul [ebp+var_4]
.text:005D3335 D8 4D 08 fmul [ebp+arg_0]
.text:005D3338 74 05 jz short loc_5D333F
.text:005D333A D9 47 14 fld dword ptr [edi+14h]
.text:005D333D EB 06 jmp short loc_5D3345
About DMA, try to find out static pointer... I didn't try coz I have no time now, but I think it's simple too :) I just read Your post today and want to help.
b.r.
ps.
.text:004E06C0 83 F8 01 cmp eax, 1
.text:004E06C3 75 26 jnz short loc_4E06EB
.text:004E06C5 8B 46 24 mov eax, [esi+24h]
.text:004E06C8 8B 00 mov eax, [eax]
.text:004E06CA C6 86 A0 00 00 00 00 mov byte ptr [esi+0A0h], 0
.text:004E06D1 8B 15 14 B4 97 00 mov edx, ds:dword_97B414
.text:004E06D7 8B 0D F8 D5 8F 00 mov ecx, ds:dword_8FD5F8
.text:004E06DD 89 45 FC mov [ebp+var_4], eax
.text:004E06E0 E8 8B 1F 20 00 call sub_6E2670
.text:004E06E5 8B 4D FC mov ecx, [ebp+var_4]
.text:004E06E8 89 48 24 mov [eax+24h], ecx < -- Here is wroted Sway value from gunSwayPitchFactor variable, maybe it will help U some
.text:004E06EB
.text:004E06EB loc_4E06EB: ; CODE XREF: sub_4E068B+38j
.text:004E06EB 33 C0 xor eax, eax
.text:004E06ED
.text:004E06ED loc_4E06ED: ; CODE XREF: sub_4E068B+33j
.text:004E06ED 5E pop esi
.text:004E06EE C9 leave
.text:004E06EF C3 retn
firebat
10th November 2006, 00:37
Cool. Do you mind showing me how you found it? I tried to do it for hours but nothing worked, and here you solved it so fast :)
caliber1942
13th November 2006, 19:28
i found the code in the retail but tracing the DMA has been difficult. i have the hardest time with DMA's tracing them to the basepointers. If anyone wants a challenge trace the following code location to the basepointer-
5d7dd7 fmul dword ptr [eax+24h]
thanks-
Cal
SINE
19th November 2006, 03:26
I posted some pointers at Dubbl's site, if anyone is interested here it is:
http://www.battlecoders.com/forum/index.php?act=ST&f=31&t=850&st=0#entry8547
cheers,
Sine
caliber1942
19th November 2006, 18:54
thanks SINE. that was some explanation. looks like it was alot of work. you have SICK debugging and tracing skills-
best,
Cal
Sin...HAx
19th November 2006, 22:45
nive 1 guy ppl will like this :P
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.