1) Motion wall is that thing on top and bottom of Ironhead fight. For how to use it look at that map and see what Pixel did because I'm not sure.Miles_Valentine said:Briefly, what exactly is a motion wall and how is it used?
Oh and, how could i force an auto save?
Dubby said:I'm not really sure if this is a "Quick" kind of question but I need to modify entity 186 (the 1x1 vertical lift block that's only used once). It's already feasible to animate the lift block npc in any direction with <ANP, that's not really a problem. The problems are:
1) The lift block npc has no collision checks for tiles (doesn't matter if ignore solid is checked or not). So once animated, it won't stop if it comes across solid tiles.
2) Quote's horizontal movement isn't affected by the horizontal movement of the lift block.
I can do little things... like changing values for velocity, an AI's chances of doing something, how much spread projectiles have, etc. on my own, but the lift block npc's address range in the exe is very short, and I'm assuming too short to accommodate solid tile collision and carrying Quote properly. So, what has to be done? I'd very much appreciate extensive help on this, as I'm getting close to an early public release with my project.
CPU Disasm
Address Hex dump Command Comments
0044CCA6 |. 0FB748 50 movzx ecx,word ptr [eax+50]
0044CCAA |. 83C9 08 or ecx,00000008
0044CCAD |. 8B55 08 mov edx,[ebp+8]
Noxid said:It may require some rearranging/optimizing.
You have to set up a global variable for the delay; every time you fire set it to the time you want the delay to be and then elsewhere in the code decrement it every frame. This is how the machine gun works.Miles_Valentine said:See for weapon hacking, is it at all possible to make a gun delay as if its being reloaded? Would i need to abuse the spurs charging feature?
My first weapon is a crossbow, so it needs good damage, great range but a pretty low rate of fire.
Dubby said:In NpcSym, does anyone know what npc(s) use these graphics:?
Noxid said:You have to set up a global variable for the delay; every time you fire set it to the time you want the delay to be and then elsewhere in the code decrement it every frame. This is how the machine gun works.
... after check for Key_Pressed
mov eax, [4BBA00]
test eax, eax
jnz :DontShoot
mov dword [4BBA00], 40 ;or whatever amt. of time you want
... rest of bullet creating code
...
:DontShoot
mov eax, [4BBA00]
dec eax
cmp eax, 0
jl :AlreadyZero
mov [4BBA00], eax
:AlreadyZero
... exit function or whatever
Noxid said:As far as I know, it's not used by anything. There are a few different sprites that are simply unused, like the ones from the sand zone tileset.
Noxid said:Basically it works like this: You decide on a global variable (Let's say [4BBA00]), and then you add some code like this
Because not all weapons are set up to have this global variable to count shot rate it's not just a thing where you can tweak a value, you have to work in some new code. The tricky part is finding room for it.Code:... after check for Key_Pressed mov eax, [4BBA00] test eax, eax jnz :DontShoot mov dword [4BBA00], 40 ;or whatever amt. of time you want ... rest of bullet creating code ... :DontShoot mov eax, [4BBA00] dec eax cmp eax, 0 jl :AlreadyZero mov [4BBA00], eax :AlreadyZero ... exit function or whatever
Extremely easy, in my opinion. One thing you could do is take an entity, copy over the framerects from the heart machine to it, give them different values and then simply JMP to the heart machine's code @ the part after it initializes its own framerectsDubby said:How hard would it be to make use of them then? Like, say I want to make a copy of the health/ammo refill NPC, but with a different pair of sprites.
Miles_Valentine said:Ok so 40 represents the delay i want to introduce...And i want to introduce this number into a (spare?) global variable address? I'm not sure on how i'd pick an address like this and how i'd get something else to read it.
So this is something that would be made from scratch nestled above the bullet code? Sorry i'm just trying to get my head around this.
Noxid said:Extremely easy, in my opinion. One thing you could do is take an entity, copy over the framerects from the heart machine to it, give them different values and then simply JMP to the heart machine's code @ the part after it initializes its own framerects
That is correct. The global variable I gave you is actually a spare one so feel free to use it. As for reading it that's not an issue at all, I have the commands right there: Mov eax, [4BBA00] will put the value of the global into eax, etc. etc., globals are in fact quite easy to work with. Downside is they take up a lot of space in the code.
CPU Disasm
Address Hex dump Command Comments
0041DE60 /$ 55 push ebp ; Beginning of code
0041DE61 |. 8BEC mov ebp,esp ; enter stack frame
0041DE63 |. 83EC 08 sub esp,8 ; 2 local variables
0041DE66 |. 8B45 08 mov eax,[arg.1] ; arg1 == weapon Level
0041DE69 |. 8945 F8 mov [local.2],eax
0041DE6C |. 837D F8 01 cmp dword ptr [local.2],1 ; This chunk takes the weapon level
0041DE70 |. 74 0E je short 0041DE80 ; and assigns a local var for the bullet #
0041DE72 |. 837D F8 02 cmp dword ptr [local.2],2 ; based on what it is
0041DE76 |. 74 11 je short 0041DE89 ; in a very inefficent manner, mind you.
0041DE78 |. 837D F8 03 cmp dword ptr [local.2],3
0041DE7C |. 74 14 je short 0041DE92
0041DE7E |. EB 19 jmp short 0041DE99
0041DE80 |> C745 FC 04000 mov dword ptr [local.1],4 ; This bit would be a good place
0041DE87 |. EB 10 jmp short 0041DE99 ; to make some space
0041DE89 |> C745 FC 05000 mov dword ptr [local.1],5
0041DE90 |. EB 07 jmp short 0041DE99
0041DE92 |> C745 FC 06000 mov dword ptr [local.1],6
0041DE99 |> 6A 02 push 2 ; /Arg1 = 2, for weapon 2 (polar star)
0041DE9B |. E8 A05DFEFF call 00403C40 ; \Particle3.00403C40, count # shots
0041DEA0 |. 83C4 04 add esp,4
0041DEA3 |. 83F8 01 cmp eax,1
0041DEA6 |. 7E 05 jle short 0041DEAD ; if returned 1 or zero, continue
0041DEA8 |. E9 5A020000 jmp 0041E107 ; else goto end of code
0041DEAD |> 8B0D 14E24900 mov ecx,[49E214] ; get Key_Pressed
0041DEB3 |. 230D 14364900 and ecx,[493614] ; get ShootKey
0041DEB9 |. 0F84 48020000 je 0041E107 ; if ShootKey not pressed, goto end of code
*******This is where you would check the shotTimer*******
0041DEBF |. 6A 01 push 1 ; /Arg1 = 1
0041DEC1 |. E8 DA40FEFF call 00401FA0 ; \Particle3.00401FA0, remove 1 ammo from current weapon
0041DEC6 |. 83C4 04 add esp,4
0041DEC9 |. 85C0 test eax,eax ; if returns success (nonzero)
0041DECB |. 75 11 jne short 0041DEDE ; skip this bit{
0041DECD |. 6A 01 push 1 ; /Arg2 = 1, mode 1
0041DECF |. 6A 25 push 25 ; |Arg1 = 25, sound 0x25
0041DED1 |. E8 6A270000 call 00420640 ; \Particle3.00420640, playSound
0041DED6 |. 83C4 08 add esp,8
0041DED9 |. E9 29020000 jmp 0041E107 ; jump to end of code}
0041DEDE |> 833D 44E64900 cmp dword ptr [49E644],0 ; if [IsFacingUp] == 0
0041DEE5 |. 0F84 A8000000 je 0041DF93 ; go to this place
0041DEEB |. 833D 40E64900 cmp dword ptr [49E640],0 ; if [DirectionFaced] != 0
0041DEF2 |. 75 4C jne short 0041DF40 ; goto this place
0041DEF4 |. 6A 01 push 1 ; /Arg4 = 1, {Create bullet, facing up and left
0041DEF6 |. 8B15 58E64900 mov edx,[49E658] ; |^ direction
0041DEFC |. 81EA 00100000 sub edx,1000 ; |
0041DF02 |. 52 push edx ; |Arg3, ypos
0041DF03 |. A1 54E64900 mov eax,[49E654] ; |
0041DF08 |. 2D 00020000 sub eax,200 ; |
0041DF0D |. 50 push eax ; |Arg2, xpos
0041DF0E |. 8B4D FC mov ecx,[local.1] ; |
0041DF11 |. 51 push ecx ; |Arg1 => [LOCAL.1], bullet type
0041DF12 |. E8 6960FEFF call 00403F80 ; \Particle3.00403F80
0041DF17 |. 83C4 10 add esp,10
0041DF1A |. 6A 00 push 0 ; arg4 = mode
0041DF1C |. 6A 03 push 3 ; arg3 = effect type
0041DF1E |. 8B15 58E64900 mov edx,[49E658]
0041DF24 |. 81EA 00100000 sub edx,1000
0041DF2A |. 52 push edx ; arg2 = ypos
0041DF2B |. A1 54E64900 mov eax,[49E654]
0041DF30 |. 2D 00020000 sub eax,200
0041DF35 |. 50 push eax ; arg1 = xpos
0041DF36 |. E8 55CDFEFF call 0040AC90 ; Create effect
0041DF3B |. 83C4 10 add esp,10
0041DF3E |. EB 4E jmp short 0041DF8E ; }
0041DF40 |> 6A 01 push 1 ; /Arg4 = 1, {Create bullet, facing up and right
0041DF42 |. 8B0D 58E64900 mov ecx,[49E658] ; |^ direction
0041DF48 |. 81E9 00100000 sub ecx,1000 ; |
0041DF4E |. 51 push ecx ; |Arg3, ypos
0041DF4F |. 8B15 54E64900 mov edx,[49E654] ; |
0041DF55 |. 81C2 00020000 add edx,200 ; |
0041DF5B |. 52 push edx ; |Arg2, xpos
0041DF5C |. 8B45 FC mov eax,[local.1] ; |
0041DF5F |. 50 push eax ; |Arg1 => [LOCAL.1], bullet type
0041DF60 |. E8 1B60FEFF call 00403F80 ; \Particle3.00403F80
0041DF65 |. 83C4 10 add esp,10
0041DF68 |. 6A 00 push 0 ; arg4 = mode
0041DF6A |. 6A 03 push 3 ; arg3 = effect type
0041DF6C |. 8B0D 58E64900 mov ecx,[49E658]
0041DF72 |. 81E9 00100000 sub ecx,1000
0041DF78 |. 51 push ecx ; arg2 = ypos
0041DF79 |. 8B15 54E64900 mov edx,[49E654]
0041DF7F |. 81C2 00020000 add edx,200
0041DF85 |. 52 push edx ; arg1 = xpos
0041DF86 |. E8 05CDFEFF call 0040AC90 ; Create effect
0041DF8B |. 83C4 10 add esp,10
0041DF8E |> E9 54010000 jmp 0041E0E7 ; }
0041DF93 |> 833D 48E64900 cmp dword ptr [49E648],0 ; if [IsFacingDown] == 0
0041DF9A |. 0F84 A4000000 je 0041E044 ; goto this place
0041DFA0 |. 833D 40E64900 cmp dword ptr [49E640],0 ; if [DirectionFaced] != 0
0041DFA7 |. 75 4C jne short 0041DFF5 ; goto this place
0041DFA9 |. 6A 03 push 3 ; /Arg4 = 3, {Create bullet, facing down and left
0041DFAB |. A1 58E64900 mov eax,[49E658] ; |^ direction
0041DFB0 |. 05 00100000 add eax,1000 ; |
0041DFB5 |. 50 push eax ; |Arg3, ypos
0041DFB6 |. 8B0D 54E64900 mov ecx,[49E654] ; |
0041DFBC |. 81E9 00020000 sub ecx,200 ; |
0041DFC2 |. 51 push ecx ; |Arg2, xpos
0041DFC3 |. 8B55 FC mov edx,[local.1] ; |
0041DFC6 |. 52 push edx ; |Arg1 => [LOCAL.1], bullet type
0041DFC7 |. E8 B45FFEFF call 00403F80 ; \Particle3.00403F80
0041DFCC |. 83C4 10 add esp,10
0041DFCF |. 6A 00 push 0 ; arg4 = mode
0041DFD1 |. 6A 03 push 3 ; arg3 = effect type
0041DFD3 |. A1 58E64900 mov eax,[49E658]
0041DFD8 |. 05 00100000 add eax,1000
0041DFDD |. 50 push eax ; arg2 = ypos
0041DFDE |. 8B0D 54E64900 mov ecx,[49E654]
0041DFE4 |. 81E9 00020000 sub ecx,200
0041DFEA |. 51 push ecx ; arg1 = xpos
0041DFEB |. E8 A0CCFEFF call 0040AC90 ; Create effect
0041DFF0 |. 83C4 10 add esp,10
0041DFF3 |. EB 4A jmp short 0041E03F ; }
0041DFF5 |> 6A 03 push 3 ; /Arg4 = 3, {Create bullet, facing down and right
0041DFF7 |. 8B15 58E64900 mov edx,[49E658] ; |^ direction
0041DFFD |. 81C2 00100000 add edx,1000 ; |
0041E003 |. 52 push edx ; |Arg3, ypos
0041E004 |. A1 54E64900 mov eax,[49E654] ; |
0041E009 |. 05 00020000 add eax,200 ; |
0041E00E |. 50 push eax ; |Arg2, xpos
0041E00F |. 8B4D FC mov ecx,[local.1] ; |
0041E012 |. 51 push ecx ; |Arg1 => [LOCAL.1], bullet type
0041E013 |. E8 685FFEFF call 00403F80 ; \Particle3.00403F80
0041E018 |. 83C4 10 add esp,10
0041E01B |. 6A 00 push 0 ; arg4 = mode
0041E01D |. 6A 03 push 3 ; arg3 = effect type
0041E01F |. 8B15 58E64900 mov edx,[49E658]
0041E025 |. 81C2 00100000 add edx,1000
0041E02B |. 52 push edx ; arg2 = ypos
0041E02C |. A1 54E64900 mov eax,[49E654]
0041E031 |. 05 00020000 add eax,200
0041E036 |. 50 push eax ; arg1 = xpos
0041E037 |. E8 54CCFEFF call 0040AC90 ; Create effect
0041E03C |. 83C4 10 add esp,10
0041E03F |> E9 A3000000 jmp 0041E0E7 ; }
0041E044 |> 833D 40E64900 cmp dword ptr [49E640],0 ; if [DirectionFaced] != 0
0041E04B |. 75 50 jne short 0041E09D ; goto this place
0041E04D |. 6A 00 push 0 ; /Arg4 = 0, {Create bullet, facing left
0041E04F |. 8B0D 58E64900 mov ecx,[49E658] ; |^ direction
0041E055 |. 81C1 00060000 add ecx,600 ; |
0041E05B |. 51 push ecx ; |Arg3, ypos
0041E05C |. 8B15 54E64900 mov edx,[49E654] ; |
0041E062 |. 81EA 000C0000 sub edx,0C00 ; |
0041E068 |. 52 push edx ; |Arg2, xpos
0041E069 |. 8B45 FC mov eax,[local.1] ; |
0041E06C |. 50 push eax ; |Arg1 => [LOCAL.1], bullet type
0041E06D |. E8 0E5FFEFF call 00403F80 ; \Particle3.00403F80
0041E072 |. 83C4 10 add esp,10
0041E075 |. 6A 00 push 0 ; arg4 = mode
0041E077 |. 6A 03 push 3 ; arg3 = effect type
0041E079 |. 8B0D 58E64900 mov ecx,[49E658]
0041E07F |. 81C1 00060000 add ecx,600
0041E085 |. 51 push ecx ; arg2 = ypos
0041E086 |. 8B15 54E64900 mov edx,[49E654]
0041E08C |. 81EA 00180000 sub edx,1800
0041E092 |. 52 push edx ; arg1 = xpos
0041E093 |. E8 F8CBFEFF call 0040AC90 ; Create effect
0041E098 |. 83C4 10 add esp,10
0041E09B |. EB 4A jmp short 0041E0E7 ; }
0041E09D |> 6A 02 push 2 ; /Arg4 = 2, {Create bullet, facing right
0041E09F |. A1 58E64900 mov eax,[49E658] ; |^ direction
0041E0A4 |. 05 00060000 add eax,600 ; |
0041E0A9 |. 50 push eax ; |Arg3, ypos
0041E0AA |. 8B0D 54E64900 mov ecx,[49E654] ; |
0041E0B0 |. 81C1 000C0000 add ecx,0C00 ; |
0041E0B6 |. 51 push ecx ; |Arg2, xpos
0041E0B7 |. 8B55 FC mov edx,[local.1] ; |
0041E0BA |. 52 push edx ; |Arg1 => [LOCAL.1], bullet type
0041E0BB |. E8 C05EFEFF call 00403F80 ; \Particle3.00403F80
0041E0C0 |. 83C4 10 add esp,10
0041E0C3 |. 6A 00 push 0 ; arg4 = mode
0041E0C5 |. 6A 03 push 3 ; arg3 = effect type
0041E0C7 |. A1 58E64900 mov eax,[49E658]
0041E0CC |. 05 00060000 add eax,600
0041E0D1 |. 50 push eax ; arg2 = ypos
0041E0D2 |. 8B0D 54E64900 mov ecx,[49E654]
0041E0D8 |. 81C1 00180000 add ecx,1800
0041E0DE |. 51 push ecx ; arg1 = xpos
0041E0DF |. E8 ACCBFEFF call 0040AC90 ; Create effect
0041E0E4 |. 83C4 10 add esp,10
0041E0E7 |> 837D 08 03 cmp dword ptr [arg.1],3 ; } if level == 3
0041E0EB |. 75 0E jne short 0041E0FB
0041E0ED |. 6A 01 push 1 ; /Arg2 = 1, mode 1
0041E0EF |. 6A 31 push 31 ; |Arg1 = 31, sound 0x31
0041E0F1 |. E8 4A250000 call 00420640 ; \Particle3.00420640, playSound
0041E0F6 |. 83C4 08 add esp,8
0041E0F9 |. EB 0C jmp short 0041E107 ; jmp to end of code
0041E0FB |> 6A 01 push 1 ; /Arg2 = 1, else mode 1,
0041E0FD |. 6A 20 push 20 ; |Arg1 = 20, sound 0x20,
0041E0FF |. E8 3C250000 call 00420640 ; \Particle3.00420640, playSound
0041E104 |. 83C4 08 add esp,8
; End of code (leave stack frame) *******This is where you would decrement the shotTimer global********
0041E107 |> 8BE5 mov esp,ebp
0041E109 |. 5D pop ebp
0041E10A \. C3 retn