Get your Custom NPCs right here folks!

Jan 15, 2014 at 10:48 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: 26
MagicDoors said:
I have a request. You know Weaville in Brawl, how he dashes from side to side to attack? I'd like to have something like that, maybe it would activate once the player is detected in front of them?

ok.

but it might be a little while.

I don't know who Weaville is (I probably do but don't know the name attached to it.) so a video might be helpful.

@TL

Good to hear it.
 
Jan 16, 2014 at 1:02 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: 26
Good timing for this. So, I'm wrapping up the work for the demo on the Mega Man mod I've been working on, and I've been thinking about boss NPCs. I was originally going to go without custom bosses, but if you're willing to do some edits, that'd be great. I'm not looking for anything spectacular, I really only want minor variations of previously-made bosses to make the battle more interesting. For the demo, I only have two bosses, Toroko+ and the Red Demon. Would you be willing to spice up their patterns for me?


I did the red Demon.



It's still a little buggy and doesn't work on slopes or ground that isn't flat. (still learning about npc.collision)



Also it will still turn to face you when it dies 0.o



And I *think* it can't hurt you by touching you.



Code:
;ANP 0001 = start attacking player
;ANP 0007 = dead

offset NPC276

#define

npc.jump=[ecx+1C]
npc.directionhandler = [ecx+18]

localvar1 = [EBP-14]
localvar2 = [EBP-18]
localvar3 = [EBP-1C]

TPcool = edit these to your likings

jumpheight = 500
jumplength = 300

L_framerect_distance = 0
U_framerect_distance = 40
#enddefine

push ebp                          ;This starts the code
mov ebp, esp  
sub esp,14

mov dword [EBP-10],0     
mov dword [EBP-C],0      
mov dword [EBP-8],0      
mov dword [EBP-4],0 
setpointer
cmp npc.health, 0
je :statedead


;direction check
mov eax, PlayerXpos
cmp npc.X, eax
jl :face_right
mov npc.direction, 0
jmp :end_direction
:face_right
mov npc.direction, 2
:end_direction
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


;-----FIRE (ground)-----

:statefire
add npc.y 5FF   
mov npc.framenum, 0
inc npc.objecttimer
cmp npc.objecttimer, 15
jge :fireproj
mov npc.framenum, 3
jmp :render
:fireproj
mov npc.framenum, 4
cmp npc.objecttimer, 21
je :create_object
:Fired_proj_ground
cmp npc.objecttimer, 30
jl :render
mov npc.objecttimer, 0
inc npc.scripttimer
push 0
push 7
call RANDOM
add esp, C
setpointer
cmp npc.scripttimer, eax
jge :jump_prep
jmp :render





:create_object
setpointer
push 0
mov edx, npc.y
sub edx, playerypos
push edx
mov edx, npc.x
sub edx,playerxpos
push edx
call 004258e0                      ;detects player collision
add esp,8
mov localvar3,eax
mov edx,localvar3
push edx                             
call 004258b0                      ;sin table
add esp,4
shl eax,2
mov localvar2,eax
mov eax, localvar3
push eax                             
call 004258c0                      ;cos table
add esp,4
shl eax,2
mov localvar1,eax
push 100                                
push 0                                
push 0                                 
mov ecx, localvar2          
push ecx                             
mov edx, localvar1          
push edx                              
setpointer
mov eax, npc.y           
push eax                                
mov edx, npc.x            
push edx
push 115
call 0046efd0                            
add esp,20
cmp npc.scriptstate, 1
je :Fired_proj_ground
jmp :jump_vel_handler_Y






:jump_prep
mov npc.scriptstate, 3
mov npc.objecttimer, 0
jmp :render

;-----JUMP-----

:statejump1                  ;squat before jump
inc npc.objecttimer
cmp npc.objecttimer, 10 
jg :statejump2
mov npc.framenum, 2
jmp :render

:Statejump2                  ;prep for jump (one frame)
mov npc.framenum 7
mov npc.scriptstate, 5
mov npc.objecttimer, 0
cmp npc.direction, 2
je :right_jump_prep
mov npc.jump, 0
jmp :left_jump_prep
:right_jump_prep
mov npc.jump, 2
:left_jump_prep
jmp :render

;objecttimer = open/close arms timer
;scripttimer = jumping timer

:Statejump3
cmp npc.jump, 2
je :right_jump
add npc.X -jumplength
jmp :left_jump
:right_jump
add npc.X jumplength
:left_jump
inc npc.objecttimer
cmp npc.objecttimer, 10       ;before arms closed
jge :Statejump4
jmp :jump_vel_handler_Y

:Statejump4
mov npc.framenum, 5           ;closed arms
cmp npc.objecttimer, 15
jg :jumpfire
jmp :jump_vel_handler_Y

:jumpfire
mov npc.framenum, 6
cmp npc.objecttimer, 20
je :create_object
cmp npc.objecttimer, 28
jl :jump_vel_handler_Y
mov npc.scriptstate, 5
mov npc.objecttimer, 0
jmp :jump_vel_handler_Y


:jump_vel_handler_Y
cmp npc.scriptstate, 2
je :render
add npc.scripttimer, 15
cmp npc.scripttimer, A00
jg :vel_to_high
mov eax, npc.scripttimer
add eax, -jumpheight
add npc.Y, eax
jmp :render


:vel_to_high
add npc.Y, 600
cmp npc.scripttimer, A00
jl :render
mov npc.scriptstate, 2        ;go to state lightning
mov npc.scripttimer, 0
mov npc.objecttimer, 0
jmp :render


:StateLightning
add npc.Y 5ff                 ;gravity
mov npc.framenum, 3
inc npc.objecttimer
cmp npc.objecttimer 40
je :lightning
jl :render
mov npc.framenum, 4
cmp npc.objecttimer, 60
jl :render
mov npc.scriptstate, 3
jmp :render

:lightning

push 140
push 0
push 0 
push 0
push 0
setpointer
mov eax PlayerYPos
push eax
mov eax PlayerXPos
push eax
push 14D
call 46efd0
add esp,20
jmp :render


:stateDead

add npc.Y 5ff                 ;gravity
mov npc.framenum, 8
jmp :render

;---------------------


:stateIdle
add npc.y 5FF                 ;gravity
mov npc.objecttimer, 0
mov npc.framenum, 0
inc npc.frametimer
cmp npc.frametimer, 30        ;breathe check
jl :render
mov npc.framenum, 1
cmp npc.frametimer, 60
jl :render
mov npc.frametimer,0

:render
cmp npc.direction, 2         ;trasfer directon to our variable
je :direction_transfer
mov npc.directionhandler, 0
:direction_transfer
jmp :end_direction_transfer
mov npc.directionhandler, 1
:end_direction_transfer
xor eax, eax         ;mov eax L_framerect_distance                   
mov eax,npc.framenum                  
imul al, al, 20
mov npc.DisplayL,eax                    
add eax,20                          
mov npc.displayR,eax   
mov eax, U_framerect_distance      
cmp npc.direction, 2                     
jne :render_left
add eax 28
:render_left
mov npc.displayU,eax                   
add eax,28                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn


:StateTable
print :StateIdle         ;<ANP0000
print :StateFire
print :StateLightning
print :Statejump1
print :Statejump2
print :Statejump3        ;<ANP0005
print :Statejump4
print :statedead



I'll fix the errors later.



(this is more of a what do you think so far/is it aggressive enough thing)
 
Jan 21, 2014 at 7:30 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Feb 2, 2012
Location: Grassland
Posts: 123
Age: 28
Bombchu Link said:
As for the balrog, well, It would be a while, after I finished TP's requests I want to get back to work on my mod and finish the first part of my ASM hacking guide. Boss battles are one of the hardest things to build because I have to start from scratch.

I *could* just make the attack function though.
So...what exactly do you mean by making just the attack function? Do you mean just coding the attack pattern, then I just kind of put it in myself?

Oh, and thanks for the references, they are very helpful.
 
Feb 13, 2014 at 9:16 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: 26
I mean the attack function as in something that would work when implemented into a boss code but wouldn't work on it's own.

And to actually insert it would be really hard.


I would suggest that if you want some nice code to look over, look and Nox's and/or wait for me to release my NPC hacking guide.

Between the two, It should tell you everything you should need to know about NPC's.
Coffee said:
Okay well first of all

Also
I don't think I need to point out which is weavile
OK, how many tiles/pixels close should misery the player be before it dashes?

And will it continue to pursue you after the first dash?
Or will it just dash left and right continually?
Or will it only dash once?
 
Feb 13, 2014 at 9:35 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
I'd say around 5 or so tiles would be good. Maybe.
It would probably be better and easier to make if it only dashed once.
 
Feb 17, 2014 at 6:36 AM
leader of the meme team feat. tom, snaf and polad
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Jan 24, 2014
Location: Polar✪
Posts: 300
Well since you told me to post it here, a simple request. Life Capsules effected by gravity?
 
Feb 20, 2014 at 3:16 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: 26
Well since you told me to post it here, a simple request. Life Capsules effected by gravity?


Here you go!



Code:
;to turn on gravity, set directon to "2"


offset NPC032

#define

L_framerect_distance = 20
U_framerect_distance = 60


#enddefine

push ebp
mov ebp,esp

SUB ESP,10                         

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

inc npc.frametimer
cmp npc.frametimer, 3
jl :gravity


mov npc.frametimer, 0
cmp npc.framenum, 1
jge :dec_framenum
inc npc.framenum
jmp :gravity

:dec_framenum
dec npc.framenum
jmp :gravity




:gravity
cmp npc.direction, 2
jne :render

add npc.y 5FF


 

:render                 
mov eax,npc.framenum                  
imul al, al, 10
add eax L_framerect_distance   
mov npc.DisplayL,eax                    
add eax,10                          
mov npc.displayR,eax   

mov eax, U_framerect_distance      
mov npc.displayU,eax                   
add eax,10                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn

Just run this through the assembler.



To turn on gravity, set direction to '2'

in that case, could you just have them target one entity in paticular?

if not, I'll go for them just being stationary.


Here:

Code:
0x4469EC

90 90 90 7D 0F 8B 55 08 8B 42 10 83 E8 10 8B 4D
08 89 41 10 8B 55 08 8B 45 08 8B 4A 20 3B 48 08
7E 0F 8B 55 08 8B 42 10 83 C0 10 8B 4D 08 89 41
10 8B 55 08 8B 45 08 8B 4A 24 90 90 90 7D 0F 8B
55 08 8B 42 14 83 E8 10 8B 4D 08 89 41 14 8B 55
08 8B 45 08 8B 4A 24 90 90 90 7E 0F 8B 55 08 90
90 90 83 C0 10 8B 4D 08 90 90 90 8B 55 08 90 90
90 90 90 90 90 7E 0A 8B 45 08 90 90 90 90 90 90
90 8B 4D 08 90 90 90 90 90 90 90 7D 0A 8B 55 08
90 90 90 90 90 90 90 8B 45 08 90 90 90 90 90 90
90 7E 0A 8B 4D 08 90 90 90 90 90 90 90 8B 55 08
90 90 90 90 90 90 90 7D 0A 8B 45 08 C7 40 14 00
FE FF FF 8B 4D 08 90 90 90 8B 45 08 90 90 90 8B
4D 08 90 90 90 8B 55 08 90 90 90 8B 4D 08 03 41
14 8B 55 08 90 90 90

That should do it.



and just run it through Boosters lab/some other hex patcher NOT the assembler.





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

Good timing for this. So, I'm wrapping up the work for the demo on the Mega Man mod I've been working on, and I've been thinking about boss NPCs. I was originally going to go without custom bosses, but if you're willing to do some edits, that'd be great. I'm not looking for anything spectacular, I really only want minor variations of previously-made bosses to make the battle more interesting. For the demo, I only have two bosses, Toroko+ and the Red Demon. Would you be willing to spice up their patterns for me?




OK, the Red Demon is ready.



Code:
;ANP 0001 = start attacking player
;ANP 0007 = dead

offset NPC276

#define

npc.jump=[ecx+1C]
npc.directionhandler = [ecx+18]

localvar1 = [EBP-14]
localvar2 = [EBP-18]
localvar3 = [EBP-1C]

TPcool = edit these to your likings

jumpheight = 500
jumplength = 300

L_framerect_distance = 0
U_framerect_distance = 40
#enddefine

push ebp                          ;This starts the code
mov ebp, esp  
sub esp,14

mov dword [EBP-10],0     
mov dword [EBP-C],0      
mov dword [EBP-8],0      
mov dword [EBP-4],0 
setpointer
cmp npc.health, 0
je :statedead


;direction check
mov eax, PlayerXpos
cmp npc.X, eax
jl :face_right
mov npc.direction, 0
jmp :end_direction
:face_right
mov npc.direction, 2
:end_direction
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


;-----FIRE (ground)-----

:statefire
add npc.y 5FF   
mov npc.framenum, 0
inc npc.objecttimer
cmp npc.objecttimer, 15
jge :fireproj
mov npc.framenum, 3
jmp :render
:fireproj
mov npc.framenum, 4
cmp npc.objecttimer, 21
je :create_object
:Fired_proj_ground
cmp npc.objecttimer, 30
jl :render
mov npc.objecttimer, 0
inc npc.scripttimer
push 0
push 7
call RANDOM
add esp, C
setpointer
cmp npc.scripttimer, eax
jge :jump_prep
jmp :render

:create_object
setpointer
push 0
mov edx, npc.y
sub edx, playerypos
push edx
mov edx, npc.x
sub edx,playerxpos
push edx
call 004258e0                      ;detects player collision
add esp,8
mov localvar3,eax
mov edx,localvar3
push edx                             
call 004258b0                      ;sin table
add esp,4
shl eax,2
mov localvar2,eax
mov eax, localvar3
push eax                             
call 004258c0                      ;cos table
add esp,4
shl eax,2
mov localvar1,eax
push 100                                
push 0                                
push 0                                 
mov ecx, localvar2          
push ecx                             
mov edx, localvar1          
push edx                              
setpointer
mov eax, npc.y           
push eax                                
mov edx, npc.x            
push edx
push 115
call 0046efd0                            
add esp,20
cmp npc.scriptstate, 1
je :Fired_proj_ground
jmp :jump_vel_handler_Y






:jump_prep
mov npc.scriptstate, 3
mov npc.objecttimer, 0
jmp :render

;-----JUMP-----

:statejump1                  ;squat before jump
inc npc.objecttimer
cmp npc.objecttimer, 10 
jg :statejump2
mov npc.framenum, 2
jmp :render

:Statejump2                  ;prep for jump (one frame)
mov npc.framenum 7
mov npc.scriptstate, 5
mov npc.objecttimer, 0
cmp npc.direction, 2
je :right_jump_prep
mov npc.jump, 0
jmp :left_jump_prep
:right_jump_prep
mov npc.jump, 2
:left_jump_prep
jmp :render

;objecttimer = open/close arms timer
;scripttimer = jumping timer

:Statejump3
cmp npc.jump, 2
je :right_jump
add npc.X -jumplength
jmp :left_jump
:right_jump
add npc.X jumplength
:left_jump
inc npc.objecttimer
cmp npc.objecttimer, 10       ;before arms closed
jge :Statejump4
jmp :jump_vel_handler_Y

:Statejump4
mov npc.framenum, 5           ;closed arms
cmp npc.objecttimer, 15      
jg :jumpfire
jmp :jump_vel_handler_Y

:jumpfire
mov npc.framenum, 6
cmp npc.objecttimer, 20       ;time between firing
je :create_object
cmp npc.objecttimer, 28
jl :jump_vel_handler_Y
mov npc.scriptstate, 5
mov npc.objecttimer, 0
jmp :jump_vel_handler_Y


:jump_vel_handler_Y
cmp npc.scriptstate, 2
je :render
add npc.scripttimer, 15       ;script timer holds velocitys?
cmp npc.scripttimer, A00
jg :vel_to_high
mov eax, npc.scripttimer
add eax, -jumpheight
add npc.Y, eax
jmp :render


:vel_to_high
cmp npc.collision, 0          ;colliding with something? (need to test values)
jge :done_jump
cmp npc.collision, 20
jg :done_jump
mov eax, A00
add eax, -jumpheight
add npc.Y, eax
jmp :render

:done_jump
mov npc.scriptstate, 2        ;go to state lightning
mov npc.scripttimer, 0
mov npc.objecttimer, 0
jmp :render


:StateLightning
add npc.Y 5ff                 ;gravity
mov npc.framenum, 3
inc npc.objecttimer
cmp npc.objecttimer 30
je :lightning
jl :render
mov npc.framenum, 4
cmp npc.objecttimer, 60
jl :render
mov npc.scriptstate, 3
jmp :render

:lightning
push 140
push 0
push 0 
push 0
push 0
setpointer
mov eax PlayerYPos
push eax
mov eax PlayerXPos
push eax
push 14D
call 46efd0
add esp,20
setpointer
mov npc.scriptstate, 1
jmp :render


:stateDead
;inc npc.scriptstate

;push 0
;push 36
;call PlaySound
;add esp, 8

:statedead2

                ;gravity
mov npc.framenum, 8
mov npc.flags, 200

mov npc.hitrectL, 0
mov npc.hitrectU, 0
mov npc.hitrectR, -8000
mov npc.hitrectD, -8000

jmp :render

;---------------------


:stateIdle
add npc.y 5FF                 ;gravity
mov npc.objecttimer, 0
mov npc.framenum, 0
inc npc.frametimer
cmp npc.frametimer, 30        ;breathe check
jl :render
mov npc.framenum, 1
cmp npc.frametimer, 60
jl :render
mov npc.frametimer,0

:render
cmp npc.direction, 2         ;trasfer directon to our variable
je :direction_transfer
mov npc.directionhandler, 0
:direction_transfer
jmp :end_direction_transfer
mov npc.directionhandler, 1
:end_direction_transfer
xor eax, eax                 ;mov eax L_framerect_distance                   
mov eax,npc.framenum                  
imul al, al, 20
mov npc.DisplayL,eax                    
add eax,20                          
mov npc.displayR,eax   
mov eax, U_framerect_distance      
cmp npc.direction, 2                     
jne :render_left
add eax 28
:render_left
mov npc.displayU,eax                   
add eax,28                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn


:StateTable
print :StateIdle         ;<ANP0000
print :StateFire
print :StateLightning
print :Statejump1
print :Statejump2
print :Statejump3        ;<ANP0005
print :Statejump4
print :statedead
print :statedead2

The only issue is the when it's killed, it doesn't fall to the ground.



If you want me to fix that then I *can* but it would take a while longer.





As for Toroko+, I will just speed her up, It's gonna be too much of a headache to re-write two bosses out.





Oh, and you will need to edit your npc.tbl file



Have "shootable" and "show damage" checked off only.



And you will have to have a script run on death and a <ANP0007 to make it die.


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


I have a request. You know Weaville in Brawl, how he dashes from side to side to attack? I'd like to have something like that, maybe it would activate once the player is detected in front of them?




Ok, it' done.



Code:
offset [something]

#define

L_framerect_distance = 0
U_framerect_distance = 0

sprite heigth    = 10
sprite width     = 10

detect_area      = C000
time_before_dash = 20
dash_frames      = 35
dash_sound       = 20
dash_speed       = 400

#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
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


:StateIdle 
mov npc.framenum, 0
mov eax PlayerXpos
add eax detect_area
cmp npc.X, eax
jg :render

mov eax PlayerXpos
add eax -detect_area
cmp npc.X, eax
jl :render


:StatePreDash
mov npc.scriptstate, 1
mov npc.framenum, 1
inc npc.scripttimer
cmp npc.scripttimer, time_before_dash
jg :StateDash1
jmp :render

:StateDash1
push 1
push dash_sound
CALL PlaySound
add esp, 8
setpointer
mov npc.scriptstate, 3

:StateDash2
mov eax npc.X
cmp eax PlayerXpos
jl  :StateDash3_R

:StateDash3_L
mov npc.scriptstate, 4
mov npc.framenum, 2
add npc.X -dash_speed
jmp :StateDash4

:StateDash3_R
mov npc.scriptstate, 5
mov npc.framenum, 2
add npc.X dash_speed

:StateDash4
inc npc.frametimer
cmp npc.frametimer, dash_frames
jg :StateDashEnd
jmp :render

:StateDashEnd
mov npc.frametimer, 0
mov npc.framenum, 3
mov npc.scriptstate, 6
jmp :render


:render
add npc.Y 5FF                   ;gravity, remove this line if you don't want it to be affected.
cmp npc.scriptstate, 4
je :end_direction_transfer
cmp npc.scriptstate, 5
je :end_direction_transfer
mov eax npc.X                   ;direction face check and handeler
cmp eax PlayerXPos
jg :directon_left
mov npc.direction, 2
jmp :end_direction_transfer 
:directon_left
mov npc.direction, 0
:end_direction_transfer            
mov eax, npc.framenum                  
imul al, al, sprite width
add eax L_framerect_distance 
mov npc.DisplayL,eax                    
add eax, sprite width                          
mov npc.displayR,eax   
mov eax, U_framerect_distance  
cmp npc.direction, 0
je :face_left
add eax, sprite heigth
:face_left
mov npc.displayU,eax                   
add eax, sprite heigth                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn
     
:StateTable
print :StateIdle         ;<ANP0000
print :StatePreDash
print :StateDash1
print :StateDash2
print :StateDash3_L
print :StateDash3_R      ;<ANP0005
print :StateDashEnd

It has four sprites, and will turn to face you (unless it's dashing)



Idle, pre-dash, dash and after dash. It can face/dash both directions,



You will need to edit the npc.tbl file to get the full results



It also makes a sound right before it dashes.



To make it able to dash again set <ANP0000









Almost caught up now....



E: spoiler-ed my mega post


Oh wow 5 posts in a row.


Good timing for this. So, I'm wrapping up the work for the demo on the Mega Man mod I've been working on, and I've been thinking about boss NPCs. I was originally going to go without custom bosses, but if you're willing to do some edits, that'd be great. I'm not looking for anything spectacular, I really only want minor variations of previously-made bosses to make the battle more interesting. For the demo, I only have two bosses, Toroko+ and the Red Demon. Would you be willing to spice up their patterns for me?


I did Toroko +



That was really easy.



She is much more aggressive now.



Code:
0x442BF0

55 8B EC 81 EC CC 01 00 00 C7 85 20 FF FF FF 00
00 00 00 C7 85 24 FF FF FF 00 00 00 00 C7 85 28
FF FF FF 20 00 00 00 C7 85 2C FF FF FF 20 00 00
00 C7 85 30 FF FF FF 20 00 00 00 C7 85 34 FF FF
FF 00 00 00 00 C7 85 38 FF FF FF 40 00 00 00 C7
85 3C FF FF FF 20 00 00 00 C7 85 40 FF FF FF 40
00 00 00 C7 85 44 FF FF FF 00 00 00 00 C7 85 48
FF FF FF 60 00 00 00 C7 85 4C FF FF FF 20 00 00
00 C7 85 50 FF FF FF 60 00 00 00 C7 85 54 FF FF
FF 00 00 00 00 C7 85 58 FF FF FF 80 00 00 00 C7
85 5C FF FF FF 20 00 00 00 C7 85 60 FF FF FF 80
00 00 00 C7 85 64 FF FF FF 00 00 00 00 C7 85 68
FF FF FF A0 00 00 00 C7 85 6C FF FF FF 20 00 00
00 C7 85 70 FF FF FF A0 00 00 00 C7 85 74 FF FF
FF 00 00 00 00 C7 85 78 FF FF FF C0 00 00 00 C7
85 7C FF FF FF 20 00 00 00 C7 45 80 C0 00 00 00
C7 45 84 00 00 00 00 C7 45 88 E0 00 00 00 C7 45
8C 20 00 00 00 C7 45 90 E0 00 00 00 C7 45 94 00
00 00 00 C7 45 98 00 01 00 00 C7 45 9C 20 00 00
00 C7 45 A0 00 00 00 00 C7 45 A4 40 00 00 00 C7
45 A8 20 00 00 00 C7 45 AC 60 00 00 00 C7 45 B0
20 00 00 00 C7 45 B4 40 00 00 00 C7 45 B8 40 00
00 00 C7 45 BC 60 00 00 00 C7 45 C0 40 00 00 00
C7 45 C4 40 00 00 00 C7 45 C8 60 00 00 00 C7 45
CC 60 00 00 00 C7 45 D0 60 00 00 00 C7 45 D4 40
00 00 00 C7 45 D8 80 00 00 00 C7 45 DC 60 00 00
00 C7 45 E0 80 00 00 00 C7 45 E4 40 00 00 00 C7
45 E8 A0 00 00 00 C7 45 EC 60 00 00 00 C7 45 F0
00 00 00 00 C7 45 F4 00 00 00 00 C7 45 F8 00 00
00 00 C7 45 FC 00 00 00 00 C7 85 38 FE FF FF 00
00 00 00 C7 85 3C FE FF FF 20 00 00 00 C7 85 40
FE FF FF 20 00 00 00 C7 85 44 FE FF FF 40 00 00
00 C7 85 48 FE FF FF 20 00 00 00 C7 85 4C FE FF
FF 20 00 00 00 C7 85 50 FE FF FF 40 00 00 00 C7
85 54 FE FF FF 40 00 00 00 C7 85 58 FE FF FF 40
00 00 00 C7 85 5C FE FF FF 20 00 00 00 C7 85 60
FE FF FF 60 00 00 00 C7 85 64 FE FF FF 40 00 00
00 C7 85 68 FE FF FF 60 00 00 00 C7 85 6C FE FF
FF 20 00 00 00 C7 85 70 FE FF FF 80 00 00 00 C7
85 74 FE FF FF 40 00 00 00 C7 85 78 FE FF FF 80
00 00 00 C7 85 7C FE FF FF 20 00 00 00 C7 85 80
FE FF FF A0 00 00 00 C7 85 84 FE FF FF 40 00 00
00 C7 85 88 FE FF FF A0 00 00 00 C7 85 8C FE FF
FF 20 00 00 00 C7 85 90 FE FF FF C0 00 00 00 C7
85 94 FE FF FF 40 00 00 00 C7 85 98 FE FF FF C0
00 00 00 C7 85 9C FE FF FF 20 00 00 00 C7 85 A0
FE FF FF E0 00 00 00 C7 85 A4 FE FF FF 40 00 00
00 C7 85 A8 FE FF FF E0 00 00 00 C7 85 AC FE FF
FF 20 00 00 00 C7 85 B0 FE FF FF 00 01 00 00 C7
85 B4 FE FF FF 40 00 00 00 C7 85 B8 FE FF FF 00
00 00 00 C7 85 BC FE FF FF 60 00 00 00 C7 85 C0
FE FF FF 20 00 00 00 C7 85 C4 FE FF FF 80 00 00
00 C7 85 C8 FE FF FF 20 00 00 00 C7 85 CC FE FF
FF 60 00 00 00 C7 85 D0 FE FF FF 40 00 00 00 C7
85 D4 FE FF FF 80 00 00 00 C7 85 D8 FE FF FF 40
00 00 00 C7 85 DC FE FF FF 60 00 00 00 C7 85 E0
FE FF FF 60 00 00 00 C7 85 E4 FE FF FF 80 00 00
00 C7 85 E8 FE FF FF 60 00 00 00 C7 85 EC FE FF
FF 60 00 00 00 C7 85 F0 FE FF FF 80 00 00 00 C7
85 F4 FE FF FF 80 00 00 00 C7 85 F8 FE FF FF 80
00 00 00 C7 85 FC FE FF FF 60 00 00 00 C7 85 00
FF FF FF A0 00 00 00 C7 85 04 FF FF FF 80 00 00
00 C7 85 08 FF FF FF 00 00 00 00 C7 85 0C FF FF
FF 00 00 00 00 C7 85 10 FF FF FF 00 00 00 00 C7
85 14 FF FF FF 00 00 00 00 8B 45 08 8B 48 74 89
8D 34 FE FF FF 81 BD 34 FE FF FF 8D 00 00 00 0F
87 69 08 00 00 8B 95 34 FE FF FF 0F B6 82 32 3A
44 00 FF 24 85 CA 39 44 00 8B 4D 08 C7 41 74 01
00 00 00 8B 55 08 C7 42 68 09 00 00 00 8B 45 08
C7 40 78 00 00 00 00 8B 4D 08 0F B7 51 50 81 E2
FF DF FF FF 8B 45 08 66 89 50 50 8B 4D 08 8B 51
78 83 C2 01 8B 45 08 89 50 78 8B 4D 08 83 79 78
15 7E 1E 8B 55 08 C7 42 74 02 00 00 00 8B 45 08
C7 40 78 00 00 00 00 8B 4D 08 C7 41 68 08 00 00
00 E9 E8 07 00 00 8B 55 08 8B 42 68 83 C0 01 8B
4D 08 89 41 68 8B 55 08 83 7A 68 0A 7E 0A 8B 45
08 C7 40 68 09 00 00 00 8B 4D 08 8B 51 78 83 C2
01 8B 45 08 89 50 78 8B 4D 08 83 79 78 15 7E 1E
8B 55 08 C7 42 74 03 00 00 00 8B 45 08 C7 40 78
00 00 00 00 8B 4D 08 C7 41 68 00 00 00 00 E9 8B
07 00 00 8B 55 08 8B 42 78 83 C0 01 8B 4D 08 89
41 78 8B 55 08 83 7A 78 15 7E 1B 8B 45 08 C7 40
74 0A 00 00 00 8B 4D 08 0F B7 51 50 83 CA 20 8B
45 08 66 89 50 50 E9 53 07 00 00 8B 4D 08 8B 55
08 66 8B 42 50 66 89 41 50 8B 4D 08 C7 41 74 0B
00 00 00 8B 55 08 C7 42 68 00 00 00 00 8B 45 08
C7 40 64 00 00 00 00 6A 40 90 90 90 6A 03 E8 ED
C1 FC FF 83 C4 08 8B 4D 08 89 41 78 8B 55 08 C7
42 10 00 00 00 00 8B 45 08 8B 48 08 3B 0D 54 E6
49 00 7E 0C 8B 55 08 C7 42 4C 00 00 00 00 EB 0A
8B 45 08 C7 40 4C 02 00 00 00 8B 4D 08 8B 51 64
83 C2 01 8B 45 08 89 50 64 8B 4D 08 83 79 64 04
7E 19 8B 55 08 C7 42 64 00 00 00 00 8B 45 08 8B
48 68 83 C1 01 8B 55 08 89 4A 68 8B 45 08 83 78
68 01 7E 0A 8B 4D 08 C7 41 68 00 00 00 00 6A 06
E8 5B 0A FC FF 83 C4 04 85 C0 75 0F 6A 03 E8 4D
0A FC FF 83 C4 04 83 F8 03 7E 0A 8B 55 08 C7 42
74 14 00 00 00 8B 45 08 83 78 78 00 74 11 8B 4D
08 8B 51 78 83 EA 01 8B 45 08 89 50 78 EB 32 6A
63 6A 00 E8 28 C1 FC FF 83 C4 08 25 01 00 00 80
79 05 48 83 C8 FE 40 85 C0 74 0C 8B 4D 08 C7 41
74 14 00 00 00 EB 0A 8B 55 08 C7 42 74 32 00 00
00 E9 28 06 00 00 8B 45 08 C7 40 74 15 00 00 00
8B 4D 08 C7 41 68 02 00 00 00 8B 55 08 C7 42 78
00 00 00 00 8B 45 08 8B 48 78 83 C1 01 8B 55 08
89 4A 78 8B 45 08 83 78 78 04





I'm freeeeeeeeeeee~
 
Feb 22, 2014 at 5:29 AM
leader of the meme team feat. tom, snaf and polad
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Jan 24, 2014
Location: Polar✪
Posts: 300
Hi again. You suggested I post this request here (again, heh) so I am.
Any way you could make very simple NPC's to act as light? Or to better explain what I mean, here's an example tileset I've been using for light.

p178096-0-gihrarn.png


The checkered black tiles at the top are my "lighting". They're placed around to emulate darkness, since more of the players and entities are obscured as they walk behind them (as they take up the foreground layer). Problem is, interactivity involving light is painful as hell to make.

An example at the code required to make some simple "lighting" changes...

Code:
#0120
//Facing: Right (Default)

<SOU0022
//First Light Dissapears
<CMP0021:0018:0007
<CMP0022:0018:0007
<CMP0023:0018:0007
<CMP0024:0018:0007
<CMP0025:0018:0007

<CMP0021:0017:0007
<CMP0022:0017:0007
<CMP0023:0017:0007
<CMP0024:0017:0007
<CMP0025:0017:0007

<CMP0021:0016:0007
<CMP0022:0016:0007
<CMP0023:0016:0007
<CMP0024:0016:0007
<CMP0025:0016:0007

<CMP0023:0015:0007
<CMP0024:0015:0007
<CMP0025:0015:0007

<CMP0025:0014:0007

//Floor Lighting Dissapears
<CMP0018:0019:0025
<CMP0019:0019:0025
<CMP0020:0019:0025
<CMP0021:0019:0025
<CMP0022:0019:0025
<CMP0023:0019:0025
<CMP0024:0019:0025
<CMP0025:0019:0025
<CMP0026:0019:0025
<CMP0026:0018:0025
<CMP0026:0017:0025
<CMP0026:0016:0025
<CMP0026:0015:0025
<CMP0026:0014:0025

//Second Light Appears
<CMP0020:0017:0000
<CMP0020:0016:0000
<CMP0020:0015:0000
<CMP0020:0014:0000

<CMP0019:0016:0000
<CMP0019:0015:0000
<CMP0019:0014:0000

<CMP0021:0016:0000
<CMP0021:0015:0000
<CMP0021:0014:0000

<CMP0022:0013:0000
<CMP0023:0012:0000
<CMP0024:0011:0000
<CMP0025:0010:0022

<CMP0019:0017:0004
<CMP0021:0017:0004
<CMP0018:0016:0004
<CMP0018:0015:0004
<CMP0018:0014:0004

<CMP0022:0016:0004
<CMP0022:0015:0004
<CMP0022:0014:0004

<CMP0023:0013:0004
<CMP0022:0012:0004
<CMP0024:0012:0004
<CMP0023:0011:0004
<CMP0025:0011:0004
<CMP0024:0010:0004

//Floor Light Appears

<CMP0019:0013:0017
<CMP0018:0013:0020
<CMP0020:0013:0017
<CMP0021:0013:0017
<CMP0025:0010:0020

<CMP0020:0019:0017
<CMP0021:0019:0020
<CMP0019:0019:0020

That code is also incomplete! So continuing to use tiles to emulate light will be far more painful then I'd like it to be.

So my request is this: Could I get some simple NPC's that are stationary, and always stay infront of other entities (although I think this is handled on the editor-level, but I'm not 100% certain if it's possible to force them infront or not). I...think it's a simple request.

Although, I'm actually not sure how it will work, since I would surely hit the entity limit very quickly if I used them as the primary method of lighting. I may have to alternate between them for partial lights and the thick black tile for the rest of the darkness...but that's better then nothing at all I suppose.

So to reiterate, stationary NPC's that serve no purpose other then to exist and be used as a cheap method of lighting, so I can easily modify them with <CNP commands. WOW Fuck this is a suprisingly big mouthful.
 
Last edited by a moderator:
Feb 22, 2014 at 7:48 AM
Its dark in here
"Deaths: 4000"
Join Date: Nov 21, 2013
Location: farther
Posts: 922
Age: 27
I know I've already asked for something but could you make the gaudi armors not turn into dead gaudis once they loose 15 hp and shoot 6 shurikens in air instead of 2?
 
Feb 23, 2014 at 2:32 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: 26
PolarStarGames said:
Hi again. You suggested I post this request here (again, heh) so I am.
Any way you could make very simple NPC's to act as light? Or to better explain what I mean, here's an example tileset I've been using for light.
p178096-0-gihrarn.png

The checkered black tiles at the top are my "lighting". They're placed around to emulate darkness, since more of the players and entities are obscured as they walk behind them (as they take up the foreground layer). Problem is, interactivity involving light is painful as hell to make.
An example at the code required to make some simple "lighting" changes...

-TSC code

That code is also incomplete! So continuing to use tiles to emulate light will be far more painful then I'd like it to be.
So my request is this: Could I get some simple NPC's that are stationary, and always stay infront of other entities (although I think this is handled on the editor-level, but I'm not 100% certain if it's possible to force them infront or not). I...think it's a simple request.
Although, I'm actually not sure how it will work, since I would surely hit the entity limit very quickly if I used them as the primary method of lighting. I may have to alternate between them for partial lights and the thick black tile for the rest of the darkness...but that's better then nothing at all I suppose.
So to reiterate, stationary NPC's that serve no purpose other then to exist and be used as a cheap method of lighting, so I can easily modify them with
Hmmmm...........

I'll try to do *something* but it might take a while for me to wrap my brain around a way to make this work.

and some tileset changing may be in order along with a <MIM command hack.


I know I've already asked for something but could you make the gaudi armors not turn into dead gaudis once they loose 15 hp and shoot 6 shurikens in air instead of 2?


Ok, give me a little bit though, I have other things to do first...
 
Last edited by a moderator:
Feb 23, 2014 at 4:52 AM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 28
OK, the Red Demon is ready.

Code:
;ANP 0001 = start attacking player
;ANP 0007 = dead

offset NPC276

#define

npc.jump=[ecx+1C]
npc.directionhandler = [ecx+18]

localvar1 = [EBP-14]
localvar2 = [EBP-18]
localvar3 = [EBP-1C]

TPcool = edit these to your likings

jumpheight = 500
jumplength = 300

L_framerect_distance = 0
U_framerect_distance = 40
#enddefine

push ebp                          ;This starts the code
mov ebp, esp  
sub esp,14

mov dword [EBP-10],0     
mov dword [EBP-C],0      
mov dword [EBP-8],0      
mov dword [EBP-4],0 
setpointer
cmp npc.health, 0
je :statedead


;direction check
mov eax, PlayerXpos
cmp npc.X, eax
jl :face_right
mov npc.direction, 0
jmp :end_direction
:face_right
mov npc.direction, 2
:end_direction
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


;-----FIRE (ground)-----

:statefire
add npc.y 5FF   
mov npc.framenum, 0
inc npc.objecttimer
cmp npc.objecttimer, 15
jge :fireproj
mov npc.framenum, 3
jmp :render
:fireproj
mov npc.framenum, 4
cmp npc.objecttimer, 21
je :create_object
:Fired_proj_ground
cmp npc.objecttimer, 30
jl :render
mov npc.objecttimer, 0
inc npc.scripttimer
push 0
push 7
call RANDOM
add esp, C
setpointer
cmp npc.scripttimer, eax
jge :jump_prep
jmp :render

:create_object
setpointer
push 0
mov edx, npc.y
sub edx, playerypos
push edx
mov edx, npc.x
sub edx,playerxpos
push edx
call 004258e0                      ;detects player collision
add esp,8
mov localvar3,eax
mov edx,localvar3
push edx                             
call 004258b0                      ;sin table
add esp,4
shl eax,2
mov localvar2,eax
mov eax, localvar3
push eax                             
call 004258c0                      ;cos table
add esp,4
shl eax,2
mov localvar1,eax
push 100                                
push 0                                
push 0                                 
mov ecx, localvar2          
push ecx                             
mov edx, localvar1          
push edx                              
setpointer
mov eax, npc.y           
push eax                                
mov edx, npc.x            
push edx
push 115
call 0046efd0                            
add esp,20
cmp npc.scriptstate, 1
je :Fired_proj_ground
jmp :jump_vel_handler_Y






:jump_prep
mov npc.scriptstate, 3
mov npc.objecttimer, 0
jmp :render

;-----JUMP-----

:statejump1                  ;squat before jump
inc npc.objecttimer
cmp npc.objecttimer, 10 
jg :statejump2
mov npc.framenum, 2
jmp :render

:Statejump2                  ;prep for jump (one frame)
mov npc.framenum 7
mov npc.scriptstate, 5
mov npc.objecttimer, 0
cmp npc.direction, 2
je :right_jump_prep
mov npc.jump, 0
jmp :left_jump_prep
:right_jump_prep
mov npc.jump, 2
:left_jump_prep
jmp :render

;objecttimer = open/close arms timer
;scripttimer = jumping timer

:Statejump3
cmp npc.jump, 2
je :right_jump
add npc.X -jumplength
jmp :left_jump
:right_jump
add npc.X jumplength
:left_jump
inc npc.objecttimer
cmp npc.objecttimer, 10       ;before arms closed
jge :Statejump4
jmp :jump_vel_handler_Y

:Statejump4
mov npc.framenum, 5           ;closed arms
cmp npc.objecttimer, 15      
jg :jumpfire
jmp :jump_vel_handler_Y

:jumpfire
mov npc.framenum, 6
cmp npc.objecttimer, 20       ;time between firing
je :create_object
cmp npc.objecttimer, 28
jl :jump_vel_handler_Y
mov npc.scriptstate, 5
mov npc.objecttimer, 0
jmp :jump_vel_handler_Y


:jump_vel_handler_Y
cmp npc.scriptstate, 2
je :render
add npc.scripttimer, 15       ;script timer holds velocitys?
cmp npc.scripttimer, A00
jg :vel_to_high
mov eax, npc.scripttimer
add eax, -jumpheight
add npc.Y, eax
jmp :render


:vel_to_high
cmp npc.collision, 0          ;colliding with something? (need to test values)
jge :done_jump
cmp npc.collision, 20
jg :done_jump
mov eax, A00
add eax, -jumpheight
add npc.Y, eax
jmp :render

:done_jump
mov npc.scriptstate, 2        ;go to state lightning
mov npc.scripttimer, 0
mov npc.objecttimer, 0
jmp :render


:StateLightning
add npc.Y 5ff                 ;gravity
mov npc.framenum, 3
inc npc.objecttimer
cmp npc.objecttimer 30
je :lightning
jl :render
mov npc.framenum, 4
cmp npc.objecttimer, 60
jl :render
mov npc.scriptstate, 3
jmp :render

:lightning
push 140
push 0
push 0 
push 0
push 0
setpointer
mov eax PlayerYPos
push eax
mov eax PlayerXPos
push eax
push 14D
call 46efd0
add esp,20
setpointer
mov npc.scriptstate, 1
jmp :render


:stateDead
;inc npc.scriptstate

;push 0
;push 36
;call PlaySound
;add esp, 8

:statedead2

                ;gravity
mov npc.framenum, 8
mov npc.flags, 200

mov npc.hitrectL, 0
mov npc.hitrectU, 0
mov npc.hitrectR, -8000
mov npc.hitrectD, -8000

jmp :render

;---------------------


:stateIdle
add npc.y 5FF                 ;gravity
mov npc.objecttimer, 0
mov npc.framenum, 0
inc npc.frametimer
cmp npc.frametimer, 30        ;breathe check
jl :render
mov npc.framenum, 1
cmp npc.frametimer, 60
jl :render
mov npc.frametimer,0

:render
cmp npc.direction, 2         ;trasfer directon to our variable
je :direction_transfer
mov npc.directionhandler, 0
:direction_transfer
jmp :end_direction_transfer
mov npc.directionhandler, 1
:end_direction_transfer
xor eax, eax                 ;mov eax L_framerect_distance                   
mov eax,npc.framenum                  
imul al, al, 20
mov npc.DisplayL,eax                    
add eax,20                          
mov npc.displayR,eax   
mov eax, U_framerect_distance      
cmp npc.direction, 2                     
jne :render_left
add eax 28
:render_left
mov npc.displayU,eax                   
add eax,28                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn


:StateTable
print :StateIdle         ;<ANP0000
print :StateFire
print :StateLightning
print :Statejump1
print :Statejump2
print :Statejump3        ;<ANP0005
print :Statejump4
print :statedead
print :statedead2
Hey um, the smoke is still really buggy. I'm thankful that I can at least kill the boss now, but the smoke is solid and shooting it makes it multiply. Do you think you can fix this? If it would make it easier for you, you can make it so that doesn't generate any smoke in the first place.
 
Feb 26, 2014 at 11:19 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: 26
oh, right right, I'll fix that ASAP.

and removing it would still not fix the issue with the other entitys that use smoke.

try editing the npc.tbl file and see if that works.

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

Tpcool said:
Hey um, the smoke is still really buggy. I'm thankful that I can at least kill the boss now, but the smoke is solid and shooting it makes it multiply. Do you think you can fix this? If it would make it easier for you, you can make it so that doesn't generate any smoke in the first place.
Oh wow, I finally get to it and it took me 2 seconds to fix.


Open up your favorite npc.tbl editor and change the hitbox for npc 4 to.....

"0"
"0" "0"
"0"


That's it!
 
Feb 27, 2014 at 12:42 AM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 28
Bombchu Link said:
Oh wow, I finally get to it and it took me 2 seconds to fix.
Open up your favorite npc.tbl editor and change the hitbox for npc 4 to.....
"0"
"0" "0"
"0"
That's it!
Um, you sure? I tried that, and nothing changed. Smoke is still solid, and still multiplies when shot. I think the reason you thought it was fixed is because the smoke always functions normally until the boss fight. If you just opened up a game with the boss in it and tested the smoke without actually fighting the boss, it will still function normally.
 
Feb 27, 2014 at 1:28 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: 26
I tested it in the boss fight....

let me check...

Demonsmoke_zpsc623f63f.png


it should look like.

change size to no smoke.
 
Feb 27, 2014 at 1:43 AM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 28
smokeout_zps7bbc978d.png
They are the same, no? While this didn't fix the problem with the smoke still being solid, this did fix the problem with the smoke multiplying upon being shot. So that's something.
 
Feb 27, 2014 at 1:55 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: 26
I...

I don't know what the issue is.

It seems that only when the projectile spawns when it does that...

the smoke generator npc spawns ones that are completely normal and aren't collide-able with.

Hmmmmm........


Has anyone else had this issue before?
 
Feb 27, 2014 at 6:31 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
where in that code is it creating smoke
I don't see any spawn NPC 4
 
Mar 1, 2014 at 1:22 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: 26
where in that code is it creating smoke
I don't see any spawn NPC 4


That's the thing, it never does.



It only creates the projectile and lightning.

Hey um, the smoke is still really buggy. I'm thankful that I can at least kill the boss now, but the smoke is solid and shooting it makes it multiply. Do you think you can fix this? If it would make it easier for you, you can make it so that doesn't generate any smoke in the first place.




I can make it not generate smoke.



anyway, here is the NEW red demon code.



it now works on non-flat ground



it also doesn't have that pesky error of sinking into the ground or floating in the air on death.


Code:
;ANP 0001 = start attacking player
;ANP 0007 = dead

offset NPC276

#define

npc.jump=[ecx+1C]

localvar1 = [EBP-14]
localvar2 = [EBP-18]
localvar3 = [EBP-1C]

jump_height  = 400
jump_gravity = 15
jump_length = 300

L_framerect_distance = 0
U_framerect_distance = 40
#enddefine


push ebp                          ;This starts the code
mov ebp, esp  
sub esp,14

mov dword [EBP-10],0     
mov dword [EBP-C],0      
mov dword [EBP-8],0      
mov dword [EBP-4],0 
setpointer
cmp npc.health, 0
je :statedead


;direction check
mov eax, PlayerXpos
cmp npc.X, eax
jl :face_right
mov npc.direction, 0
jmp :end_direction
:face_right
mov npc.direction, 2
:end_direction
mov eax, npc.scriptstate
jmp [eax*4+:StateTable]


;-----FIRE (ground)-----

:statefire
add npc.y 5FF   
mov npc.framenum, 0
inc npc.objecttimer
cmp npc.objecttimer, 15
jge :fireproj
mov npc.framenum, 3
jmp :render
:fireproj
mov npc.framenum, 4
cmp npc.objecttimer, 21
je :create_object
:Fired_proj_ground
cmp npc.objecttimer, 30
jl :render
mov npc.objecttimer, 0
inc npc.scripttimer
push 7
push 0
call RANDOM
add esp, C
setpointer
cmp npc.scripttimer, eax
jge :jump_prep
jmp :render

:create_object
setpointer
push 0
mov edx, npc.y
sub edx, playerypos
push edx
mov edx, npc.x
sub edx,playerxpos
push edx
call 004258e0                      ;detects player collision
add esp,8
mov localvar3,eax
mov edx,localvar3
push edx                             
call 004258b0                      ;sin table
add esp,4
shl eax,2
mov localvar2,eax
mov eax, localvar3
push eax                             
call 004258c0                      ;cos table
add esp,4
shl eax,2
mov localvar1,eax
push 100                                
push 0                                
push 0                                 
mov ecx, localvar2          
push ecx                             
mov edx, localvar1          
push edx                              
setpointer
mov eax, npc.y           
push eax                                
mov edx, npc.x            
push edx
push 115
call 0046efd0                            
add esp,20
cmp npc.scriptstate, 1
je :Fired_proj_ground
jmp :jump_vel_handler_Y

:jump_prep
mov npc.scriptstate, 3
mov npc.objecttimer, 0
jmp :render

;-----JUMP-----

:statejump1                  ;squat before jump
inc npc.objecttimer
cmp npc.objecttimer, 10 
jg :statejump2
mov npc.framenum, 2
jmp :render

:Statejump2                  ;prep for jump (one frame)
mov npc.framenum 7
mov npc.scriptstate, 5
mov npc.objecttimer, 0
cmp npc.direction, 2
je :right_jump_prep
mov npc.jump, 0
jmp :left_jump_prep
:right_jump_prep
mov npc.jump, 2
:left_jump_prep
jmp :render

;objecttimer = open/close arms timer
;scripttimer = jumping timer

:Statejump3
cmp npc.jump, 2
je :right_jump
add npc.X -jump_length
jmp :left_jump
:right_jump
add npc.X jump_length
:left_jump
inc npc.objecttimer
cmp npc.objecttimer, 10       ;before arms closed
jge :Statejump4
jmp :jump_vel_handler_Y

:Statejump4
mov npc.framenum, 5           ;closed arms
cmp npc.objecttimer, 15      
jg :jumpfire
jmp :jump_vel_handler_Y

:jumpfire
mov npc.framenum, 6
cmp npc.objecttimer, 20       ;time between firing
je :create_object
cmp npc.objecttimer, 28
jl :jump_vel_handler_Y
mov npc.scriptstate, 5
mov npc.objecttimer, 0

:jump_vel_handler_Y
add npc.Y -jump_height          ;jump heigth
add npc.movey, jump_gravity      ;gravity pull
mov eax npc.movey
add npc.y eax

mov edx, npc.collision
and edx, 8                   ;check if hi floor
jne :done_jump
jmp :render

:done_jump
mov npc.scriptstate, 2        ;go to state lightning
mov npc.scripttimer, 0
mov npc.objecttimer, 0
jmp :render

;----------------------------------------------------

:StateLightning
add npc.Y 5ff                 ;gravity
mov npc.framenum, 3
inc npc.objecttimer
cmp npc.objecttimer 30
je :lightning
jl :render
mov npc.framenum, 4
cmp npc.objecttimer, 60
jl :render
mov npc.scriptstate, 3
jmp :render
:lightning
push 140
push 0
push 0 
push 0
push 0
setpointer
mov eax PlayerYPos
push eax
mov eax PlayerXPos
push eax
push 14D
call 46efd0
add esp,20
setpointer
mov npc.scriptstate, 1
jmp :render


:stateDead
;inc npc.scriptstate

;push 0
;push 36
;call PlaySound
;add esp, 8

:statedead2
add npc.Y 300                ;gravity
mov edx, npc.collision
and edx, 8                   ;check if hit floor
jne :cont_die
add npc.Y 5ff
:cont_die
mov npc.framenum, 8
mov npc.flags, 200
mov npc.damage, 0
jmp :render

;---------------------


:stateIdle
add npc.y 5FF                 ;gravity
mov npc.objecttimer, 0
mov npc.framenum, 0
inc npc.frametimer
cmp npc.frametimer, 30        ;breathe check
jl :render
mov npc.framenum, 1
cmp npc.frametimer, 60
jl :render
mov npc.frametimer,0

:render
xor eax, eax                 ;mov eax L_framerect_distance                   
mov eax,npc.framenum                  
imul al, al, 20
mov npc.DisplayL,eax                    
add eax,20                          
mov npc.displayR,eax   
mov eax, U_framerect_distance      
cmp npc.direction, 2                     
jne :render_left
add eax 28
:render_left
mov npc.displayU,eax                   
add eax,28                           
mov npc.displayD,eax   

:end_of_code
mov esp, ebp
pop ebp
retn


:StateTable
print :StateIdle         ;<ANP0000
print :StateFire
print :StateLightning
print :Statejump1
print :Statejump2
print :Statejump3        ;<ANP0005
print :Statejump4
print :statedead
print :statedead2




I'll post the other stuff a little later once I find where it generates smoke in the code to the other NPC's





edit:



proj of the boss:


Code:
0x45D828

25 FF 00 00 00 74 7D 68 00 01 00 00 6A 00 6A 00
6A 00 6A 00 8B 4D 08 8B 51 0C 52 8B 45 08 8B 48
08 51 6A 00


lightning thing:


huh, that's weird, it's not there...

 
Mar 2, 2014 at 11:38 PM
Tommy Thunder
Discord Group Admin
Org Discord Moderator
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 24, 2011
Location: New Westminster, BC
Posts: 1368
Age: 28
Bombchu Link said:
I'll post the other stuff a little later once I find where it generates smoke in the code to the other NPC's


edit:

proj of the boss:

Code:
0x45D828

25 FF 00 00 00 74 7D 68 00 01 00 00 6A 00 6A 00
6A 00 6A 00 8B 4D 08 8B 51 0C 52 8B 45 08 8B 48
08 51 6A 00

lightning thing:

huh, that's weird, it's not there...
oof man weird things happened when I applied this. Instead of the smoke being solid, it'll crash the game, inflict 200+ damage, or still be solid. I'm not sure if you know this already, but I just want to make sure what's happening on my end.
 
Top