You are not logged in.
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~
Last edited by daMoose52 (2014-12-14 07:53:55)
What do you mean "LANCE + 1" didn't seem to want to work?
There's no reason it wouldn't work.
What error did it give you?
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.