Advertiser Content

Development Day/Night Switching of Wild Pokémon Page 3

Started by Jambo51 December 2nd, 2010 2:58 PM
  • 24445 views
  • 70 replies
Male
Seen November 14th, 2014
Posted February 9th, 2014
8 posts
9.6 Years
Hey,

I used the routine for my german emerald rom.
I works. The wild Pokémon change during night but sometimes the game freezes when the player walks through the grass (day and night time).
I have no idea why. I only changed the offsets in the routine to make it fit. I'm sure that they are correct because I found them by searching the bytes from the englisch version in the german version.
Can anyone help me please?

Furthermore I can say with the help of the disassembler of the VBA that the code loops endless between that part:

.check:
ldrb r3, [r1, #0x3]
cmp r3, #0xFF
beq .nodata
cmp r3, #0x8
bne .nextnormal
ldr r0, [r1, #0x0]

Maybe your code has a bug.
I don't know if it works perfectly for other ones in emerald?

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 20
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,473 posts
6.7 Years
Hi, I wanted to know if I can use it on a French ROM, or if i can't, did you know how I can make it ?


( Sorry if I do not write correctly English, I'm French, and I just learnd English on School =X )


PS: It's really a good job, hope its work on French ROM
To do it, you'd need to find the offsets in the French version then change them in the routine.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
France
Seen June 4th, 2014
Posted April 15th, 2014
22 posts
6 Years
Hi, I wanted to know if I can use it on a French ROM, or if i can't, did you know how I can make it ?


( Sorry if I do not write correctly English, I'm French, and I just learnd English on School =X )
You're everywhere decidedly ^^ !
Otherwise, as I told you that I will look for French Version.

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen March 10th, 2018
Posted April 17th, 2017
700 posts
10.2 Years
You're everywhere decidedly ^^ !
Otherwise, as I told you that I will look for French Version.
Just as a rule of thumb in the hacking scene we prefer to work with one version to make things easier offset-wise, so if you're going to be doing a lot of ASM additions, small patches to the ROM at specific offsets, and maybe even graphics hacking it's generally best to work with the standard ROM, or in this case BPRE v1.0. You'll find a lot more support there, especially once I roll out built-in Day/Night pokemon into MEH.

esperance

Age 22
Male
Ohio
Seen 2 Weeks Ago
Posted 4 Weeks Ago
3,827 posts
9.3 Years
if i try to use this with prime-dialga's DNS, what offsets would be replaced in the ASM code given?
The only offsets that will change are the RAM offsets for the time, I believe.
What are you so afraid of?

hackiosa

Molten Cheese

Male
Germany
Seen January 30th, 2018
Posted November 17th, 2016
29 posts
10.4 Years
http://board.romresources.net/board6-romhacking/board19-romhacking-tools/13652-beta-pok%C3%A9dan-enter-the-nightmare/

Hi here you can find a tool / asm routine that is able to do the job with prime-dialgas DNS ;)
My tools:
NanoboyAdvance GBA emulator - http://www.pokecommunity.com/showthread.php?p=9356015

esperance

Age 22
Male
Ohio
Seen 2 Weeks Ago
Posted 4 Weeks Ago
3,827 posts
9.3 Years
thanks for answering me! :D

you mean this: "...hour: .word 0x03005542..."

using prime's DNS, thats the ram offset for the time... or am i into something else with this?
Yeah, that is what I meant. Just change that to the appropriate RAM offset and it should work.
What are you so afraid of?

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
4.9 Years
Alrighty! I've finally finished DN Pokemon Data Editor! The download is in an attachment as a zip file. Keep in mind this is only in it's early versions, and may have a bug in it. If you find a bug, contact me by way of PM.
How to use it?
I always got an error in my ADVMAP when I use it

Here are the screenies:

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen March 10th, 2018
Posted April 17th, 2017
700 posts
10.2 Years
How to use it?
I always got an error in my ADVMAP when I use it

Here are the screenies:

That's because it modifies how the data is actually read, making it incompatible with A-Map after you convert it to the new D/N format. Currently MEH has support for D/N pokemon editing although it's a tiny bit buggy so be aware of that.

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
4.9 Years
That's because it modifies how the data is actually read, making it incompatible with A-Map after you convert it to the new D/N format. Currently MEH has support for D/N pokemon editing although it's a tiny bit buggy so be aware of that.
Yah, a bit buggy ^_^
Tried it in 7 times but when I load the rom in v-boy, it results in whitescreen,
I also tried to fire a clean rom, and as I expect, it loads smoothly....

Any tutorials on how to use it in a safest way?

Froosty

The_Learner

Age 21
Male
Somewhere in this world.
Seen 3 Weeks Ago
Posted May 26th, 2018
543 posts
4.8 Years
I want to one thing pls...
which map takes this data for day night shift... and hiw do i set all the maps with pokemon encounter to have day night shift.... do i write asm that much time pr simply edit map header or write a script which act on entering a map???
Male
Seen 1 Week Ago
Posted 2 Weeks Ago
208 posts
2.5 Years
I would ideally like to redevelop these routines to use the new system Prime has developed as it would be more efficient.
Yes please!!!
Now that would be a very very good deed!
(Ofc besides your other good deeds xD)...
Male
Seen 1 Week Ago
Posted 2 Weeks Ago
208 posts
2.5 Years
Has anyone been able to get this working for Fire Red? I know it says its been extensively tested, but I just can't seem to get it to work. Even though I've inserted all of the routines properly (I know this because the game doesn't crash), the game still only loads the daytime data.
Well, if you just want it to get to work,
U can use MEH to enable this feature...
But then you can not use any other map editor for wild pokemon tab.
These routines by jambo are said to be done for old dns tool, but the ram used is same.. i checked.. dunno why there is a note to change corresponding offsets if it uses same ram adds...
Via MEH, shinyquagsire only puts 2 routine (check in src folder of MEH)... and that missing routines are the one for different encounter rates..
MEH can be downloaded from the site HackRomTools
:)

Skeli-

Lord of the Rings

Age 20
Male
Canada
Seen 5 Hours Ago
Posted 1 Week Ago
213 posts
5.3 Years
Has anyone been able to get this working for Fire Red? I know it says its been extensively tested, but I just can't seem to get it to work. Even though I've inserted all of the routines properly (I know this because the game doesn't crash), the game still only loads the daytime data.
I rewrote the Pokemon loading routine so it would work for day and night switching, as well as swarms.
Spoiler:
.text
.text
.align 2
.thumb
.thumb_func
.global daynightwildswitch

@r7 is wild pokemon data for that map

Main:
	add r0, r7, #0x4
	push {r0}
	ldr r0, var_4fff
	bl var_decrypt
	ldrh r0, [r0]
	cmp r0, #0x1
	bge Swarm
	pop {r0}
	push {r2}
Daynight: 
	ldr r2, hour
	ldrb r2, [r2]
	cmp r2, #0x14 /*8PM - Change it if you want*/
	bge night
	cmp r2, #0x11 /*5PM - Change it if you want*/
	bge evening
	cmp r2, #0xA /*10AM - Change it if you want*/
	bge day
	cmp r2, #0x4 /*4AM - Change it if you want*/
	bge morning
night: 
	add r2, r0, #0x4
	b check
evening: 
	mov r2, r0
        @add r2, #0x8 @remove comment if you want evening based Pokemon
	b check
morning: 
	mov r2, r0
        @add r2, #0xC @remove comment if you want morning based Pokemon
	b check
day: 
	mov r2, r0
check:
	ldrb r1, [r2, #0x3]
	cmp r1, #0x8
	bne nodata
	ldr r0, [r2]
nextnormal: 
	add r0, r4
	ldrh r0, [r0, #0x2]
back: 
	ldr r1, lastpokemon
	strh r0, [r1]
	mov r1, r5
	pop {r2}
	ldr r3, .Return
	bx r3

Swarm: 
	ldr r1, currentmap
	ldrb r1, [r1] @r1=current map name
	cmp r1, r0
	pop {r0}
	bne daynightone
	ldr r0, var_4ffe
	bl var_decrypt
	ldrh r0, [r0]
	b back

var_decrypt: 
	ldr r1, vardecrypt
	bx r1

daynightone: 
	ldr r0, [r7, #0x4]
	push {r0}
	b Daynight

nodata: 
	sub r2, r0
	cmp r2, #0xC
	beq night
	b day

.align 2
.Return: .word 0x08082b51
lastpokemon: .word 0x0300555C
hour: .word 0x03005542
vardecrypt: .word 0x0806E455
var_4fff: .word 0x00004FFF @Replace this with whatever variable you would like to use
var_4ffe: .word 0x00004FFE  @Replace this with whatever variable you would like to use
currentmap: .word 0x03005558


To set a swarm, set var_4fff to your map name id, and var_4ffe to your Pokemon species.
Pokemon Unbound

Petuuuhhh

Male
Georgia
Seen 3 Hours Ago
Posted 8 Hours Ago
625 posts
2.2 Years
Hi,

I'm trying to get this to work. When I test my map during the day, no wild spawns appear. This is what I put after my pointer to the original daytime wild pokemon encounter data: http://prntscr.com/l3ayd2

Update: I tried Skeli's Routine as well. I didn't get it to work. No wild spawns appeared. This is all I could capture of what the code looks like with Skeli's routine: http://prntscr.com/l3b4x9 (I just realized I forgot to set swarm values, but that shouldn't affect the wild Pokemon spawns during the day)
Advertiser Content