PDA

View Full Version : [Tutorial] Instant movecamera script tutorial


jota_rdk
October 9th, 2010, 12:22 PM
What is instant movecamera?


This type of script serves for make a movecamera instantly.

It is very useful for to make good scripts. And don't need know how make a simple movecamera with applymovement comand. I explain all you need know for make a instant movecamera script in this tutorial.

Before continue, I want give special thanks to R!cci.

And excuse me for my english


Could you put an example?


Sure. Here I put an example. Is a youtube video uploaded by me:

P9aHiNDSdX0


http://www.youtube.com/watch?v=P9aHiNDSdX0 (http://www.youtube.com/watch?v=P9aHiNDSdX0 [/CODE)


How I make a instant movecamera script?


This is the interesting part. First, you must know the commands that we will utilize. These are the next:


fadescreen 0xA
movesprite 0xA 0xB 0xC
Special 0xA
writebytetooffset 0xA 0x2025734/2025736
Now, I will write the script body:


org @start
[script before instant movecamera]
[instant movecamera 1]
[script into instant movecamera]
[instant movecamera 2]
[script after instant movecamera]
release
end


Why the colours? Because so you will understand better. I will put my script for you see how make a instant movecamera script:

If you don't know how to use movesprite comand, you should revise this spoiler:
movesprite 0xA 0xB 0xC

Here, you must put the minisprite number in advance map. If you want that dissapear hero, you must put FF
Simbolize the x-axis
Simbolize the y.axis


org @start
lock
faceplayer
msgbox @text1
callstd 0x6
fadescreen 0x1
special 0x113 (serves to separate the camera of the hero)
writebytetooffset 0x12 0x2025734 (will move camera instantly in the x-axis to her new position)
writebytetooffset 0xC 0x2025736 (will move camera instantly in the y-axis to her new position)
special 0x8E (will update the screen)
movesprite 0xFF 0x9 0x4 (You must move hero to his original position)
movesprite 0x1 0xA 0x4 (You must move all minisprites that appear in the screen to his originals positions)
fadescreen 0x0
pause 0x40 (will stop the game during the time that you want)
msgbox @text2 (simple message)
callstd 0x6
fadescreen 0x1
special 0x113 (You must write this command again)
writebytetooffset 0x9 0x2025734 (will move camera instantly in the x-axis to original position)
writebytetooffset 0x4 0x2025736 (will move camera instantly in the y-axis to original position)
special 0x8E (will update the screen)
movesprite 0xFF 0x9 0x4 (You must move hero to his original position again)
movesprite 0x1 0xA 0x4 (You must move all minisprites that appear in the screen to his originals positions again)
special 0x114 (Camera will join to hero movement)
fadescreen 0x0
msgbox @text3
callstd 0x6
release
end

#org @text1
= Excuse me.\nWhere is alex's house?

#org @text2
= This is alex's house.

#org @text3
= Ok. Thanks!



How I use a writebytetooffset comand?


writebytetooffset 0xA 0x2025734 / 2025736

Position coordinate
Simbolize the x-axis
Simbolize the y-axis

For example, if you want to move the camera to 0017 (x-axis) and 000C (y-axis) You must put:

writebytetooffset 0x17 0x2025734 (this is the x-axis)
writebytetooffset 0xC 0x2025736 (this is the y-axis)
(you don't forget of special 0x8E comand)


Tutorial by javi4315 (jota_rdk here xD)
Special thanks for R!cci

if you have any doubt tell me.

I hope you enjoy this tutorial

Greetings!

ดูดดื่ม
October 10th, 2010, 09:17 PM
thank you so much for sharing.

chriskid198
October 10th, 2010, 10:31 PM
That looks so cool, may use this in my hack...

gamesharkhacker
January 22nd, 2011, 04:31 AM
I inserted this into my Ruby ROM and all i get is "qAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFt
qAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFtqAFt"

I've checked over it and it still won't stop "qAFting"...

Shiny Quagsire
January 22nd, 2011, 12:11 PM
Quick question: Does this work for fire red?

TSK
April 24th, 2011, 04:51 AM
Quick question: Does this work for fire red?

(Sorry for the bump, I don't think my little addition deserves a thread of it's own.)

As it is describred in the OP this does not work for FR, mostly because the location where the coördinates are stored changes dynamically. I wrote a little ASM to fix that though:

.text
.align 2
.thumb
.thumb_func
.global editcoords

main:
push {r0-r2, lr}

ldr r0, .POINTER
ldr r1, [r0]

ldr r2, .VAR2
ldrh r2, [r2]
strh r2, [r1]

add r1, r1, #0x2

ldr r2, .VAR3
ldrh r2, [r2]
strh r2, [r1]

pop {r0-r2, pc}


.align 2
.POINTER:
.word 0x03005008
.VAR2:
.word 0x020370BC
.VAR3:
.word 0x020370BE

Usage of the above ASM is as follows:

setvar 0x8002 0xA
setvar 0x8003 0xB
callasm 0xLOCATION + 1

This will move the camera Coördinates to location (A, B).

Just use the above instead of the writebytetooffset commands in the OP and it will work for Fire Red.