ROM Hack [Release] Gen 1 Pokemon VC wild encounter DV NTR Overlay

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
Since cursor position is kept in memory when not viewing the menu, this would not hide the overlay on other screens.

This would easily work in Gen I but I still am having trouble with detecting the Pokémon Menu on Gen II.

I could do this but I feel that anyone who cares and knows about DVs enough to use this plugin would be aware of this.

If hidden power would be good to know then I can certiainly implement it for Gen II.

I'll look into it.
I appear to have interterpreted the logoc worng you convert the attack to binary 4 digets and defence to 4 digits than tank ethe last 2 of each then do the last 2 digets of attack and the last 2 digits of defense and put them together, then check that binary number and display the corresponding hidden power type

Eg 0000 = fighting so then display fighting
 
Last edited by Veund,

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
I appear to have interterpreted the logoc worng you convert the attack to binary 4 digets and defence to 4 digits than tank ethe last 2 of each then do the last 2 digets of attack and the last 2 digits of defense and put them together, then check that binary number and display the corresponding hidden power type

Eg 0000 = fighting so then display fighting
Here, I'm busy installing a washing machine today but here's something quick that should work:
Code:
char hiddenName[15] = {"fighting", "flying", "poison", "ground", "rock", "ghost", "steel", "fire", "water", "grass", "electric", "psychic", "ice", "dragon", "dark"}; /*worded equivilant of hidden power*/
   
unsigned int hidden = ((attack & 3) << 2) + (defense & 3);
                  
xsprintf(buf, hiddenName[hidden]);
OvDrawString(buf, x, y, WHITE);
 
  • Like
Reactions: Veund

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
Since cursor position is kept in memory when not viewing the menu, this would not hide the overlay on other screens.
This would easily work in Gen I but I still am having trouble with detecting the Pokémon Menu on Gen II.

I was playing around just trying random offset that are in the same area as promising knowing offsets using this list https://github.com/PikalaxALT/pokegold/blob/master/wram.asm

I found CEAF that wouldn't be enough on its own but it could be used as part of a AND detection of the menu being open. In my tests it seems to be a way to detect what level you are at in the menu

0 - Menu is closed
1 - Open at first level
2 - Open at a second level (any of them sadly)
3 - Third level (something like clicking on a Pokemon or Item)
 

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
Here, I'm busy installing a washing machine today but here's something quick that should work:
Code:
char hiddenName[15] = {"fighting", "flying", "poison", "ground", "rock", "ghost", "steel", "fire", "water", "grass", "electric", "psychic", "ice", "dragon", "dark"}; /*worded equivilant of hidden power*/
  
unsigned int hidden = ((attack & 3) << 2) + (defense & 3);
                 
xsprintf(buf, hiddenName[hidden]);
OvDrawString(buf, x, y, WHITE);

Ill give it a go when im home

--------------------- MERGED ---------------------------

So is post #33 still being updated with the new stuff?

I would assume everything not on the main is just a wip
 
  • Like
Reactions: greenDarkness555

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
@AnalogMan I think I found a offset that would work as a detection of being in the Pokemon list in Gold/Silver you should try

w2DMenuCursorInitY:: ds 1 ; ced8
3ds - 0x8a2ee3c

Being in the Pokemon list is the only way I know to make it a 1 as other menus put the cursor at a different place.

It's 0 with no menu open and other menus have values like 2 or 4 in Pokemarts or 8 healing in Pokecenter
 
Last edited by shadowofdarkness,
  • Like
Reactions: Veund

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
So is post #33 still being updated with the new stuff?
There are no new updates just yet, the only new thing is automatically opening the overlay on Gen I and I want to work out Gen II before updating any posts.

@AnalogMan I think I found a offset that would work as a detection of being in the Pokemon list in Gold/Silver you should try

w2DMenuCursorInitY:: ds 1 ; ced8
3ds - 0x8a2ee3c

Being in the Pokemon list is the only way I know to make it a 1 as other menus put the cursor at a different place.

It's 0 with no menu open and other menus have values like 2 or 4 in Pokemarts or 8 healing in Pokecenter
So it's a 1 on the Pokémon menu? Then maybe if I search for that and then use the cursor's current position to pull the stats of Pokémon 0-5 I can make the over lay appear on the party screen and update just by moving the cursor up and down. Anything similar that I can use in Gen I? It would be a lot easier to use the same system on both.
 

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
There are no new updates just yet, the only new thing is automatically opening the overlay on Gen I and I want to work out Gen II before updating any posts.

So it's a 1 on the Pokémon menu? Then maybe if I search for that and then use the cursor's current position to pull the stats of Pokémon 0-5 I can make the over lay appear on the party screen and update just by moving the cursor up and down. Anything similar that I can use in Gen I? It would be a lot easier to use the same system on both.

I'll look into it for gen 1, I also found that in Crystal it's CFA1 according to https://github.com/pret/pokecrystal/blob/master/wram.asm I just haven't tested that one.

Edit: I have looked into any gen 1 wram.asm file I could find and any other RAM maps and I couldn't find anything that even sounded close to the same idea and would be hopeful to test. If it exists no one has labelled the offset in any map yet.

Also I assume after detection is set, that forcing the party overlay on will still show the first by default. To allow fast and easy soft resets for starters.
 
Last edited by shadowofdarkness,

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
@AnalogMan when testing your hidden power code i get this odd build error where it essentially says attack variable and defense variable aren't declared where I'm putting the "hidden = ((attack & 3) << 2) + (defense & 3);" even though I'm doing this

Code:
    /* Break DV value up into individual stats and calculate HP stat */
    unsigned int speed = (dv >> 0xC) & 0xF,
                 special = (dv >> 0x8) & 0xF,
                 attack = (dv >> 0x4) & 0xF,
                 defense = dv & 0xF,
                 hp = ((attack & 0x1) << 3) + ((defense & 0x1) << 2) + ((speed & 0x1) << 1) + (special & 0x1);
                 hidden = ((attack & 3) << 2) + (defense & 3);

and i chucked the other bit at the bottom of the other bits (have yet to work out spacing properly think it needs to be under 74 not at 69)

Code:
    /* Write Special line and color code according to value and a position relative to box */
    xsprintf(buf, "%-12s %2d", "Special:", special);
    OvDrawString(buf, x+1, y+58, (special == 15) ? GREEN : (special == 0) ? RED : WHITE);
   
    /* Write Hidden Power type line and color code according to value and a position relative to box */
    xsprintf(buf, hiddenName[hidden]);
    OvDrawString(buf, x+1, y+69, WHITE);

ignore me i still get a build error but i messed up all of the above is incorrect
 
Last edited by Veund,

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
worked out the problem

Code:
char hiddenName[][15] = {"Fighting", "Flying", "Poison", "Ground", "Rock", "Ghost", "Steel", "Fire", "Water", "Grass", "Electric", "Psychic", "Ice", "Dragon", "Dark"};

    /* Write Hidden Power type line and color code according to value and a position relative to box */
    xsprintf(buf, hiddenName[hidden]);
    OvDrawString(buf, x+1, y+85, WHITE);

it needed an empty [] to work doesnt work without
 

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
@AnalogMan @shadowofdarkness I have managed to get the hidden power working, I also got a crystal sprite colour map and got hex values for them so not only does it show the hidden power type the text matches one of that Pokemon type's colour.

eg fire Pokemon are red so the text is red if hidden power is fire, green if grass.....

m0Ihtan.png


Also added an ease of use version (for those who don't know how to find the title id) the plugin is just put into the correct folders for the R/B/Y and traveler G/S/C

also typed up a quick set of instructions and changed the version number in the code to 0.8.1

Ps. i dont know how to change the size of the box
 

Attachments

  • DV_Calc_0.8.3.zip
    609.4 KB · Views: 80
Last edited by Veund,
  • Like
Reactions: eroz76

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
Good work @Veund

I also found good info for the roaming legends. We can use it to see DV's at the time of generation (initially released) then SR if needed and even make a warning system if they're in your area for capture.

For the warning system when your current map bank (DCB5)*Crystal* and map area (DCB6)*Crystal* match Raikou's or Entei's, you can meet them as a random encounter in battle.

See https://hax.iimarck.us/post/15932/ for all the relevant offsets for each roamer in RAM. The offsets with labels are for Crystal. But Gold and Silver have the first offset for each roamer listed below.

Remember only two roamers in Crystal but all three are in GS

Nice thing for confirmation I checked the offsets in Silver against the two I caught already and the data stays in RAM after capture and the DV's matched what I had caught. Then I looked at the third I hadn't caught yet and found that is going to have 10 / 11 / 14 / 1 / 14 Only one bad
 
Last edited by shadowofdarkness,
  • Like
Reactions: Veund

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
Good work @Veund

I also found good info for the roaming legends. We can use it to see DV's at the time of generation (initially released) then SR if needed and even make a warning system if they're in your area for capture.

For the warning system when your current map bank (DCB5)*Crystal* and map area (DCB6)*Crystal* match Raikou's or Entei's, you can meet them as a random encounter in battle.

See https://hax.iimarck.us/post/15932/ for all the relevant offsets for each roamer in RAM. The offsets with labels are for Crystal. But Gold and Silver have the first offset for each roamer listed below.

Remember only two roamers in Crystal but all three are in GS
woops i found a bug in the code

should be dark

vbEXrs0.png


also is that too much to display on the screen at once, i mean we can display 3 more right?
 
Last edited by Veund,

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
woops i found a bug in my code

should be dark

vbEXrs0.png

You should just have to expand the overlay boxes down.
I do feel that looks a little cluttered, Maybe make Hidden Power one line and with a extra blank line before.
Something like "HP: Fighting" Which may seem bad due to the first HP line but anyone using this is going to be smart enough to understand and figure it out from context.
 

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
You should just have to expand the overlay boxes down.
I do feel that looks a little cluttered, Maybe make Hidden Power one line and with a extra blank line before.
Something like "HP: Fighting" Which may seem bad due to the first HP line but anyone using this is going to be smart enough to understand and figure it out from context.
will fix once i work out why hp dark renders nothing
 

shadowofdarkness

Well-Known Member
OP
Member
Joined
Apr 17, 2007
Messages
536
Trophies
1
XP
2,265
Country
Canada
Ps. i dont know how to change the size of the box

The dimensions are in the following section for the wild and for each other in their section.
The 84 would be the height

if (wildOn || battle == 1) {
dvCalc(dvw, 14, 9, 92, 84);
OvDrawString("Wild Pokemon", 14+1, 9+3, WHITE);
}
 

Veund

Well-Known Member
Member
Joined
Feb 6, 2017
Messages
140
Trophies
0
Age
32
Location
australia
XP
152
Country
United States
@shadowofdarkness i have fixed the formatting of the plugin now its all looking good but there is a bug with the logic somewhere that's breaking the hidden power im getting mixed results
@AnalogMan
0000
0011 right ground (ground displayed)
0011

0001
0011 Wrong steel(fire displayed)
0111


1000
0101 right flying (flying displayed)
0001


0111
1110 wrong dragon (dark displayed)
1110

i put some debug code in and for some reason when hidden = 14 its displaying dark which is 15 so 15 isnt a hidden power type thats why i had nothing in that image is the problem because fighting is 0 and but is the first digit
 
Last edited by Veund,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: https://i.imgur.com/bG1pQld.mp4