Bombchu Link's Open source Mods!

Jan 16, 2016 at 11:41 AM
Senior Member
"Huzzah!"
Join Date: Dec 2, 2015
Location:
Posts: 211
Age: 25
Pronouns: he/him
Hey Bombchu Link, I was wondering if you (or anyone else really) could help me with something. I'm trying to learn to Npc hack and I've been following your guide. Got up to the point where it explains how to render graphics aaaand I got stuck there.

This is a little experiment I tried to do:

offset 3F280 ;Npc 93 [0x0039DC0] Npc 79 [0x006690] Npc 120 [0x003F280]
(I got these offsets from Noxid's Assembly Compendium.)

#define

setpointer = mov ecx, [ebp+8]

npc.DisplayL = [ecx+54]

npc.DisplayU = [ecx+58]

npc.DisplayR = [ecx+5C]

npc.DisplayD = [ecx+60]

#enddefine

push ebp
mov ebp,esp
sub esp,10

mov dword [ebp-10],0
mov dword [ebp-c],0
mov dword [ebp-8],10
mov dword [ebp-4],10
setpointer

:Render
mov eax, [ebp-10]
mov npc.DisplayL, eax

mov eax, [ebp-C]
mov npc.DisplayU, eax

mov eax, [ebp-8]
mov npc.DisplayR, eax

mov eax, [ebp-4]
mov npc.DisplayD, eax

mov esp,ebp
pop ebp
retn

I was just trying to move the framerects to the top-left part of the spritesheets, but when I loaded the game up with BL, It didn't change at all. I tried using different npc's but they didn't work either, strangely enough, they just made my game crash.

So I was wondering if you(or anyone else) could tell me what i'm doing wrong? I've read a little ahead in the guide, but that didn't really help me.

I've actually taken some of your codes(like the one you made for Xin)and copy/pasted it into the assembler just to see if it would work. It didn't work for me because it said that it couldn't reconize the setpointer instruction. (Don't know why it says setnpinter, it says setpointer in the text.)
upload_2016-1-16_5-24-55.png

And I also had the same issue with the npc.displayL.U.R.D. So I tried to define them.

#define

setpointer = mov ecx, [ebp+8]

npc.DisplayL = [ecx+54]

npc.DisplayU = [ecx+58]

npc.DisplayR = [ecx+5C]

npc.DisplayD = [ecx+60]

#enddefine

I'm pretty sure these defines are right, which actually leads me to another question:
How come in your codes, you don't define what the pointer and displays are?
Am I being a complete moron? Is defining them the completely wrong thing to do?
I'd really appreciate your help on this because I really want to do a lot of npc hacking for my upcoming mod.
(Also, I would of put this all in a spoilers, but I have no idea how to do that, pretty sure I saw some instructions on how to somewhere on the forums, but now I can't find it.)
 
Last edited:
Jan 16, 2016 at 4:24 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
@Kenzo_ITC

First of all the offset is wrong, it has to start with 4 such as 43F280 the assembler doesn't like 0x iirc

That might be why the assembler is giving you the error?

Anyway

Code:
offset NPC120 ;just typing NPC followed by a three digit number should give you the offset you're looking for without having to look anything up yourself; NPC001 NPC025 NPC134 ect

push ebp
mov ebp,esp
sub esp,10

mov dword [ebp-10],0
mov dword [ebp-c],0
mov dword [ebp-8],10
mov dword [ebp-4],10
setpointer

You do realise why this is done right? you're setting the values of your liking into the local variables.

It's a nice thought but there's a better way to do it:

Code:
push ebp
mov ebp,esp
sub esp,10
xor eax, eax ;exactly the same as mov eax, 0 but takes less space

mov dword [ebp-10],eax   ;set all local variables to 0
mov dword [ebp-c],eax
mov dword [ebp-8],eax
mov dword [ebp-4],eax    ;I don't know why this is necessary, but if this isn't here my code sometimes wonks out...
setpointer

And then:

Code:
;Render           ;nothing jumps to it actually so this will just be a comment
mov npc.DisplayL, eax ; mov display L 0
mov npc.DisplayU, eax ; mov display U 0
add eax, 10
mov npc.DisplayR, eax ; mov display R 10
mov npc.DisplayD, eax ; mov display D 10

mov esp,ebp
pop ebp
retn

You don't need to use local variables to store framerects just put the values you want into the display.

Also did you get Noxid's defines.txt and have replace the old one in the folder?

How come in your codes, you don't define what the pointer and displays are?
I don't understand the question; I have to do this in every piece of code if I want the game to not crash and/or band it appear on the screen.

Am I being a complete moron? Is defining them the completely wrong thing to do?
I'd really appreciate your help on this because I really want to do a lot of npc hacking for my upcoming mod.
(Also, I would of put this all in a spoilers, but I have no idea how to do that, pretty sure I saw some instructions on how to somewhere on the forums, but now I can't find it.)

I would suggest learning BBcode before you take on ASM, it's a lot more simple to understand...
 
Last edited:
Jan 16, 2016 at 4:40 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
you definitely dont need the local variables if you arent using them.
 
Jan 16, 2016 at 7:19 PM
Senior Member
"Huzzah!"
Join Date: Dec 2, 2015
Location:
Posts: 211
Age: 25
Pronouns: he/him
So... I changed the code to this:

offset 43F280 ;NPC093

#define

setpointer = mov ecx, [ebp+8]

npc.DisplayL = [ecx+54]

npc.DisplayU = [ecx+58]

npc.DisplayR = [ecx+5C]

npc.DisplayD = [ecx+60]

#enddefine

push ebp
mov ebp,esp
sub esp,10
xor eax, eax

mov dword [ebp-10],eax
mov dword [ebp-c],eax
mov dword [ebp-8],eax
mov dword [ebp-4],eax
setpointer

;Render
mov npc.DisplayL, eax

mov npc.DisplayU, eax

add eax, 10

mov npc.DisplayR, eax

mov npc.DisplayD, eax

mov esp,ebp
pop ebp
retn


The good news is that my game no longer crashes so at least there's that.
But the bad news is that the npc still looks exactly the same.

upload_2016-1-16_13-8-51.png

So what's Noxid's defines text your talking about? Where do I get it? Will it help me?

Also, I already tried doing that NPC thing in the offset, but it just gave me this:
upload_2016-1-16_13-13-54.png

(I just put in offset 43F280, which I assume is the same thing.)
Sorry to bother you again, but I really need to know what i'm doing wrong here. Everything looks like it should be working just fine...
 
Jan 16, 2016 at 8:27 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
You don't have noxid's define.txt

you need that to get any of the preset defines to work. go look in noxid's open source mods and download them there.
 
Jan 16, 2016 at 9:10 PM
Senior Member
"Huzzah!"
Join Date: Dec 2, 2015
Location:
Posts: 211
Age: 25
Pronouns: he/him
Alright, I replaced the defines, and everything's working now. At first it was misleading because the sprite still looked the same in BL. But when I ran the game it worked just fine. Thanks for all your help Bombchu Link. I really should of pm'd you instead of asking you on a public thread (sorry). Uh, how does one pm on here?


Also, quick question while i'm here:
When scripting I put in commands one line at a time.

Like this:
#0100
<PRI
<MSGHello, how are you today?
<NOD
<CLR
<END

This is mostly to keep things organized, but if this is really inefficient and takes up more space, please tell me.
 
Last edited:
Jan 16, 2016 at 10:46 PM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
Mar 10, 2016 at 2:43 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
Hey BLink, how do entities like fish missiles, labyrinth critters, and homing flames target the player? I'm trying to make an entity that charges at the player as soon at it is spawned, about the speed of a labyrinth critter projectile, and dies when it hits a wall. I'm having trouble getting started, and I don't really know how to code the homing mechanism
 
Mar 10, 2016 at 2:57 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
Hey BLink, how do entities like fish missiles, labyrinth critters, and homing flames target the player? I'm trying to make an entity that charges at the player as soon at it is spawned, about the speed of a labyrinth critter projectile, and dies when it hits a wall. I'm having trouble getting started, and I don't really know how to code the homing mechanism

well, if I remember correctly just use the same system projectiles do like purple critters and have it update the trajectory every frame.

This works, but it make you face certian doom and you can't avoid it or delay it from hitting you by dodging.

The closest way I can think off the top of my head would be to just have the direction it's moving be it's "head" and it can only move so far left or right while homing and can't double back. (A lot easier said than done....)


Just look at the original code and copy/paste ahoy, I've never toyed around with that stuff like vectoring and on the fly variables/multiplication/division. It makes my head spin.
 
Mar 10, 2016 at 5:38 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
well, if I remember correctly just use the same system projectiles do like purple critters and have it update the trajectory every frame.

This works, but it make you face certian doom and you can't avoid it or delay it from hitting you by dodging.

The closest way I can think off the top of my head would be to just have the direction it's moving be it's "head" and it can only move so far left or right while homing and can't double back. (A lot easier said than done....)


Just look at the original code and copy/paste ahoy, I've never toyed around with that stuff like vectoring and on the fly variables/multiplication/division. It makes my head spin.
I know that feeling. I've been trying to copy that in and edit it, but it always keeps crashing my game by messing up the variables. Then I have to go back and check whether I'd set all the values where they were supposed to be... aaargh!
Just so you know, the labyrinth critters use the cosine function at 0x04258C0 to target the player; I still don't get exactly how it functions
 
Mar 10, 2016 at 6:18 AM
The TideWalker
Modding Community Discord Founder
"That dog!"
Join Date: Apr 5, 2013
Location: In my mind and of my body.
Posts: 1640
Age: 27
Pronouns: he/him
I might have understood at one point what cos and sin were but that was only for a very brief time almost two years ago now.

As for your variables and the like; when copying code, you have to change the pointers so they all use same one and remove all the useless pointer sets. control+F and control+H are your friend.
 
Mar 10, 2016 at 6:21 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
Mar 10, 2016 at 9:05 PM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
Mar 11, 2016 at 7:01 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
Mar 11, 2016 at 2:59 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
read defines.txt to see the commands of the aliases
 
Mar 12, 2016 at 11:12 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
Mar 13, 2016 at 12:26 AM
Been here way too long...
"What're YOU lookin' at?"
Join Date: Oct 17, 2011
Location: probably somewhere else
Posts: 1104
Age: 27
Pronouns: none
Mar 13, 2016 at 1:16 AM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 24
Pronouns: he/him
mov dword [e_x],0
WTF do you mean by e_x? Setting npc.inuse to 0 in Doukutsu Assembler converts to MOV DWORD PTR DS:[ECX],0 in ollydbg. Is that for all entities or it just happens to be that?
 
Back
Top