Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#576 2018-08-09 21:44:26

Rangi
Member
Registered: 2016-05-09
Post 859/908

Re: Simple Questions & Answers

LusoTrainer wrote:

My bad, completely missed it. Thanks.

One other question: how are wild areas determined in a map? Say I want to add Pokémon to a wild grass tile I just added to New Bark Town. If I add the respective table to 'johto_grass.asm', how does it link to the respective tile as opposed to the whole map (assuming that's how it works)?

CAVE and DUNGEON maps can have encounters anywhere; other maps can if engine/overworld/tile_events.asm:CheckGrassCollision returns true.

Last edited by Rangi (2018-08-09 21:44:38)

Offline

#577 2018-09-03 12:48:19

LusoTrainer
Member
Registered: 2015-05-06
Post 28/34

Re: Simple Questions & Answers

If a Pokémon has a gender ratio of 50%, doesn't it get the same gender as the NPC trainer? If so, how come Bugsy (for example) get an all male team? Is there a way to fix this?

Last edited by LusoTrainer (2018-09-03 13:32:54)

Offline

#578 2018-09-03 14:52:01

ElectroMan
New member
Registered: 2018-05-14
Post 3/5

Re: Simple Questions & Answers

LusoTrainer wrote:

If a Pokémon has a gender ratio of 50%, doesn't it get the same gender as the NPC trainer? If so, how come Bugsy (for example) get an all male team? Is there a way to fix this?

Well, 1) Bugsy is male, and 2) gender is defined by the Pokémon's DVs, more specifically its Attack DVs. And since Gym Trainers have their DVs fixed, this will all be deterministically chosen a priori. This can be altered by modifying an individual trainer's party DVs.

Offline

#579 2018-09-03 15:24:53

LusoTrainer
Member
Registered: 2015-05-06
Post 29/34

Re: Simple Questions & Answers

ElectroMan wrote:

Well, 1) Bugsy is male,

Quite right. I meant to say Janine.

ElectroMan wrote:

and 2) gender is defined by the Pokémon's DVs, more specifically its Attack DVs. And since Gym Trainers have their DVs fixed, this will all be deterministically chosen a priori. This can be altered by modifying an individual trainer's party DVs.

If I understand correctly (after taking a look at mon_stats.asm), if the Speed value is higher than the Attack value (for the Trainer's DVs), the Pokémon shows as female?

Offline

#580 2018-09-03 18:13:16

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 278/337

Re: Simple Questions & Answers

You can experiment yourself trough PkHex using a GEN II save file, you can choose a gender and set random DVs making a pokémon. :)


The italian Pokémon Green creator.

Offline

#581 2018-09-03 20:38:24

vanlach
New member
Registered: 2018-03-04
Post 5/5

Re: Simple Questions & Answers

I've got a few issues that I still haven't been able to figure out.

My first issue is that the Lake of Rage Gyarados does not show up as shiny for some reason. I haven't touched that map file at all so I'm stumped as to why this is happening. It's not a huge deal but it's not behaving correctly.

The second issue is that the Waterfall and Whirlpool HMs are behaving like regular items instead of TMs. They have the exact same attributes as the other five HMs, which work as expected, yet they are going into the wrong pocket. I'm not seeing why they are behaving like that. Unlike Gyarados, this issue is game breaking since the player can't continue without these moves.

Here's my fork. I have done a few fork updates but after skimming through, I didn't see anything that would have changed these two things.

Any ideas?

Offline

#582 2018-09-04 10:27:51

Halfshadow
Member
From: Italy - Lucca
Registered: 2012-04-24
Post 279/337

Re: Simple Questions & Answers

In G/S/C exists a script command to print a pokémon by index number like Poképic show a pokémon by number? I want to print the museum fossils, my emulator "print" a PNG file like the original prints with the Game boy printer.


The italian Pokémon Green creator.

Offline

#583 2018-09-05 16:51:47

Theohmguy
Member
Registered: 2016-07-06
Post 21/22

Re: Simple Questions & Answers

So I made a thread about that but I don't think it needs to be one. I'm going to post it here

after adding some new Mons, this happened

$ make red

constants/palette_constants.asm: no newline at end of file
constants/palette_constants.asm: no newline at end of file
constants/palette_constants.asm: no newline at end of file
constants/palette_constants.asm: no newline at end of file
constants/palette_constants.asm: no newline at end of file
constants/palette_constants.asm: no newline at end of file
rgbasm -D _RED -h -o wram_red.o wram.asm
rgblink -d -n pokered.sym -l pokered.link -o pokered.gbc audio_red.o main_red.o text_red.o wram_red.o
error: Unable to place 'Stack' (WRAM0 section) at $DF01
make: *** [Makefile:52: pokered.gbc] Error 1


it already happened before, so I changed $DF00 to $DF01 and it worked, but after some time it happened again and now I'm stuck in this error and I can't find a way to fix this.

Offline

#584 2018-09-07 00:53:02

Danny-E 33
Administrator
Registered: 2012-06-09
Post 1,112/1,149

Re: Simple Questions & Answers

Adding new Pokemon to the Pokedex causes everything to shift in wram because the size of the Pokedex flag arrays are based on NUM_POKEMON:

wPokedexOwned:: ; d2f7
    flag_array NUM_POKEMON
wPokedexOwnedEnd::

wPokedexSeen:: ; d30a
    flag_array NUM_POKEMON
wPokedexSeenEnd::

So, say both of these flag arrays increase in size by 2 bytes. That's an increase of 4 bytes total. In order to keep most things in wram at their original address, you need to subtract 4 from the size of one of the unused blocks of wram, like in between wDestinationWarpID:: and wNumSigns::
This will keep most things at their original address but will still shift everything in wram from wPokedexSeen:: through wDestinationWarpID:: (thus badly breaking compatibility with existing save files)
To truly keep everything at its original address, keep wPokedexOwned:: where it is and make its size (including some new padding after it) exactly double its original size. Then move wPokedexSeen:: to an unused block of wram. Then the only thing that changed addresses is wPokedexSeen::

Take a look here to see how I did it:
https://github.com/dannye/pokered-proto … .asm#L2341

But you'll also want to take a look around the code for references to wPokedexOwned, wPokedexSeen, and wPokedexSeenEndOld to see how code had to be modified so that save files work and have correct checksums.

wMainDataStart::

wPokedexOwned:: ; d2f7
    flag_array NUM_POKEMON
wPokedexOwnedEnd::

    flag_array 2 * 151 - NUM_POKEMON
wPokedexSeenEndOld::


...


wDestinationWarpID:: ; d42f
; if $ff, the player's coordinates are not updated when entering the map
    ds 1


wPokedexSeen::
    flag_array NUM_POKEMON
wPokedexSeenEnd::


    ds 128 - (wPokedexSeenEnd - wPokedexSeen)

wNumSigns:: ; d4b0

Note that this solution still breaks compatibility with old save files, but not fatally. The only negative side effect is that "Seen" flags will appear "wiped out". But it still runs fine.
There isn't any to keep 100% compatibility with old save files when you add Pokemon because the size of the Pokedex flag arrays has to increase.

Offline

#585 2018-10-07 15:50:44

rbroab
Member
Registered: 2017-06-13
Post 85/89

Re: Simple Questions & Answers

Few questions. Would it be possible to view the stats screen while going through starter pokemon selection instead of just seeing the pokepic window?

How could I implement a “Move” item button on a pokemon’s held item, instead of just Give and Take?

And I’ve seen a lot of romhacks feature a Run option in the Option menu where having Run On means the player will run by default and you’d press B to walk. Is there a way to make this setting disable running all together? I’d like to see the options On, Default, and Off.

Offline

#586 2018-10-16 08:31:10

Lacerta
New member
Registered: 2018-10-01
Post 4/4

Re: Simple Questions & Answers

Just one question. I attempted to put a Snorlax into a new map, using the code in Vermilion City as reference.

I ensured that everything was dandy in the outdoor sprites and in the new code itself, but ingame, the Snorlax shows up as four blue player characters instead. Otherwise, everything works as intended.

What's the best course of action?

Offline

#587 2018-10-17 15:15:03

Ketchup_Raptor
Member
Registered: 2017-04-23
Post 27/27

Re: Simple Questions & Answers

Lacerta wrote:

Just one question. I attempted to put a Snorlax into a new map, using the code in Vermilion City as reference.

I ensured that everything was dandy in the outdoor sprites and in the new code itself, but ingame, the Snorlax shows up as four blue player characters instead. Otherwise, everything works as intended.

What's the best course of action?

I haven't used pokered much as well, red is built like a house of cards ready to fall over, but I do know that in pokecrystal at least for outside maps that are connected there is a list of object sprites they must share in that mapgroup, you probably are just in one that doesn't have the snorlax sprites defined



Now for my own question, I went through Rangi's guide for the pokecrystal wiki to implement pokemon 252 and 253 and they work perfectly in battle so far, but viewing them on the stats screen causes their sprite to animate in a strange corrupted way despite the fact that their anim_idle.asm merely contains a


     frame 0, 1
     endanim

which should make it not animate anything at all yet it still animates in a corrupted way

nevermind I found that while I had included the animation I had forgotten to add the pointer for it

Last edited by Ketchup_Raptor (2018-10-17 15:22:59)

Offline

#588 2018-10-27 14:51:11

LusoTrainer
Member
Registered: 2015-05-06
Post 30/34

Re: Simple Questions & Answers

How are the movesets determined for TRAINERTYPE_NORMAL?

Offline

#589 2018-10-27 15:21:22

ElectroMan
New member
Registered: 2018-05-14
Post 4/5

Re: Simple Questions & Answers

LusoTrainer wrote:

How are the movesets determined for TRAINERTYPE_NORMAL?

The moveset is defined as the last 4 (or fewer) moves that the Pokemon has learned at the level that it's at. For example, given that Crobat's learnset through level-up is:

1 Screech
1 Leech Life
1 Supersonic
6 Supersonic
12 Bite
19 Confuse Ray
30 Wing Attack
42 Mean Look
55 Haze

At level 45 its moveset will be Bite, Confuse Ray, Wing Attack and Mean Look.

Offline

#590 2018-10-27 15:28:03

LusoTrainer
Member
Registered: 2015-05-06
Post 31/34

Re: Simple Questions & Answers

Got it. Thanks!

Offline

#591 2019-02-17 18:30:40

UberMedic7
Member
From: Greece
Registered: 2013-07-25
Post 75/77

Re: Simple Questions & Answers

I followed Rangi's guide on how to add a legendary encounter into the overworld https://hax.iimarckus.org/post/43736/#p43736 But whenever i "talk" to said pokemon the game resets into "not compatible with game pak" error. A fix is very welcome.

Here's my code

const_value set 2
    const VICTORYROAD_SILVER
    const VICTORYROAD_MOLTRES
    const VICTORYROAD_POKE_BALL1
    const VICTORYROAD_POKE_BALL2
    const VICTORYROAD_POKE_BALL3
    const VICTORYROAD_POKE_BALL4
    const VICTORYROAD_POKE_BALL5
    

.MapCallbacks:
    db 1
    callback MAPCALLBACK_OBJECTS, .Moltres

.Moltres:
    checkevent EVENT_FOUGHT_MOLTRES
    iftrue .NoAppear
    checkitem BERRY
    iftrue .Appear
    jump .NoAppear
    
    
.Appear
    appear VICTORYROAD_MOLTRES
    return
    
.NoAppear
    disappear VICTORYROAD_MOLTRES
    return


Moltres:
    faceplayer
    opentext
    writetext MoltresText
    cry MOLTRES
    pause 15
    closetext
    setevent EVENT_FOUGHT_MOLTRES
    writecode VAR_BATTLETYPE, BATTLETYPE_FORCEITEM
    loadwildmon MOLTRES, 50
    startbattle
    disappear VICTORYROAD_MOLTRES
    reloadmapafterbattle
    end

MoltresText:
    text "test"
    done

.ObjectEvents:
    db 7
    object_event 18, 13, SPRITE_SILVER, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_RIVAL_VICTORY_ROAD
    object_event 3, 26, SPRITE_MOLTRES, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, Moltres, EVENT_VICTORY_ROAD_MOLTRES
    object_event 3, 28, SPRITE_POKE_BALL, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, VictoryRoadTMEarthquake, EVENT_VICTORY_ROAD_TM_EARTHQUAKE
    object_event 12, 48, SPRITE_POKE_BALL, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, VictoryRoadMaxRevive, EVENT_VICTORY_ROAD_MAX_REVIVE
    object_event 18, 29, SPRITE_POKE_BALL, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, VictoryRoadFullRestore, EVENT_VICTORY_ROAD_FULL_RESTORE
    object_event 15, 48, SPRITE_POKE_BALL, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, VictoryRoadFullHeal, EVENT_VICTORY_ROAD_FULL_HEAL
    object_event 7, 38, SPRITE_POKE_BALL, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, VictoryRoadHPUp, EVENT_VICTORY_ROAD_HP_UP

Offline

#592 2019-02-21 22:43:29

Kora
Member
Registered: 2019-02-20
Post 2/15

Re: Simple Questions & Answers

Hi, whats means this lines at the beginning of a map.asm?

const_def 2
const EXAMPLE_EXAMPLE
const EXAMPLE2_EXAMPLE2
. . .

I can not understand what they are for, thanks so much!

Offline

#593 2019-02-22 07:57:36

Mateo
Member
Registered: 2009-11-25
Post 3,587/3,629

Re: Simple Questions & Answers

It's just giving named constants to the object event numbers. So in a script, you can applymovement to PALLET_TOWN_OAK instead of $02 for example.

Last edited by Mateo (2019-02-22 07:57:56)


I am no longer active on this forum. I only pop in from time to time.

Offline

#594 2019-02-22 09:05:27

Kora
Member
Registered: 2019-02-20
Post 3/15

Re: Simple Questions & Answers

Mateo wrote:

It's just giving named constants to the object event numbers. So in a script, you can applymovement to PALLET_TOWN_OAK instead of $02 for example.

I'm sorry, I still do not understand it. For example, in this PlayerNeighborsHouse.asm code I see that it names 2 constants but does not appear again in the rest of the code. What's the use then? Can you explain a small example of how it works?

const_def 2 ; object constants
    const PLAYERSNEIGHBORSHOUSE_COOLTRAINER_F
    const PLAYERSNEIGHBORSHOUSE_POKEFAN_F

PlayersNeighborsHouse_MapScripts:
    db 0 ; scene scripts

    db 0 ; callbacks

PlayersNeighborsDaughterScript:
    jumptextfaceplayer PlayersNeighborsDaughterText

PlayersNeighborScript:
    jumptextfaceplayer PlayersNeighborText

PlayersNeighborsHouseBookshelfScript:
    jumpstd magazinebookshelf

PlayersNeighborsHouseRadioScript:
    checkevent EVENT_GOT_A_POKEMON_FROM_ELM
    iftrue .NormalRadio
    checkevent EVENT_LISTENED_TO_INITIAL_RADIO
    iftrue .AbbreviatedRadio
    playmusic MUSIC_POKEMON_TALK
    opentext
    writetext PlayerNeighborRadioText1
    pause 45
    writetext PlayerNeighborRadioText2
    pause 45
    writetext PlayerNeighborRadioText3
    pause 45
    musicfadeout MUSIC_NEW_BARK_TOWN, 16
    writetext PlayerNeighborRadioText4
    pause 45
    closetext
    setevent EVENT_LISTENED_TO_INITIAL_RADIO
    end
.NormalRadio:
    jumpstd radio1
.AbbreviatedRadio:
    opentext
    writetext PlayerNeighborRadioText4
    pause 45
    closetext
    end

PlayersNeighborsDaughterText:
    text "PIKACHU is an"
    line "evolved #MON."

    para "I was amazed by"
    line "PROF.ELM's find-"
    cont "ings."

    para "He's so famous for"
    line "his research on"
    cont "#MON evolution."

    para "…sigh…"

    para "I wish I could be"
    line "a researcher like"
    cont "him…"
    done

PlayersNeighborText:
    text "My daughter is"
    line "adamant about"

    para "becoming PROF."
    line "ELM's assistant."

    para "She really loves"
    line "#MON!"

    para "But then, so do I!"
    done

PlayerNeighborRadioText1:
    text "PROF.OAK'S #MON"
    line "TALK! Please tune"
    cont "in next time!"
    done

PlayerNeighborRadioText2:
    text "#MON CHANNEL!"
    done

PlayerNeighborRadioText3:
    text "This is DJ MARY,"
    line "your co-host!"
    done

PlayerNeighborRadioText4:
    text "#MON!"
    line "#MON CHANNEL…"
    done

PlayersNeighborsHouse_MapEvents:
    db 0, 0 ; filler

    db 2 ; warp events
    warp_event  2,  7, NEW_BARK_TOWN, 3
    warp_event  3,  7, NEW_BARK_TOWN, 3

    db 0 ; coord events

    db 3 ; bg events
    bg_event  0,  1, BGEVENT_READ, PlayersNeighborsHouseBookshelfScript
    bg_event  1,  1, BGEVENT_READ, PlayersNeighborsHouseBookshelfScript
    bg_event  7,  1, BGEVENT_READ, PlayersNeighborsHouseRadioScript

    db 2 ; object events
    object_event  2,  3, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, PlayersNeighborsDaughterScript, -1
    object_event  5,  3, SPRITE_POKEFAN_F, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, PlayersNeighborScript, EVENT_PLAYERS_NEIGHBORS_HOUSE_NEIGHBOR

I have only 2 days learning, I appreciate any help. Thank you!

Offline

#595 2019-02-22 09:31:03

Mateo
Member
Registered: 2009-11-25
Post 3,588/3,629

Re: Simple Questions & Answers

Other maps DO use them though. It seems they are named whether they are actually used or not. But, for example, New Bark Town actually makes use of them in scripts when making the object events move in different ways.

Last edited by Mateo (2019-02-22 09:31:29)


I am no longer active on this forum. I only pop in from time to time.

Offline

#596 2019-02-22 10:06:48

Kora
Member
Registered: 2019-02-20
Post 6/15

Re: Simple Questions & Answers

Mateo wrote:

Other maps DO use them though. It seems they are named whether they are actually used or not. But, for example, New Bark Town actually makes use of them in scripts when making the object events move in different ways.

I think I understood it. In the first line define 3 constants:

const_def 2 ; object constants
const NEWBARKTOWN_TEACHER
const NEWBARKTOWN_FISHER
const NEWBARKTOWN_SILVER
. . .

That equals the 3 objects created at the end of the code:

. . . 
db 3 ; object events
object_event  6,  8, SPRITE_TEACHER, SPRITEMOVEDATA_SPINRANDOM_SLOW, 1, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, NewBarkTownTeacherScript, -1
object_event 12,  9, SPRITE_FISHER, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 1, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, NewBarkTownFisherScript, -1
object_event  3,  2, SPRITE_SILVER, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, NewBarkTownSilverScript,EVENT_RIVAL_NEW_BARK_TOWN

And in the case of wanting to apply movement to an NPC, I just have to refer to it by its constant:

. . .
NewBarkTownSilverScript:
turnobject NEWBARKTOWN_SILVER, LEFT
. . .

Is this how it works? So I always have to keep in mind that the constants and the objects created at the end of the code have the correct order, right?

Offline

#597 2019-02-22 10:09:34

Mateo
Member
Registered: 2009-11-25
Post 3,590/3,629

Re: Simple Questions & Answers

Yep, that is correct. The order of the constants needs to match the order of the events.


I am no longer active on this forum. I only pop in from time to time.

Offline

#598 2019-02-22 10:12:23

Kora
Member
Registered: 2019-02-20
Post 7/15

Re: Simple Questions & Answers

Mateo wrote:

Yep, that is correct. The order of the constants needs to match the order of the events.

Oookay, thanks so much i was so confused at the beginning :)

Offline

#599 2019-02-22 14:04:56

Kora
Member
Registered: 2019-02-20
Post 8/15

Re: Simple Questions & Answers

Another 2 questions:

What means the first line in:

const_def 2 ; object constants
const NEWBARKTOWN_TEACHER
const NEWBARKTOWN_FISHER
const NEWBARKTOWN_SILVER
. . .

Looks like the game declares 3 const (const NEWBARKTOWN_TEACHER, const NEWBARKTOWN_FISHER, const NEWBARKTOWN_SILVER  i guess?), but in other maps, const_def is 2 too but there are like 5 or 7 instead 2. I dont know what means the number 2 in "const_def 2".

How can i write correctly certain chars like : "¿, á, é, í, ó, ú" in a MSG box? The game shows another char instead.
Thanks!

Offline

#600 2019-02-22 22:00:33

Mateo
Member
Registered: 2009-11-25
Post 3,591/3,629

Re: Simple Questions & Answers

The "const_def 2" line is just saying where it begins counting from. 00 is the player, 01 is unused, and object events on the map start at 02. This is understandably confusing to work with, which is why they used named constants for the object events, so you don't have to stop and say "Ok, this is the third object in the list, now add 2 to that, then put that value in my script to apply movement to the right NPC".


As for those characters, I'm not sure offhand how to make it load the spanish/italian font instead of the english font. The english font doesn't include those characters, but a font with them does exist. They also do not seem to be in the charmap file. You could just replace the normal font with the spanish one, and then add charmap entries for the missing letters. The charmap is basically a list of aliases so that you can use text instead of tile IDs. If you compare the list and graphic file you can probably pick up on the correlation in order to see where to add new ones if you were adding a letter in a formerly-blank space in the font.


I am no longer active on this forum. I only pop in from time to time.

Offline

Board footer

Powered by FluxBB