Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → Added more trainers to fighting dojo, they work but they don't see me!

#1 2015-03-18 14:40:31

~Red
Member
Registered: 2010-10-16
Post 230/276

Added more trainers to fighting dojo, they work but they don't see me!

Added 3 new trainers to a map and they work fine (had to put a new flag in RAM for the trainer byte). However, they don't "see" me, when you walk in front of them nothing happens, you gotta talk to them to initiate the battle! What am I doing wrong?

Offline

#2 2015-03-18 14:47:08

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,011/3,492

Re: Added more trainers to fighting dojo, they work but they don't see me!

I know this is probably a dumb question, but dud you give them a sight range?

Offline

#3 2015-03-18 17:33:15

~Red
Member
Registered: 2010-10-16
Post 231/276

Re: Added more trainers to fighting dojo, they work but they don't see me!

Mateo wrote:

I know this is probably a dumb question, but dud you give them a sight range?

Yes.

Offline

#4 2015-03-18 19:14:47

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,012/3,492

Re: Added more trainers to fighting dojo, they work but they don't see me!

Ok, just checking. The other thing that came to mind is the time I was setting up two trainers on the map to use the same flag to mark them as beaten (intentionally. It was a young couple). And I remember the one that came first in the event list would see me and the next one would work fine except they wouldn't see me.

Offline

#5 2015-03-18 21:07:06

Danny-E 33
Administrator
Registered: 2012-06-09
Post 867/1,026

Re: Added more trainers to fighting dojo, they work but they don't see me!

I'm not at my main computer to experiment with this, but you should try with a new save file and see if they still don't see you.


Red Hack: Pokémon Prototype

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

Offline

#6 2015-03-19 02:02:48

Tauwasser
Member
Registered: 2010-10-16
Post 433/448

Re: Added more trainers to fighting dojo, they work but they don't see me!

Make sure you set the people event's function byte to Trainer. If you don't, the range you set doesn't matter.

cYa,

Tauwasser

Offline

#7 2015-03-20 04:15:21

~Red
Member
Registered: 2010-10-16
Post 232/276

Re: Added more trainers to fighting dojo, they work but they don't see me!

Tauwasser wrote:

Make sure you set the people event's function byte to Trainer. If you don't, the range you set doesn't matter.

cYa,

Tauwasser

In laymen's terms please, I'm a nub!

Here is the code for the objects (incomplete, need to add all the trainer classes, this will be a special GYM stylised as a local bar me and my friends go to and all the trainers in it are my friends):

FightingDojoObject: ; 0x5cf9b (size=72)
    db $3 ; border block

    db $2 ; warps
    db $f, $e, $1, $ff
    db $f, $f, $1, $ff

    db $1 ; signs
    db $c, $f, $c

    db $b ; people
    db SPRITE_KARMA, $3 + 4, $5 + 4, $ff, $d0, TRAINER | $1, KARMA + $C8, $1 ;bhjk
    db SPRITE_DAISY, $4 + 4, $3 + 4, $ff, $d3, TRAINER | $2, EMMA + $C8, $1 ;emma
    db SPRITE_BLACK_HAIR_BOY_1, $8 + 4, $4 + 4, $ff, $d3, TRAINER | $3, CHRIS + $C8, $1 ;chris
    db SPRITE_BLACKBELT, $5 + 4, $6 + 4, $ff, $d2, TRAINER | $4, LEE + $C8, $1 ;lee
    db SPRITE_BUG_CATCHER, $7 + 4, $6 + 4, $ff, $d2, TRAINER | $5, FINN + $C8, $1 ;finn
    db SPRITE_BLACK_HAIR_BOY_2, $b + 4, $3 + 4, $ff, $d3, TRAINER | $6, GEORGE + $C8, $1 ;george
    db SPRITE_BUG_CATCHER, $10 + 4, $9 + 4, $ff, $d2, TRAINER | $7, BLACKBELT + $C8, $3 ;mike
    db SPRITE_BLACK_HAIR_BOY_1, $d + 4, $a + 4, $ff, $d0, TRAINER | $8, BLACKBELT + $C8, $2 ;ben
    db SPRITE_BALL, $1 + 4, $4 + 4, $ff, $ff, $9 ; person
    db SPRITE_BALL, $1 + 4, $5 + 4, $ff, $ff, $a ; person
    db SPRITE_GIRL, $b + 4, $f + 4, $ff, $d0, $b ; person

    ; warp-to
    EVENT_DISP FIGHTING_DOJO_WIDTH, $f, $e
    EVENT_DISP FIGHTING_DOJO_WIDTH, $f, $f

It seems to only be the last 3 trainers which do not walk to the trainer, but when spoken to work fine.


EDIT: This could probably take a look too but I don't think there is anything wrong here either:

FightingDojoTrainerHeaders: ; 5ce13 (17:4e13)
FightingDojoTrainerHeader0: ; 5ce13 (17:4e13)
    db $2 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wd7b1 ; flag's byte
    dw FightingDojoBattleText1 ; 0x4eac TextBeforeBattle
    dw FightingDojoAfterBattleText1 ; 0x4eb6 TextAfterBattle
    dw FightingDojoEndBattleText1 ; 0x4eb1 TextEndBattle
    dw FightingDojoEndBattleText1 ; 0x4eb1 TextEndBattle

FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f)
    db $3 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wd7b1 ; flag's byte
    dw FightingDojoBattleText2 ; 0x4ec5 TextBeforeBattle
    dw FightingDojoAfterBattleText2 ; 0x4ecf TextAfterBattle
    dw FightingDojoEndBattleText2 ; 0x4eca TextEndBattle
    dw FightingDojoEndBattleText2 ; 0x4eca TextEndBattle

FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b)
    db $4 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wd7b1 ; flag's byte
    dw FightingDojoBattleText3 ; 0x4ede TextBeforeBattle
    dw FightingDojoAfterBattleText3 ; 0x4ee8 TextAfterBattle
    dw FightingDojoEndBattleText3 ; 0x4ee3 TextEndBattle
    dw FightingDojoEndBattleText3 ; 0x4ee3 TextEndBattle

FightingDojoTrainerHeader3: ; 5ce37 (17:4e37)
    db $5 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wd7b1 ; flag's byte
    dw FightingDojoBattleText4 ; 0x4ef7 TextBeforeBattle
    dw FightingDojoAfterBattleText4 ; 0x4f01 TextAfterBattle
    dw FightingDojoEndBattleText4 ; 0x4efc TextEndBattle
    dw FightingDojoEndBattleText4 ; 0x4efc TextEndBattle
    
FightingDojoTrainerHeader4: ; 5ce37 (17:4e37)
    db $1 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wFIGHTINGDOJO_2 ; flag's byte
    dw FightingDojoBattleText5 ; 0x4ef7 TextBeforeBattle
    dw FightingDojoAfterBattleText5 ; 0x4f01 TextAfterBattle
    dw FightingDojoEndBattleText5 ; 0x4efc TextEndBattle
    dw FightingDojoEndBattleText5 ; 0x4efc TextEndBattle
    
FightingDojoTrainerHeader5: ; 5ce37 (17:4e37)
    db $2 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wFIGHTINGDOJO_2 ; flag's byte
    dw FightingDojoBattleText6 ; 0x4ef7 TextBeforeBattle
    dw FightingDojoAfterBattleText6 ; 0x4f01 TextAfterBattle
    dw FightingDojoEndBattleText6 ; 0x4efc TextEndBattle
    dw FightingDojoEndBattleText6 ; 0x4efc TextEndBattle
    
FightingDojoTrainerHeader6: ; 5ce37 (17:4e37)
    db $3 ; flag's bit
    db ($4 << 4) ; trainer's view range
    dw wFIGHTINGDOJO_2 ; flag's byte
    dw FightingDojoBattleText7 ; 0x4ef7 TextBeforeBattle
    dw FightingDojoAfterBattleText7 ; 0x4f01 TextAfterBattle
    dw FightingDojoEndBattleText7 ; 0x4efc TextEndBattle
    dw FightingDojoEndBattleText7 ; 0x4efc TextEndBattle

    db $ff

Last edited by ~Red (2015-03-20 04:19:33)

Offline

#8 2015-03-20 05:55:49

ShantyTown
Member
Registered: 2013-12-04
Post 220/344

Re: Added more trainers to fighting dojo, they work but they don't see me!

Aha!  I think I've had this exact problem before!

If I remember correctly, the order of the text id for the people actually matters.  I think they need to go in increasing order.  So the first person's text id should be $d0, then $d1, etc.  Currently, your text ids aren't even unique for each person, which might be a bad thing.  Anyway, make them unique and increasing by one each time, and then tell us if that fixes it.

Offline

#9 2015-03-20 09:14:56

~Red
Member
Registered: 2010-10-16
Post 235/276

Re: Added more trainers to fighting dojo, they work but they don't see me!

ShantyTown wrote:

Aha!  I think I've had this exact problem before!

If I remember correctly, the order of the text id for the people actually matters.  I think they need to go in increasing order.  So the first person's text id should be $d0, then $d1, etc.  Currently, your text ids aren't even unique for each person, which might be a bad thing.  Anyway, make them unique and increasing by one each time, and then tell us if that fixes it.

But in the original dojo script this isn't the case, as trainer 0 is the leader of the dojo. If you take a look at the dojo script in the dissassembly I havent edited those numbers. (Unless you're confused by the fact I just copied and pasted it and edited it, so the comments point to the wrong addresses, the text ids are all different though).

EDIT: Oh my god, really!? I just played through the entire game again and it works perfectly! Was worth it though, noticed some glitches which I fixed on the way through due to shifting data around (adding new external maps to be recognised by town map caused all map ids to shift by 1 up untill the trashed house duplicate which I just deleted, this caused some oddities with the hide_show objects lmao).

Last edited by ~Red (2015-03-20 09:47:52)

Offline

#10 2015-03-20 14:45:31

ShantyTown
Member
Registered: 2013-12-04
Post 221/344

Re: Added more trainers to fighting dojo, they work but they don't see me!

Haha glad you've "fixed" it.  I apologize.  I was looking at the second byte of the movement bytes.  I'm not used to looking at the disassembly with the "TRAINER | textId" format.

Offline

#11 2015-03-20 17:16:45

~Red
Member
Registered: 2010-10-16
Post 236/276

Re: Added more trainers to fighting dojo, they work but they don't see me!

It's fine bro, you're all being so helpful and I'm learning sooo much everyday doing this little project!

Offline

#12 2015-03-20 17:17:45

~Red
Member
Registered: 2010-10-16
Post 237/276

Re: Added more trainers to fighting dojo, they work but they don't see me!

Well...I say "little" I have some crazy plans for the storyline towards the end which will make it different from any other Pokemon game yet ;)

Offline

#13 2017-01-15 09:31:37

Wild
Member
From: Blighty
Registered: 2016-12-30
Post 5/12

Re: Added more trainers to fighting dojo, they work but they don't see me!

Apologies for digging up this old thread, but I'm currently having a similar issue with added trainers not seeing you when you walk past. Talking to the trainer will still initiate a battle. This is also coupled by a failure for flags to set for trainers that were already there before, resulting in an infinite battle loop! Commenting out the lines of code that added the new trainer fix this problem.

In short, I tried to move Bug Catcher $4 to Viridian Forest from Route 3, bringing the total number of trainers on the map from 3 to 4.

On the surface, everything looks right, with text ids following a linear order as Shanty Town suggested earlier:

db $9 ; objects
    object SPRITE_BUG_CATCHER, 26, 17, STAY, NONE, $1 ; person
    object SPRITE_BUG_CATCHER, 50, 8, STAY, LEFT, $2, OPP_BUG_CATCHER, $1
    object SPRITE_BUG_CATCHER, 6, 20, STAY, DOWN, $3, OPP_BUG_CATCHER, $2
    object SPRITE_BUG_CATCHER, 35, 5, STAY, DOWN, $4, OPP_BUG_CATCHER, $3
    object SPRITE_BUG_CATCHER, 47, 5, STAY, RIGHT, $5, OPP_BUG_CATCHER, $4
    object SPRITE_BALL, 10, 17, STAY, NONE, $6, POTION
    object SPRITE_BALL, 30, 11, STAY, NONE, $7, POKE_BALL
    object SPRITE_BALL, 41, 24, STAY, NONE, $8, ANTIDOTE
    object SPRITE_BUG_CATCHER, 10, 5, STAY, NONE, $9 ; person

For the Trainer Header, it is a direct copy paste from Route 3's script, with everything referenced so should be fine:

ViridianForestTrainerHeader3:
    dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_0
    db ($4 << 4) ; trainer's view range
    dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_0
    dw ViridianForestBattleText4 ; TextBeforeBattle
    dw ViridianForestAfterBattleText4 ; TextAfterBattle
    dw ViridianForestEndBattleText4 ; TextEndBattle
    dw ViridianForestEndBattleText4 ; TextEndBattle

    db $ff

I have played through the game with a new save file and the problem persists. It got me wondering if there is somewhere else that dictates the maximum number of trainers per map or something? I have searched around pretty extensively within the disassembly and haven't found a solution to the problem. Anybody else had experience with these issues since the original posting of this thread?

Cheers!

Last edited by Wild (2017-01-15 09:34:12)

Offline

#14 2017-01-15 10:01:09

Wild
Member
From: Blighty
Registered: 2016-12-30
Post 6/12

Re: Added more trainers to fighting dojo, they work but they don't see me!

Well, I just resolved the issue! Turns out that I needed to change the trainer header to use a new flag directly after the other trainer flags for that map.

Do all events, or at least trainers, in a given map have to call flags that are close to each other?  Although having said that the two in question were only $30 apart...

Last edited by Wild (2017-01-15 10:06:58)

Offline

  • Index
  • → Help/Question
  • → Added more trainers to fighting dojo, they work but they don't see me!

Board footer

Powered by FluxBB