Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-01-06 19:45:06

Chamber_
Member
Registered: 2013-12-31
Post 9/119

[GSC] Move Tutor in Pokemon Gold

In the beta 4 of "Pokémon Dark Energy" I have seen that there are move tutors that teach certain pokemon one single move.

My question is if I can do something like what's in Crystal, move tutor to teach three or more attacks to many pokemon?

I know how to do the script, the only thing I would dont know is ASM routine.

Offline

#2 2014-01-06 20:25:08

Miksy91
Member
Registered: 2010-10-16
Post 2,046/2,317

Re: [GSC] Move Tutor in Pokemon Gold

To put it simply, you should look what the code in Crystal does and implement it in Gold that way.

What I think it does is to "imitate" TM learning so that when in Goldenrod you talk to that person and ask him to for example teach Flamethrower, the menu is opened in a similar way when you select TM Flamethrower from TM/HM Pocket and click "Use" command in the game. So it basically looks for ABLE/NOT ABLE values from the tm learning data of the "data structures of each pokemon", and... yeah.

What I did in DE was something very different from this. The "move tutor" checks if you have a certain pokemon in party and if so, tries to teach that a specific move. You can select which move to replace and after that, boom... The move is "magically" put into the moveset that pokemon knows with a routine that alters that pokemon's data in ram.

Offline

#3 2014-01-06 21:32:25

Chamber_
Member
Registered: 2013-12-31
Post 10/119

Re: [GSC] Move Tutor in Pokemon Gold

Ok, sounds easy, I'll try to do and comment back if I have problems.

Thank you Miksy!! n___n

Another thing, if I trying to make a tutor to teach move forgotten by level,  would be possible that the ram  upload all names in a list?

Offline

#4 2014-01-07 07:47:42

Miksy91
Member
Registered: 2010-10-16
Post 2,047/2,317

Re: [GSC] Move Tutor in Pokemon Gold

I'm not sure what you're asking, but were you planning to use Menu data -codes ? Those are designed for looking for strings from rom, but I don't see why you couldn't write those text strings in ram as well and look them from there.

This kind of a thing would be quite complicated to do, but if you want to make a move tutor that can teach you a forgotten move, you would have to;

1) Check which moves the pokemon knows at the moment
2) Based on that, copy the names of the moves (that the pokemon doesn't know already!) determined by the "move indexes" that pokemon learns from the evolution/moveset learning table, somewhere as a list (each text string + byte "50") in ram.
3) Call a different menu data code each time depending on how many text strings were brought to that list. (Count the amount of "50" bytes and depending on the amount, call menu data routine.)
4) After the player chooses which move to teach from the list, get its PP amount from "move specifics" table.
5) Do what I did. In other words, use this move (and PP value) as the parameters for a routine that replaces an existing move with that move.
6) Job well done.
7) (Implementation plan?)

Last edited by Miksy91 (2014-01-07 07:48:37)

Offline

#5 2014-01-07 20:49:16

Chamber_
Member
Registered: 2013-12-31
Post 11/119

Re: [GSC] Move Tutor in Pokemon Gold

Back to the main post, I reviewed the script of move tutor in Pokemon Crystal and the part that  teaches a move in the pokemon party makes reference to "special 0x83".

I Checked the Scripting Compendium and in GOLD&SILVER reaches only special 0x6F. What can I do?

Maybe I can copy the code routine corresponding to "special 0x83" in Crystal and move to GOLD, then to make a call to a ASM routine (code 0x0E) like in Dark Energy move tutor script? the problem is not where the routine is saved...

...Or that I can I do?

Offline

#6 2014-01-08 17:15:28

Miksy91
Member
Registered: 2010-10-16
Post 2,048/2,317

Re: [GSC] Move Tutor in Pokemon Gold

Those "special" (0F codes) call asm-routines (actually, all the commands call asm routines), so you can use 0E code instead with no problem.

Try looking for what special 0x83 does by checking the disassembly, or debug a script that uses that command in pokemon crystal.

Offline

#7 2014-01-08 17:53:09

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 157/437
Website

Re: [GSC] Move Tutor in Pokemon Gold

I remember seeing somewhere that the tutor moves compatibility in Crystal is determined by some unused bits of the TM/HM flags in the base stats data structure, so you could do the same with Gold. It really depends on the level of detail you want all this to be, but what I would personally do is something as simple as possible, like this (you'll have to 'mix' scripts with asm):
- Guy says "want me to teach x move etc."
- Check the species of the first pokemon in your party (DA2A)
- Check the pokemon's bit that determines whether it can learn the move or not (get bubasaur's address (byte) and do number of bytes of base stats data structure + number of the pokemon to arrive to the correct address). Then check the corresponding bit of the byte.
  - If the pokemon can't learn the move, return from asm and make the guy say something like "sorry but the first pokemon on your party can't learn this move").
  - If it can learn the move, check ram addresses DA2D, DA2E, DA2F, which contain the 2nd, 3rd, and 4th moves known by the first pokemon on your party. If DA2D is 0 write the move's index in that address, and, if it's not 0 do the same checks for DA2E and DA2F.
    - Otherwise, the guy should say something to warn you like, "the first (or 2nd/3rd/4th) move of your pokemon is going to be forgotten, would you like to continue"? If so, if you decided that the move you will make to be overwritten is the first one, then write the move's number in address DA2C.


Of course it would look much more professional if you used a menu where you can pick the move to forget and these things, but I personally wouldn't get into it considering my limited asm knowledge. But I'm sure for others would not be hard at all to do. Anyway, it's your take.

Offline

#8 2014-01-09 02:35:31

Chamber_
Member
Registered: 2013-12-31
Post 12/119

Re: [GSC] Move Tutor in Pokemon Gold

As Jack the Ripper says, "vamos por partes".


Indeed, as crystal_ says, the move tutor compatibility is determined by the 5th, 6th and 7th flag in the base stats data. There are still 4 bits unused (2,3,4,8th) to use for move tutors.

Checking in the disassembly, I did not find detailed information about of the use of special commands, simply collect achieved this:

Script_special: ; 0x96e26
; script command 0xf
; parameters:
;     predefined_script (MultiByteParam)

        call GetScriptByte
        ld e, a
        call GetScriptByte
        ld d, a
        callba Functionc01b
        ret


GetScriptByte: ; 0x26d4
; Return byte at ScriptBank:ScriptPos in a.

        push hl
        push bc
        ld a, [hROMBank]
        push af
        ld a, [ScriptBank]
        rst Bankswitch

        ld hl, ScriptPos
        ld c, [hl]
        inc hl
        ld b, [hl]

        ld a, [bc]

        inc bc
        ld [hl], b
        dec hl
        ld [hl], c

        ld b, a
        pop af
        rst Bankswitch
        ld a, b
        pop bc
        pop hl
        ret

I do not understand that time determines the number of events to be performed (in this case 83).

Another idea that occurred to me based on suggests of @Crystal_ , is copy the routine of the T /HM. I Use the tool of Mateo, "GSC Item Editor" but the pointer it throws me the first TM is very rare, is FE14. Try to calculate with "A-Point" but I get error. That I can do to find this routine?

Offline

#9 2014-04-14 23:12:32

Chamber_
Member
Registered: 2013-12-31
Post 29/119

Re: [GSC] Move Tutor in Pokemon Gold

I finally managed to make my Move Tutor.

Thanks to Crystal_ and  Miksy for the help provided.

My goal is to teach by tutors all moves which most of the pokemon learn:

  • Curse

  • Double Team

  • Frustration

  • Hidden Power

  • Mimic

  • Protect

  • Rest

  • Return

  • Sleep Talk

  • Substitute

  • Toxic


This first video shows the mechanism, though incomplete.

https://www.youtube.com/watch?v=8TM-rjs3YG4

This other, show the another part for by complete.

https://www.youtube.com/watch?v=U0itFperpGk

Last edited by Chamber_ (2014-04-14 23:13:39)

Offline

Board footer

Powered by FluxBB