Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-08-26 04:50:05

pepitopon
Member
Registered: 2016-07-25
Post 25/38

Adding items

I have problems adding new objects in a map which hadn't before.

I 've been looking for coincidences in scripts, mapheaders and MapObjects and this is what i changed:


Scripts:

UndergroundPathNSScript: ; 459ab (11:59ab)
    jp EnableAutoTextBoxDrawing

UndergroundPathNSTextPointers: ; 459ae (11:59ae)
    dw Predef5CText
    dw Predef5CText

Mapheaders:

UndergroundPathNS_h: ; 0x61f1a to 0x61f26 (12 bytes) (id=119)
    db CAVERN
    db UNDERGROUND_PATH_NS_HEIGHT, UNDERGROUND_PATH_NS_WIDTH
    dw UndergroundPathNSBlocks, UndergroundPathNSTextPointers, UndergroundPathNSScript
    db 0
    dw UndergroundPathNSObject

Mapobjects:

db $2 ; people
    db SPRITE_BALL, $3 + 4, $3 + 4, $ff, $ff, ITEM | $1, ANTIDOTE
    db SPRITE_BALL, $2 + 4, $2 + 4, $ff, $ff, ITEM | $2, POTION


The compilation runs, but in game, when i try to pick up the new item, the game shows me this:

2vt2lig.jpg

all in white and dont pick up the item...

What else do I need to do?

Offline

#2 2016-08-26 21:31:39

Danny-E 33
Administrator
Registered: 2012-06-09
Post 980/1,022

Re: Adding items

You need to add new items as "hide/show" objects. You do this by adding a constant for the new item in constants/hide_show_constants.asm and by adding the entry to data/hide_show_data.asm, which associates the hide/show constant ID with the sprite ID of the object on the map.
Note that the order of hide/show objects in data/hide_show_data.asm must match the order of the constant IDs.

This should fix both of your errors.

The sprite isn't disappearing of course because it isn't a hide/show object.
And the text doesn't appear/the item doesn't end up in your bag because the PickUpItem routine aborts if no matching hide/show object was found with the corresponding sprite ID with the sprite you interacted with.


Red Hack: Pokémon Prototype

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

Offline

#3 2016-08-26 23:03:23

pepitopon
Member
Registered: 2016-07-25
Post 26/38

Re: Adding items

Danny-E 33 wrote:

You need to add new items as "hide/show" objects. You do this by adding a constant for the new item in constants/hide_show_constants.asm and by adding the entry to data/hide_show_data.asm, which associates the hide/show constant ID with the sprite ID of the object on the map.
Note that the order of hide/show objects in data/hide_show_data.asm must match the order of the constant IDs.

This should fix both of your errors.

The sprite isn't disappearing of course because it isn't a hide/show object.
And the text doesn't appear/the item doesn't end up in your bag because the PickUpItem routine aborts if no matching hide/show object was found with the corresponding sprite ID with the sprite you interacted with.



YES!!! I did it!

Very good explanation :D


THANK YOU!!!

Offline

Board footer

Powered by FluxBB