Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-12-14 07:52:43

daMoose52
Member
Registered: 2014-11-14
Post 10/108
Website

R/B, Adding More Trainer Images

So I'm tinkering with Red/Blue and adding my trainers and...the bank for the trainer images is pretty well eaten up. And the code to load the pics is pretty specific. And I wager someone else has done this, but the forums have been a great help to me indeed and if I can help someone else with a snippet so be it ^_^

_LoadTrainerPic: ; 3f04b (f:704b)
; wd033-wd034 contain pointer to pic
    ld a, [wd033]
    ld e, a
    ld a, [wd034]
    ld d, a ; de contains pointer to trainer pic
    ld a, [W_ISLINKBATTLE]
    and a
    ld a,[W_TRAINERCLASS]
    ld b,a
    cp $30 ;LANCE + 1, though using "LANCE + 1" didn't seem to want to work for me...
    ld a, Bank(TrainerPics) ; this is where all the trainer pics are (not counting Red's)
    jr c, .loadSprite
    cp $FF ;END OF POTENTIAL ENTRIES
    ld a, Bank(NewTrainerPics)
    jr c, .loadSprite
    ld a, Bank(RedPicFront)
.loadSprite

This belongs in "engine/battle/core.asm" and just updates the _LoadTrainerPic routine. All it really is is a tweak of the original Pokemon image loading code; it was good enough there for the basic monsters, it works just as nicely here because there shouldn't be that many more trainer classes added.
Whereever you add your new trainer pics, use the tag/title "NewTrainerPics::" or change that line in my code to reflect something appropriate for yours. I made a new bank at $22 for my trainer pics~
Enjoy!!

Last edited by daMoose52 (2014-12-14 07:53:55)


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#2 2014-12-15 16:14:39

Danny-E 33
Administrator
Registered: 2012-06-09
Post 826/1,029

Re: R/B, Adding More Trainer Images

What do you mean "LANCE + 1" didn't seem to want to work?


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#3 2014-12-16 05:10:11

daMoose52
Member
Registered: 2014-11-14
Post 13/108
Website

Re: R/B, Adding More Trainer Images

Exactly that; LANCE + 1 didn't see to work for me. The raw number worked so, yay for that, but for whatever reason LANCE + 1 didn't.


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#4 2014-12-16 13:31:46

Danny-E 33
Administrator
Registered: 2012-06-09
Post 829/1,029

Re: R/B, Adding More Trainer Images

There's no reason it wouldn't work.
What error did it give you?


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#5 2014-12-16 15:11:17

daMoose52
Member
Registered: 2014-11-14
Post 16/108
Website

Re: R/B, Adding More Trainer Images

Murphey's Law of code; when asked for a bug report for code for which a work around was used, the original path will work flawlessly. Updated and it worked great.


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#6 2015-04-05 00:26:57

Jack Au Revoir
New member
From: Yogyakarta,Indonesia
Registered: 2015-04-05
Post 1/5
Website

Re: R/B, Adding More Trainer Images

Please help me! How to switch NPC trainer flag,i wanna change my player with Gary's flag sprite


Yeah! Am I great or what?

By: AF Initial

Offline

Board footer

Powered by FluxBB