Bombchu Link's Open source Mods!

Jan 29, 2014 at 3:07 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
I AM HERE TO HELP ALL THE PEOPLE!

Click to download literally everything I've ever made before 7/21/16

---TSC commands---

<IBF ;Infinite booster fuel at your fingertips (toggleable)

<RNJ ;Randomly Jump to any TSC command.

<WND ;Identical to BBP?

<INV ;inverts controls, run twice to go back to normal
Code:
#define

NEXT_TSC_command = 00424F33

KeyForLeft = [493630]

KeyForRight = [493638]


#enddefine

MOV EAX,DWORD PTR DS:[4A5AD8]
ADD EAX,DWORD PTR DS:[4A5AE0]
CMP BYTE [ECX+1],49                                   ;Check for the letter I
JNE NEXT_TSC_command
CMP BYTE [ECX+2],4E                                   ;Check for the letter N
JNE NEXT_TSC_command
CMP BYTE [ECX+3],5v                                   ;Check for the letter V
JNE NEXT_TSC_command

mov eax, KeyForLeft
mov ecx, KeyForRight
mov KeyForRight, eax
mov KeyForLeft,  ecx

ADD [4A5AE0],4                                       ;Fix the script position

JMP 004252A7                                         ;Jump Back to Beginning of Parser


And for you n00bs, you will also need this
Code:
offset 00424EAF

JMP 0046D5D0
RNJ and IBF are packaged together, but you can easily split them.



---NPC's---

Boo ;A Boo from SMB3

Buzz Bomber ;From Sonic 1

NPC Renderer ;A nice baseplate to build off if for your NPC's

Save Disk ;An optimized save disk. (who could possibly want more)

Event NPC ;Wait's however many frames you set the script state (minus 1) to and then becomes beside quote.
Code:
push ebp                    
mov ebp, esp
sub esp, 10

mov dword [EBP-10],0  
mov dword [EBP-C],0   
mov dword [EBP-8],0   
mov dword [EBP-4],0
setpointer

cmp npc.scriptstate,0
je :end_of_code

cmp npc.scriptstate, 1
je :attach_to_NPC
dec npc.scriptstate
jmp :end_of_code

:attach_to_NPC
mov eax, PlayerXpos
mov edx, PlayerYpos
mov npc.X eax
mov npc.Y edx


:end_of_code
mov esp, ebp
pop ebp
retn
Download for everything posted above /\ :Click





---DoR2 Hacks--- Click
Altar: I think it changes sprites when you set the proper scriptstate
Curly + From the headless Curly battle
Curly Bullet I rebuilt the bullet so that It can fire down as well as the other directions
Curly Head The Head from the Curly boss battle
Duck Cannon Shoots a projectile every X frames, direction it faces can be altered via....direction
Duck proj Flies forward until it hits a wall, then it becomes smoke
exe Sonic gets closer to you, starts at the far left of the screen. set the event number to a number other than "0" to have it change sprites
fire (disappears) A fire that disappears after a while (at random) UNUSED
FLY The Gravity NPC thing, set scriptstate to 1 to begin to fly up, set it to 2 to fly up, and to 3 to fly down. (immediately set to 2 or three to teleport to the NPC's position and then fly in that direction)
null NPC Because My exe was acting up
Quote Copy Those weird things that walk left and right...
Quote float down For the Toroko ending set state 1 to float down, set state to 2 to die (makes a lot of smoke)
red fireplace A fireplace that flickers faster then normal
red lightning the Lightning NPC that has two sets of sprites. (check caret.bmp)
save disk blue a save disk, setting direction to 2 reads for a different part of the spritesheet
torch a torch that just stands there, increase scriptstate to increase frame number

and in the boss folder:

Blue Quote Runs toward you, they jump at you more often than not
Curlies I dunno, they were suppose to fly out of the walls but I didn't actually use them... UNUSED
Giant Duck A giant NPC that flies to the left
green proj first ??? UNUSED
Itoh Used in the spider demo (check npcfinal2_OLD)
mastermind The Boss
Quote Curlies The things that jump around
Spear those weird thunderbolts that flash.


All I ask is that you give credit where credit is due, or I will find you and destroy you.



Thank you ;)



E: fixed the downed links.
 
Last edited:
Jan 30, 2014 at 1:06 AM
Sincerity will always triumph over irony.
Modding Community Discord Admin
"What're YOU lookin' at?"
Join Date: Apr 23, 2013
Location: In a cave above the surface.
Posts: 1079
Age: 26
Pronouns: He/Him
I see you finally released your hacks to the public,

That just means I have to debut my upcoming mods, which I had requested the IBF and RNJ commands for, before all the younger fellas ruin the whole experience for everyone.



I guess it's time to get down to business then.
 
Jan 30, 2014 at 5:36 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Aug 30, 2013
Location: ᕕ( ᐛ )ᕗ
Posts: 167
Age: 24
I'm trying to use the IBF command and I assembled it correctly, it's not showing up in the commands list and is red when typed.
I made sure the .exe and .txt files were in the assemblers folder and used the multi file assembler, but nothing happened.
Could you help me with the problem, Bombchu?
 
Jan 30, 2014 at 5:45 AM
Junior Member
"Fresh from the Bakery"
Join Date: Jan 19, 2014
Location:
Posts: 16
CE and BL don't magically know what TSC commands there are in the executable -- the commands list is based off of a text file that was created beforehand.
i.e. even if you properly installed <IBF, it would appear as red in the ediors.

Try using the <IBF command despite what the editors are telling you, and if you're still having problems then report back :)
 
Jan 30, 2014 at 6:12 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Aug 30, 2013
Location: ᕕ( ᐛ )ᕗ
Posts: 167
Age: 24
Ah, it works! I didn't know about that.
Anyways, thank you!
 
Jan 31, 2014 at 5:00 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
Yeah what he said.

BL doesn't show errors in the script, but it doesn't show the argument numbers.

You *can* edit the text in BL and CE to have it support the instruction, but the <RNJ command wouldn't be supported because of the differing argument numbers.
 
Feb 8, 2014 at 10:22 AM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Oct 7, 2013
Location: India
Posts: 522
Two questions:
What do you mean by an optimized save disk?
And will applying these hacks mess up hacks I have already made to the executable?
 
Feb 8, 2014 at 6:43 PM
Sincerity will always triumph over irony.
Modding Community Discord Admin
"What're YOU lookin' at?"
Join Date: Apr 23, 2013
Location: In a cave above the surface.
Posts: 1079
Age: 26
Pronouns: He/Him
Two questions:
What do you mean by an optimized save disk?
And will applying these hacks mess up hacks I have already made to the executable?
The optimized save disk I believe condenses that entity so that it uses a less amount of space, letting hackers use the newly freed space without compromising anything.

And these hacks could potentially "mess up" your custom hacks, but it depends on if they are writing to the same offsets. I know a little bit about where the <IBF command has it's code, but you're going to have to check to see if they overlap each other yourself and/or ask Bombchu the specifics.
 
Feb 8, 2014 at 7:51 PM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Oct 7, 2013
Location: India
Posts: 522
That shouldn't be a problem.
Thanks for making these!
 
Feb 19, 2014 at 2:46 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

What Enlightened said.


Just check the offsets at the beginning of each file if you're not sure. (and if your that stuck then post some stuff here and I can do some figuring out for you)

And btw, you will need to do some tweaking to RNJ/IBF if you have the <MIM hack applied.





-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-





Cooked this one in a few minutes, not incredibly helpful but still.



<INV



Inverts the controls, left is right and right is left, It's also gamepad/controller proof!

Run it again to make right, right and left, left again! (still works after dying so you will need to throw a flag/jump in the death script)
Code:
#define

NEXT_TSC_command = 00424F33

KeyForLeft = [493630]
 
KeyForRight = [493638] 


#enddefine

MOV EAX,DWORD PTR DS:[4A5AD8]
ADD EAX,DWORD PTR DS:[4A5AE0]
CMP BYTE [ECX+1],49                                   ;Check for the letter I
JNE NEXT_TSC_command
CMP BYTE [ECX+2],4E                                   ;Check for the letter N
JNE NEXT_TSC_command
CMP BYTE [ECX+3],5v                                   ;Check for the letter V
JNE NEXT_TSC_command

mov eax, KeyForLeft
mov ecx, KeyForRight
mov KeyForRight, eax
mov KeyForLeft,  ecx

ADD [4A5AE0],4                                       ;Fix the script position

JMP 004252A7                                         ;Jump Back to Beginning of Parser
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



oh look, an XP fountain!
Code:
#define
Spawn XP = 46f2b0
frames between spawn = 5
#enddefine

PUSH EBP
MOV ebp, esp
setpointer
inc npc.frametimer
cmp npc.frametimer, frames between spawn
jl :end_of_code

mov npc.frametimer, 0
PUSH 1                   ;XP ammount
mov eax, npc.Y
PUSH eax                 ;Y pos
;-----
push 0
push A000
call Random
add esp, 8

setpointer
mov edx npc.X 
add edx, eax
;----

PUSH edx
CALL Spawn XP
add esp, C

:end_of_code
mov esp, ebp
pop ebp
retn
 
Feb 19, 2014 at 4:50 PM
Been here way too long...
Discord Group Admin
Org Discord Moderator
"Life begins and ends with Nu."
Join Date: Oct 18, 2011
Location:
Posts: 2337
Theoretically, that could be changed fairly easily to spawn any other entities, right?
If that's the case...
Could you make it spawn itself???
What would happen?
Would the game just give up?
 
Feb 19, 2014 at 4:56 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
Dunc2403 said:
Theoretically, that could be changed fairly easily to spawn any other entities, right?
If that's the case...
Could you make it spawn itself???
What would happen?
Would the game just give up?

Technically it can't spawn other things. I used the XP spawn function instead of the NPC create function. (It would create the same result, but I wanted to test the function out)

And also, once it spawned 255 it would just quit spawning them.


E: hmm, it could be used as a cap to keep projectiles and such from spawning if I would have rigged it that way.
 
Feb 19, 2014 at 5:36 PM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Bombchu Link said:
And also, once it spawned 255 it would just quit spawning them.
The entity cap is 512 (0x200), not 255.
Depending on how the entity create function is called though, it could cap out at 255 (since you can indicate what index to start from, and normally spawned enemies start spawning at index 0x100).
 
Jun 3, 2014 at 2:43 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

Animated facepics!



(it doesn't work with scrolling text though)



Part 1

Code:
offset  46D5D0

#define

next_TSC_command = 424F33

RAM =  493800

#enddefine


MOV EAX,DWORD PTR DS:[4A5AD8]
ADD EAX,DWORD PTR DS:[4A5AE0]
CMP BYTE PTR DS:[ECX+1],4D            ;M
JNE next_TSC_command 
CMP BYTE PTR DS:[ECX+2],53            ;S
JNE next_TSC_command
CMP BYTE PTR DS:[ECX+3],34            ;4
JNE next_TSC_command



;---First Argument---


MOV EDX,DWORD PTR DS:[4A5AE0]
ADD EDX,4
PUSH EDX                                 
CALL 00421900                            
ADD ESP,4			                  

cmp eax, 0
je :normal_box
mov [RAM],6800
jmp :end

:normal_box
mov [RAM],800


:end
ADD [4A5AE0],8                                        ;Fix the script position <MS4XXXX = 8
JMP 004252A7                                          ;Jump back to the beginning of the TSC parser





Part 2

Code:
offset 00424E91  

#define

RAM = 493800

#enddefine

MOV EAX, [RAM]
MOV DWORD PTR DS:[4A5B10],EAX
ADD DWORD PTR DS:[4A5AE0],8
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP



<MS40002 = animated faceboxes



<MS40000 = non-animated faceboxes



Credit to Noxid for discovery



-=-=-=-=-=-=-=-


Yet ANOTHER simple but powerful request from enlightened.





Event NPC: Waits however many frames the scriptstate is set to (minus one) and then clings to quote.



Code:
push ebp                       
mov ebp, esp  
sub esp, 10

mov dword [EBP-10],0     
mov dword [EBP-C],0      
mov dword [EBP-8],0      
mov dword [EBP-4],0 
setpointer 

cmp npc.scriptstate,0
je :end_of_code

cmp npc.scriptstate, 1
je :attach_to_NPC
dec npc.scriptstate
jmp :end_of_code

:attach_to_NPC
mov eax, PlayerXpos
mov edx, PlayerYpos
mov npc.X eax
mov npc.Y edx


:end_of_code
mov esp, ebp
pop ebp
retn



It's pretty useful if you have "run event on contact" active and give it an event #.



It's almost like having a second TSC event active (sort of-ish except it won't run until the previous event is done.).


-=-=-=-=-=-=-=-=-





MOAR stuff
Code:
offset 416AFE


data 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
Momentum does not reset upon using <MOV



-=-=-=-=-=-=-=-=-=-=-=-


Quadruple post eh?



Anyway,



Code:
offset NPC017

#define

L_framerect_distance = 120
U_framerect_distance = 0

sprite heigth        = 10
sprite width         = 10

npc.timer            = [ecx+18]
#enddefine

push ebp
mov ebp,esp
sub esp,10                        

MOV DWORD [EBP-10],0 
MOV DWORD [EBP-C],0 
MOV DWORD [EBP-8],0
MOV DWORD [EBP-4],0
setpointer

cmp npc.scriptstate, 1
je :NO
cmp npc.scriptstate, 2
je :blink


:NO
cmp npc.timer, 1
je :already_set
push 300
push 20
call RANDOM
add esp, 8
setpointer
mov npc.objecttimer, eax
mov npc.timer, 1
:already_set
dec npc.objecttimer
cmp npc.objecttimer, 0
jg :render




:blink
mov npc.timer, 0
mov npc.scriptstate, 2
cmp npc.framenum, 0
je :to_1
mov npc.framenum, 0
jmp :end_frame_swap_thing
:to_1
mov npc.framenum, 1
:end_frame_swap_thing
push 200
push 30
call RANDOM
add esp, 8
setpointer
inc npc.directive
cmp npc.directive, eax
jg :reset
jne :render
:reset
mov npc.scriptstate, 1


:render
mov eax, npc.framenum                  
imul al, al, sprite width
add eax L_framerect_distance 
cmp npc.direction, 2
jne :okay_render
add eax, -30
:okay_render
mov npc.DisplayL,eax                    
add eax, sprite width                          
mov npc.displayR,eax   
mov eax, U_framerect_distance  
cmp npc.direction, 2
jne :okay_render_2
add eax, E0
:okay_render_2
mov npc.displayU,eax                   
add eax, sprite heigth                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn


Health/ammo refill thingy optimized to use a duplicate for itself with different framerects when the direction is set to "2" (the sprite location is just to the left of the deleet's closed eye sprites)


-=-=-=-=-=-



Telepo-r-t-i-n-....



Code:
;tele in time = sprite height X tele wait

offset NPC042

#define
L_framerect_distance = 0
U_framerect_distance = 20

npc.tele             = [ecx+18]
npc.teletimer        = [ecx+1C]



tele_in_time         = 30
tele_wait            = 3

sprite_width         = 10
sprite_height        = 10
#enddefine


push ebp                          ;This starts the code
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
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


;----------------------------------------
:stateIdle              
mov npc.framenum, eax
mov npc.tele, eax   
cmp npc.directive, 1
mov npc.frametimer, 0
je :end_of_code              ;aka no render (if tele'd out)
jmp :render
;----------------------------------------

:TELE
cmp npc.frametimer, 1
je :cont_tele
push 1
push 1D
call PlaySound
add esp, 8
setpointer
mov npc.frametimer, 1

:cont_tele
inc npc.scripttimer
cmp npc.scripttimer, 2
jg :shake_right
add npc.X -A0
jmp :shake_check_end

:shake_right
cmp npc.scripttimer, 4
jg :shake_reset
add npc.X A0
jmp :shake_check_end

:shake_reset
mov npc.scripttimer, 0

:shake_check_end
inc npc.objecttimer
cmp npc.objecttimer, tele_wait
jl :render

mov npc.objecttimer, 0
inc npc.tele
mov eax, npc.tele
cmp eax, sprite_height
jl :render
mov eax, sprite_height


;----------------------------------------
:render
xor eax, eax                 ;mov eax L_framerect_distance                  
mov eax,npc.framenum                 
imul al, al, sprite_width
mov npc.DisplayL,eax                   
add eax, sprite_width                         
mov npc.displayR,eax  
mov eax, U_framerect_distance 
cmp npc.direction, 2                    
jne :render_left
add eax sprite_height
:render_left
mov npc.displayU, eax  
;----
;tele determine
cmp npc.scriptstate, 1
jg :tele_in
jl :tele_over
:tele_out
mov edx npc.tele
sub eax, edx
mov npc.directive, 1
jmp :tele_timer
:tele_in
mov npc.directive, 0
mov edx npc.tele
add eax, edx
sub eax, sprite_height
:tele_timer
inc npc.teletimer
cmp npc.teletimer, tele_in_time
jl :tele_over
mov npc.teletimer,0
mov npc.scriptstate, 0
:tele_over
;----
add eax,sprite_height
mov npc.displayD, eax


:end_of_code
mov esp, ebp
pop ebp
retn


:StateTable
print :StateIdle            ;<ANP0000
print :TELE                 ;<ANP0001
print :TELE                 ;<ANP0002



<ANP 0 does nothing, and I mean it, if it's tele'd out it will stay that way, if it's tele'd in it will stay that way, it's NOT a reset button.



And if you guys are actually using this stuff/having issues with it, please comment.





I released my hacks on DoR2 help yourself to whatever. (check the OP)
 
Jul 29, 2014 at 10:10 PM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Oct 7, 2013
Location: India
Posts: 522

You do take new TSC command hack requests, right? Could you (please) make a straight-up duplicate of <CMP which just works without smoke? There must be some line of code in there telling the game to make entity #XX (I forgot what it was for smoke), so you could just change that into entity #00. I'd do it myself, but there are other things I'd mess up with, like making it parse smoothly or something.

Am I being clear enough?
 
Jul 30, 2014 at 12:09 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
You do take new TSC command hack requests, right? Could you (please) make a straight-up duplicate of <CMP which just works without smoke? There must be some line of code in there telling the game to make entity #XX (I forgot what it was for smoke), so you could just change that into entity #00. I'd do it myself, but there are other things I'd mess up with, like making it parse smoothly or something.

Am I being clear enough?


I /almost/ made exactly that for DoR2 before changing my mind yet again. (that game went through a lot of overhaul)





Ehh, I'll see what I can do.





E: and also, there isn't really a "smoothly" in there, it works or it don't. (that's the beauty of ASM, if you messed something up it lets you know fast.)





EE: Well that was fast.



oops


Code:
offset NPC016

#define
Next_TSC_Command = 4937F4


L_framerect_distance = 60
U_framerect_distance = 10
sprite heigth = 10
sprite width =  10
max frames  = 8
#enddefine
push ebp
mov ebp,esp
sub esp,10
mov dword [EBP-10],0
mov dword [EBP-C],0
mov dword [EBP-8],0
mov dword [EBP-4],0
setpointer
inc npc.frametimer
cmp npc.frametimer, 3
jl :render
inc npc.framenum
cmp npc.framenum, max frames
jge :reset_frames
mov npc.frametimer, 0
jmp :render
:reset_frames
mov npc.framenum, 0
:render
mov eax, npc.framenum           //move frame num to eax            
imul al, al, sprite width       //multiply eax by sprite width
add eax L_framerect_distance    //add eax the L_frame distance
mov npc.DisplayL,eax            //store in framerect  Left border  
add eax, sprite width           //add with of sprite to border        
mov npc.displayR,eax            //and set as right border
mov eax, U_framerect_distance  
mov npc.displayU,eax              
add eax, sprite heigth                          
mov npc.displayD,eax   
add npc.Y -5FF
mov esp,ebp
pop ebp
retn


;;offset 429e72

MOV EAX,DWORD PTR DS:[4A5AD8]
ADD EAX,DWORD PTR DS:[4A5AE0]
CMP BYTE [ECX+1],43                                   ;Check for the letter C
JNE Next_TSC_Command
CMP BYTE [ECX+2],4D                                   ;Check for the letter M
JNE Next_TSC_Command
CMP BYTE [ECX+3],32                                   ;Check for the letter 2
JNE Next_TSC_Command

mov eax, [4a5ae0]
add eax, 4
push eax
call 421900
add esp, 4
mov [ebp-c], eax

mov eax, [4a5ae0]
add eax, 9
push eax
call 421900
add esp, 4
mov [ebp-8], eax

mov eax, [4a5ae0]
add eax, 0e
push eax
call 421900
add esp, 4

push eax
push [ebp-8]
push [ebp-c]
call :Function_loc
add esp, 0c
add [4a5ae0], 12
JMP 004252A7 

:Function_loc
data 55 8B EC 51 A1 80 E4 49 00 03 45 08 0F BF 0D 86
data E5 49 00 0F AF 4D 0C 0F B6 14 08 0F B6 45 10 3B
data D0 75 04 33 C0 EB 61 8B 0D 80 E4 49 00 03 4D 08
data 0F BF 15 86 E5 49 00 0F AF 55 0C 8A 45 10 88 04
data 11 C7 45 FC 00 00 00 00 EB 09 8B 4D FC 83 C1 01
data 89 4D FC 83 7D FC 03 7D 2A 6A 00 6A 00 6A 00 6A
data 00 6A 00 8B 55 0C C1 E2 09 C1 E2 04 52 8B 45 08
data C1 E0 09 C1 E0 04 50 6A 00 E8 F2 B4 05 00 83 C4
data 20 EB C7 B8 01 00 00 00 8B E5 5D C3
Code:
offset 424EAF  

JMP 429e72


Basically all you need to know is use <CM2 instead of <CMP if you don't want smoke and don't do any hacks over the save disk.



And I tested everything except the smoke part, but it should work.



EEE: I don't know why, but this function won't work, standby.


 
Jul 30, 2014 at 7:20 AM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Oct 7, 2013
Location: India
Posts: 522
Sorry, but I'm sort of dumb with this stuff and I'm having some problem with implementing it. I tried using an assembler for the part at 424eaf and copied the hex data you provided at 429e72, but the game just crashed. What am I doing wrong?
 
Jul 30, 2014 at 3:38 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
BLink said:
EEE: I don't know why, but this function won't work, standby.
/\ that means it don't work and will crash.


I'm totally flabbergasted as of why though, I can't change the NPC to be spawned (default smoke) without crashing the game.
 
Jul 30, 2014 at 3:48 PM
Been here way too long...
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Oct 7, 2013
Location: India
Posts: 522
Well, whatever. You tried, and it's the thought that counts. Most of the time. Right?
 
Jul 30, 2014 at 5:46 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2326
Age: 28
Pronouns: he/him
Since that didn't work, try this:
Code:
offset 424EAF

JMP 0048B963
Code:
offset 48B92B

PUSH EBP
MOV EBP,ESP
MOV EAX,DWORD PTR DS:[49E480]
NOP
ADD EAX,DWORD PTR SS:[EBP+0C]
MOVSX ECX,WORD PTR DS:[49E586]
IMUL ECX,DWORD PTR SS:[EBP+8]
MOVZX EDX,BYTE PTR DS:[ECX+EAX]
MOV EDX,DWORD PTR SS:[EBP+10]
MOVSX EAX,WORD PTR DS:[49E586]
IMUL EAX,DWORD PTR SS:[EBP+0C]
MOV ECX,DWORD PTR DS:[49E480]
ADD ECX,DWORD PTR SS:[EBP+8]
MOV BYTE PTR DS:[EAX+ECX],DL
POP EBP
RETN
NOP
MOV EDX,DWORD PTR DS:[4A5AD8]
ADD EDX,DWORD PTR DS:[4A5AE0]
MOVSX EAX,BYTE PTR DS:[EDX+1]
CMP EAX,43
JNE 0048BA0B
MOV ECX,DWORD PTR DS:[4A5AD8]
ADD ECX,DWORD PTR DS:[4A5AE0]
MOVSX EDX,BYTE PTR DS:[ECX+2]
CMP EDX,4D
JNE SHORT 0048BA0B
MOV EAX,DWORD PTR DS:[4A5AD8]
ADD EAX,DWORD PTR DS:[4A5AE0]
MOVSX ECX,BYTE PTR DS:[EAX+3]
CMP ECX,4E
JNE SHORT 0048BA0B
MOV EDX,DWORD PTR DS:[4A5AE0]
ADD EDX,4
PUSH EDX
CALL 00421900
ADD ESP,4
MOV DWORD PTR SS:[EBP-0C],EAX
MOV EAX,DWORD PTR DS:[4A5AE0]
ADD EAX,9
PUSH EAX
CALL 00421900
ADD ESP,4
MOV DWORD PTR SS:[EBP-8],EAX
MOV ECX,DWORD PTR DS:[4A5AE0]
ADD ECX,0E
PUSH ECX
CALL 00421900
ADD ESP,4
MOV DWORD PTR SS:[EBP-24],EAX
MOV DL,BYTE PTR SS:[EBP-24]
PUSH EDX
MOV EAX,DWORD PTR SS:[EBP-8]
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-0C]
PUSH ECX
CALL 0048B92B
ADD ESP,0C
MOV EDX,DWORD PTR DS:[4A5AE0]
ADD EDX,12
MOV DWORD PTR DS:[4A5AE0],EDX
JMP 004252A7
JMP 00424F33

This enables you to use the <CMN command that I made. It functions identically to <CMP, except that it doesn't generate smoke. It does not replace any existing code, so <CMP can still be used in the EXE that this hack is applied to.

Enter the code segments above one at a time in the Doukutsu assembler, or use the multi-file assemble that I'm not in the mood for messing with right now. Please note that this may mess with other stuff if you're using Noxid's optimized TSC parser, or if you're currently using any other custom TSC hacks. This was originally designed for my personal use and not really meant to accommodate other people's hacks, so use at your own risk.

What I did was make it skip over the duplicate <FAC command and then go to the bottom of the EXE so that it has room for the code for this command, as well as any other command you wish to add. Then it either goes back to the beginning of the TSC parser, or jumps back to where it previously was in the TSC parser and continues past the duplicate <FAC command, depending on whether or not the command being scanned was <CMN.


@BLink
Why spawn NPC 00 if the intent is to make it spawn nothing? I wonder if that's why your code didn't work.
 
Back
Top