You are not logged in.
Pages: 1
Hello, it's been a while since I've visited Skeetendo. But I've some ideas for my rom-hack, and one of them includes new trainer or trainer class. But as many of you know, I'm a complete noob in Z80-Assembler. So, I'll be very glad if someone can tell me how to add a new trainer class.
Offline
Give them a constant in constants/trainer_constants.asm
Give them some sprite objects in data/mapObjects/
Give them some party data in data/trainer_parties.asm
Give them a name string in engine/battle/save_trainer_name.asm and text/trainer_names.asm
Give them an AI in engine/battle/trainer_ai.asm
Give them a pointer to a battle pic and a base money reward in engine/battle/trainer_pic_money_pointers.asm
Include their battle pic in main.asm in bank $13
That's everything I can think of at the moment.
If there isn't enough room in bank $13 for a new pic, move all of the trainer pics to a new bank
You shouldn't have to write any z80 code to add trainer classes. Just add to existing data structures.
Offline
Give them a constant in constants/trainer_constants.asm
Give them some sprite objects in data/mapObjects/
Give them some party data in data/trainer_parties.asm
Give them a name string in engine/battle/save_trainer_name.asm and text/trainer_names.asm
Give them an AI in engine/battle/trainer_ai.asm
Give them a pointer to a battle pic and a base money reward in engine/battle/trainer_pic_money_pointers.asm
Include their battle pic in main.asm in bank $13
That's everything I can think of at the moment.
If there isn't enough room in bank $13 for a new pic, move all of the trainer pics to a new bank
You shouldn't have to write any z80 code to add trainer classes. Just add to existing data structures.
I've got a problem. I'm trying to move all trainer pics to another bank, but Cygwin shows error: rgbasm -D _RED -h -o main_red.o main.asm
D:\Program Files\Cygwin\usr\local\bin\rgbasm.exe: Section 'bank2D' is too big (old size 16383 + 2 > 16384)
make: *** [Makefile:37: main_red.o] Ошибка 1
Offline
Are you using a mod as a base?
Did you try moving the trainer pics to bank $2D?
If this is the case, I think you are using a mod that already uses bank $2D.
You need to move all of the trainer pics to a currently empty bank.
Offline
Are you using a mod as a base?
Did you try moving the trainer pics to bank $2D?If this is the case, I think you are using a mod that already uses bank $2D.
You need to move all of the trainer pics to a currently empty bank.
I am using a version where I've added a bunch of text. I will try to do it on the original Pokered.
Offline
Are you using a mod as a base?
Did you try moving the trainer pics to bank $2D?If this is the case, I think you are using a mod that already uses bank $2D.
You need to move all of the trainer pics to a currently empty bank.
That's strange. I'm trying to make the original roms and it shows error 1: $ make
rgbasm -D _RED -h -o audio_red.o audio.asm
rgbasm -D _RED -h -o main_red.o main.asm
rgbasm -D _RED -h -o text_red.o text.asm
rgbasm -D _RED -h -o wram_red.o wram.asm
rgblink -n pokered.sym -l pokered.link -o pokered.gbc audio_red.o main_red.o text_red.o wram_red.o
usage: rgblink [-t] [-m mapfile] [-n symfile] [-o outfile] [-p pad_value]
[-s symbol] file [...]
D:\Program Files\Cygwin\usr\local\bin\rgblink.exe: invalid option -- l
make: *** [Makefile:47: pokered.gbc] Ошибка 1
Offline
pokered uses rgbds 0.3.3 now. Maybe you were working on an older version of pokered before which used 0.2.5 and that's why you're getting this error trying to compile fresh pokered.
Offline
Are you using a mod as a base?
Did you try moving the trainer pics to bank $2D?If this is the case, I think you are using a mod that already uses bank $2D.
You need to move all of the trainer pics to a currently empty bank.
I've downloaded a new clean Pokered and tried to move all trainer pics to bank $2D by changing SECTION "bank13",ROMX,BANK[$13] in text.asm to SECTION "bank2d",ROMX,BANK[$2D], but Cygwin still shows an error message:
rgbasm -D _RED -h -o main_red.o main.asm
ERROR: main.asm(1313) -> engine/predefs.asm(106) -> add_predef(2):
Section 'bank2d' is too big (max size = 0x4000 bytes).
make: *** [Makefile:37: main_red.o] Ошибка 5
Offline
I didn't mean simply change "SECTION "bank13",ROMX,BANK[$13]" to "SECTION "bank2d",ROMX,BANK[$2D]"
(also I'm assuming you meant to say main.asm not text.asm right?)
The reason all that data won't fit in bank $13 is that there is a lot more in bank $13 than just the trainer sprites.
There is some map data and some engine code at the bottom of bank $13.
If you just change the bank number, then it still won't fit in that new bank.
What I mean is create an additional SECTION. Leave the map data and engine code in bank $13 and put all the trainer pics in bank $2D.
Offline
I didn't mean simply change "SECTION "bank13",ROMX,BANK[$13]" to "SECTION "bank2d",ROMX,BANK[$2D]"
(also I'm assuming you meant to say main.asm not text.asm right?)The reason all that data won't fit in bank $13 is that there is a lot more in bank $13 than just the trainer sprites.
There is some map data and some engine code at the bottom of bank $13.If you just change the bank number, then it still won't fit in that new bank.
What I mean is create an additional SECTION. Leave the map data and engine code in bank $13 and put all the trainer pics in bank $2D.
In addition to what you said to edit I edited scripts\school.asm to look like this:
SchoolScript:
call EnableAutoTextBoxDrawing
ld hl, SchoolTrainerHeader0
ld de, SchoolScriptPointers
ld a, [wSchoolCurScript]
call ExecuteCurMapScriptInTable
ld [wSchoolCurScript], a
ret
SchoolTextPointers:
dw SchoolText1
dw SchoolText2
SchoolScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
SchoolTrainerHeader0:
dbEventFlagBit EVENT_BEAT_SCHOOL_TRAINER_0
db ($0 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_SCHOOL_TRAINER_0
dw SchoolBattleText2 ; TextBeforeBattle
dw SchoolAfterBattleText2 ; TextAfterBattle
dw SchoolEndBattleText2 ; TextEndBattle
dw SchoolEndBattleText2 ; TextEndBattle
SchoolText1:
TX_FAR _SchoolText1
db "@"
SchoolText2:
TX_ASM
ld hl, SchoolTrainerHeader0
call TalkToTrainer
jp TextScriptEnd
SchoolBattleText2:
TX_FAR _SchoolBattleText2
db "@"
SchoolEndBattleText2:
TX_FAR _SchoolEndBattleText2
db "@"
SchoolAfterBattleText2:
TX_FAR _SchoolAfterBattleText2
db "@"
Then I've added this to wram.asm:
wSchoolCurScript::
ds 1
But after this the game shows battle text, starts youngster music and doesn't trigger the battle. And after that text I can re-enter the building, and the same will happen.
Last edited by Shararamosh (2018-01-30 14:19:06)
Offline
I don't see any problems with your script.
Except try adding "db $ff" after the end the trainer header. I'm not positive that will make a difference though.
Also please put your code in a [code] [/code] block.
Offline
I don't see any problems with your script.
Except try adding "db $ff" after the end the trainer header. I'm not positive that will make a difference though.
Also please put your code in a [code] [/code] block.
Sorry, it was mistake. I accidentally chose the wrong object on the map, and this occured. I've fixed it, and now I can battle her. But there's one problem: when I re-enter the building (it is school in Viridian City) I can battle with her again. Here's part of my data\mapObjects\school.asm:
object SPRITE_LASS, $4, $1, STAY, DOWN, $2, OPP_SAYORI, $1
And here's part of scripts\school.asm:
SchoolTrainerHeader0:
dbEventFlagBit EVENT_BEAT_SCHOOL_TRAINER_0, 1
db ($0 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_SCHOOL_TRAINER_0, 1
dw SchoolBattleText2 ; TextBeforeBattle
dw SchoolAfterBattleText2 ; TextAfterBattle
dw SchoolEndBattleText2 ; TextEndBattle
dw SchoolEndBattleText2 ; TextEndBattle
db $ff
My question is what does "1" after EVENT_BEAT_SCHOOL_TRAINER_0 mean and what does $2 and $1 between OPP_SAYORI mean? I think the problem is in this 2 parts of scripts.
Offline
You can take a look at the definition of the dwEventFlagAddress macro in macros/event_macros.asm and the definition of the object macro in macros/data_macros.asm to find out what each argument means
Offline
Pages: 1