Any better way to ensure 6C_MU Sprite centered on camera?

Hello guys, I am currently trying to adapt the FreeMovement (by genius Sme) to the gProc_MoveUnit.

A simple protatype is here:

<Download Here!>


You will find that if the character goes too far, it will walk off the screen.

However, even if the function “EnsureCameraOntoPosition” is called, the screen switching process is still not smooth:

mov		r0, #0
mov		r1, r5   @x
mov		r2, r6   @y
blh		CenterCameraOntoPosition


I wonder any better way to set MU_Sprite to be always centered at each frame during camera movement. If you have any good idea, please feel free to share your genius thoughts! Thx!

Try setting evbit 9 to true

  • evbit 9 is the “camera follows moving units” evbit. When set, any units moved through events (through loading or moving for example) will have the camera follow them.

You said EnsureCameraOntoPosition, but your blh is to CenterCameraOntoPosition, which does not take 0 in r0 I think. It uses the parent proc afaik.

.equ CenterCameraOntoPosition,0x8015D84
@ r0 = parent proc, r1 x, r2 y
blh CenterCameraOntoPosition

Good luck! I look forward to seeing what you come up with.

You might possibly find this reference as useful, but probably not:

This is something I wrote for the AI to do other stuff. We tell the AI to wait at some square, and as soon as they are performing the wait action, I do a bunch of custom stuff for modular summon. I think that looking at what the AI does might possibly be helpful. But it might be too hard to understand.

1 Like

thx very much!

Thank you for your reminder!

Just as you said, Set Evbit_9 can indeed make the camera move with the MoveUnit. For this reason, I checked the proc tree and found that gProc_CameraMovement acturally no longer exists during Evnt-Move-Unit.

It is another proc, “gProc_MapTask” control the camera by calling function “SetBgPosition” (0x800148C+1) inside _6C_CALL_ROUTINE (0x8019D28+1),

In contrast, there happens to be a place to control the effect of this function in MU6C, we just need to insert a judgement for our own proc (here to be my Freemovement proc) at 0x8078D10:

    ORG 0x78D10


	@ORG 0x8078D10
	ldr		r0, =FreeMovementControlProc
	blh		ProcFind
	cmp		r0, #0
	beq		.ReturnCall2Normal
	ldr		r0, =0x8078D23
	bx		r0
	mov		r0, r6
	add		r0, #0x3E
	ldrb	r0, [r0]
	cmp		r0, #0
	beq		.ReturnCall2SkipCamera
	ldr		r0, =gProc_CameraMovement
	blh		ProcFind
	cmp		r0, #0
	beq		.ReturnCall2SkipCamera
	ldr		r1, =0x8078D3D
	bx		r1

Then it worked:

1 Like

I’m excited to try out your version! I’ll try it out tomorrow, I think.

I have now modified the entire FreeMU proc and have posted it here. I believe this will be useful to you!

1 Like