Oct 27, 2015 at 11:13 PM
Stoned Member
"All your forum are belong to us!"
Join Date: Sep 22, 2012
Location: Hell
Posts: 560
Oct 28, 2015 at 2:57 AM
Its dark in here
"Deaths: 4000"
Join Date: Nov 21, 2013
Location: farther
Posts: 922
Age: 27
WOW, I guess I should have known because you posted the same message twice.

Sorry for going off the thread's topic, but BLink, there's newbies that come here regularly. Why do you need to pose as one to test this? Why not observe how these "elite" members treat a newer member? There's so many of them that there's no need to create an entirely new account.
someone else's experience will never be able to measure up to one's own
 
Oct 28, 2015 at 5:58 PM
Junior Member
"Fresh from the Bakery"
Join Date: May 1, 2015
Location: Netherlands
Posts: 16
Age: 24
I finished my dutch translation of Cave Story but I can't find that line, so I can't translate it.
Can anyone help me out?
 
Oct 28, 2015 at 6:39 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
you need to change the name of the map titled "_u" or something like that
 
Oct 28, 2015 at 8:49 PM
Junior Member
"Fresh from the Bakery"
Join Date: May 1, 2015
Location: Netherlands
Posts: 16
Age: 24
It worked,
thanks a lot!
 
Oct 28, 2015 at 11:52 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 I'm gonna preface this by saying that if you want to know how the crystal moves then the most direct approach would be to look at its code yourself, but

it's all just math and physics, really. Every object has a position, and a speed (velocity) which is the change in its position over time. You also have acceleration, which is the change in speed over time. There's also another level deeper called "jerk" which is change in acceleration over time, but we'll disregard that because it doesn't help us much in most cases.
In order to have believable motion you should manipulate acceleration to effect a change in position. Pick an acceleration speed, and each frame add it to your speed. In turn, each frame you also add your speed to your position. Simple as that. In cave story acceleration is usually represented by adding/subtracting hard-coded values to the speed directly because there isn't a variable for objects to store their acceleration. You can also simulate friction by adding an acceleration in the opposite direction to motion.

Now, for a more specific example I believe the crystal probably works on a simple "orbit point" algorithm. For this you just always accelerate towards the point in both the x and y axis, so if you're to the left of the point accelerate right, if you're above it accelerate down and vice versa. When you pass it you'll have a high speed so the change in acceleration will slow it down until it stops and starts going back the other way.

I found this in my old notes; it's basically the old code made to work in the assemble and all jumps are editable ect.

Code:
offset 458360  

#define

L_framerect_distance = AF
U_framerect_distance = 20

sprite heigth        = 10
sprite width         = 8


#enddefine

PUSH EBP
MOV EBP,ESP
SUB ESP,34

MOV DWORD PTR SS:[EBP-30],0B0
MOV DWORD PTR SS:[EBP-2C],20
MOV DWORD PTR SS:[EBP-28],0B8
MOV DWORD PTR SS:[EBP-24],30
MOV DWORD PTR SS:[EBP-20],0B8
MOV DWORD PTR SS:[EBP-1C],20
MOV DWORD PTR SS:[EBP-18],0C0
MOV DWORD PTR SS:[EBP-14],30
MOV DWORD PTR SS:[EBP-10],0
MOV DWORD PTR SS:[EBP-0C],0
MOV DWORD PTR SS:[EBP-8],0
MOV DWORD PTR SS:[EBP-4],0
setpointer


MOV edx, npc.scriptstate
CMP EDX,0
JE  :jump_A
CMP EDX,1
JE  :jump_B
CMP EDX, A
JE  :jump_C
JMP :jump_D


:jump_A
MOV  npc.scriptstate, 1

:jump_B
CMP [4BBA30],0
JE  :jump_F
MOV npc.scriptstate, 0A
JMP :jump_F

:jump_C
MOV edx,  npc.x
CMP edx, [4BBA30]
JGE :jump_E
ADD npc.movex,55

:jump_E
MOV eax,  npc.x
CMP eax, [4BBA30]
JLE :jump_F
ADD npc.movex,-55

:jump_F
MOV edx, npc.y
CMP edx, [4BBA28]
JGE :jump_G
ADD npc.movex,55

:jump_G
MOV eax, npc.y
CMP eax, [4BBA28]
JLE :jump_H
ADD npc.movex,-55

:jump_H
CMP npc.movex,400
JLE :jump_I
MOV npc.movex,400

:jump_I
CMP npc.movex,-400
JGE :jump_J
MOV npc.movex,-400

:jump_J
CMP npc.movey,400
JLE :jump_K
MOV npc.movey,400

:jump_K
CMP npc.movey,-400
JGE :jump_L
MOV npc.movey,-400

:jump_L
MOV eax,  npc.x
ADD eax, npc.movex
MOV npc.x,eax

MOV edx, npc.y
ADD edx, npc.movey
MOV npc.y,edx


:jump_F
:jump_D
setpointer
inc npc.frametimer
CMP npc.frametimer, 3
JLE :reset_timer_done
MOV npc.frametimer, 0
inc npc.frametimer
:reset_timer_done
CMP npc.framenum, 1
JLE :reset_frame_done
MOV npc.framenum, 0
:reset_frame_done

CMP npc.direction, 0
JNE :jump_O
CMP npc.movex,0
JLE :jump_O
MOV npc.framenum,2

:jump_O
CMP npc.direction,2
JNE :render
CMP npc.movex, 0
JGE :render
MOV npc.framenum,2

:render
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  
mov npc.displayU,eax           
add eax, sprite heigth                          
mov npc.displayD,eax  

MOV ESP,EBP
POP EBP
RETN

the RAM at [4BBA28] and [4BBA30] prolly has something to do with the Doctor's X and Y position or at least the target area the crystal has to go to.
other then that it looks just like something I would make myself..... maybe it's the X and Y pos that are constantly being updated so that it looks like the crystal is moving about?
 
Oct 29, 2015 at 2:11 AM
Junior Member
"It's dangerous to go alone!"
Join Date: Sep 4, 2014
Location: South Korea
Posts: 44
how add Trolly Right Graphics in code?? Already add Left Graphics
 
Last edited:
Oct 29, 2015 at 2:32 AM
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
I don't think I designed it to have different graphics for moving left or right in the first place, but you could change the frame rect based on whether the xvel is >= 0
 
Oct 29, 2015 at 6:13 AM
Junior Member
"It's dangerous to go alone!"
Join Date: Sep 4, 2014
Location: South Korea
Posts: 44
i add more Trolly other npc 126 is make like pic
p208925-0-full.png

??? what problem
p208925-1-full.png

and Properties
 
Oct 31, 2015 at 4:09 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
Oct 31, 2015 at 4: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
Npc hitboxes are square, tile hitboxes are plus shaped
 
Oct 31, 2015 at 7:10 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
It's a bad idea but it might work
 
Nov 4, 2015 at 2:43 PM
Junior Member
"It's dangerous to go alone!"
Join Date: Sep 4, 2014
Location: South Korea
Posts: 44
Pull out the players for himself, like Barnacle To give a damage
What should I do that? Use NPC is 176 and the graphics settings are retained
(And Trolley hitbox was resolved)
 
Nov 5, 2015 at 3:10 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Oct 22, 2014
Location: Xyrinfe multiverse
Posts: 100
Age: 28
Do map scripts have character limits?
 
Nov 5, 2015 at 3:35 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
Do map scripts have character limits?
Yes. According to this thread, the limit is 17,999 characters, but I'm positive there is a way to increase the limit using ASM. If you do some searching around and manage to find the address, it should be very easy to modify.

EDIT: This is probably the way to increase the limit:
Cave story loads a tsc file by opening it, copying all the contents into a big string, adding a 0 to the end of the string and closes the file. This big string must be allocated (the program asks the operating system for a piece of memory, the os prepares it and returns a pointer to the location), and that happens at 0x421544:
Code:
push 0x5000
call _malloc
add esp, 4
mov [0x4a5ad8], eax ; pointer to tsc buffer

0x5000 is the number of bytes the program wants (in decimal, 20480), this is too small for "Mansion1.tsc" and thus the program fails when trying to copy the contents of "Mansion1.tsc" to the allocated region. You could change this to something bigger, like 0x8000 (32768).
 
Last edited:
Nov 6, 2015 at 6:19 AM
Junior Member
"It's dangerous to go alone!"
Join Date: Sep 4, 2014
Location: South Korea
Posts: 44
how can find create NPC123(Curly Boss Shoot) in NPC(Curly Boss) cord use by OllyDbg
wan i try change NPC123 shoot to shotgun shoot
 
Nov 6, 2015 at 1:42 PM
beep boop
Bobomb says: "I need a hug!"
Join Date: Aug 16, 2014
Location: no
Posts: 845
Age: 23
Well, they use different entities, if I'm correct. You'd need to do some more assembly to change the properties of the bullet.
 
Nov 6, 2015 at 2:03 PM
Senior Member
"Huzzah!"
Join Date: Aug 24, 2013
Location: 0xDEADBEEF
Posts: 211
how can find create NPC123(Curly Boss Shoot) in NPC(Curly Boss) cord use by OllyDbg
wan i try change NPC123 shoot to shotgun shoot
I did something like replacing what an entity shoots. Make sure that you know if her gun is the part of the Curly Boss entity or if it is separate. Find the offset for the entity, then scroll through it to find the function call that spawns a bullet entity (look through the ASM Compendium).
 
Top