PDA

View Full Version : Extra Custom Names for Characters?


Giga Universe
January 27th, 2010, 08:10 AM
Here is a topic that I have been mildly interested in. The idea is to built a script that can be activated during the game play, that allows the player to provide a custom name for a reoccurring character. I built a script that uses a nickname Pokémon Script, and stores the name on one of the buffers. However, I encountered two problems. First, the string buffers 1-3 are commonly used, and therefore would overwrite your rivals names. Second, using the nickname Pokémon Script provides more than 7 characters for the name, and would be inconvenient in dialogue. So, maybe someone could build a mod on the nickname script to force it to store the text in the RAM, usable like a buffer, and force the nickname script to only allow 7 characters? Since I have no ASM experience (I understand basic concepts, but can't code), I cannot investigate this further...

liuyanghejerry
January 27th, 2010, 09:12 PM
I don't understand you well.
But using writebytetooffset/loadbytefrompointer/bufferstring commands may help you.

HackMew
January 28th, 2010, 03:32 AM
Using buffers is definitely not a good idea, indeed. Also, since the naming special works for Pokémon only, it needs to be hacked to eventually implement a custom rival/etc. naming. Aside from that, having custom names requires some reserved memory area for them. I'm thinking of variables, as with 4 variables you have 8 bytes which means 7 letters + string terminator (0xFF). Then, to use the name you could use the bufferstring command pointing to the first chosen variable address. Even though I never tried using bufferstring with a RAM pointer, it should work fine theoretically.

NarutoActor
January 28th, 2010, 11:13 AM
hmm... here is an idea, when it comes to memory can't you just over-ride the old nick name with the new one?

Giga Universe
January 29th, 2010, 08:33 AM
Making progress. Using Hackmew's suggestion of using variables, which hold 2 characters each, I created a simple script, which uses setvars to set bytes to make up the word 'Giverse'.

#dynamic 0x800000

#org @start
setvar 0x8000 0xDDC1 'store the Gi
setvar 0x8001 0xD9EA 'store the ve
setvar 0x8002 0xE7E6 'store the rs
setvar 0x8003 0xFFD9 'store the e and the stop (0xFF)
bufferstring 0x1 0x020370B8 'buffer data located at 0x8000 - 0x8003
message @1 0x6
end

#org @1
= \v\h03

So, you can buffer a RAM address, it works perfectly. All that needs to be done is make an ASM routine that stores the chosen name to a variable, and then limit the choice of characters to 7.

EDIT:

Modified the above script. It copies text stored in buffer 1 directly from the RAM into the variable storage space. It has a custom nickname screen. But it does not limit to 7 characters. Right now, it shows a Bulbsaur instead of a Overworld, and says: "What will Balbasuar's nickname be?"

#dynamic 0x800000

#org @start
givepokemon 0x1 0x1 0x1 0x0 0x0 0x0
call 0x1A74EB
copybyte 0x020370B8 0x0202428c
copybyte 0x020370B9 0x0202428d
copybyte 0x020370BA 0x0202428e
copybyte 0x020370BB 0x0202428f
copybyte 0x020370BC 0x02024290
copybyte 0x020370BD 0x02024291
copybyte 0x020370BE 0x02024292
copybyte 0x020370BF 0x02024293
writebytetooffset 0xFF 0x020370C0
bufferstring 0x1 0x020370B8 'buffer data located at 0x8000 - 0x8003
message @1 0x6
special 0x0EF
end

#org @1
= Hello, my name is \v\h03!