Skip to main content

PlaceDatas

Important Reminders

An important thing to note with the terminology used in BDSP is that the term "Work", is used interchangeably throughout the ROM, however it means different things depending on where you are.

  • In Placedatas, the Work value refers to a flag (on/off value), this is prefixed in scripting by a # symbol, and there are 4000 of these in the basegame, with around 1800 of them being unused.
  • In Stopdatas, Work refers to an actual Work value, which is a variable that holds numerical data.
  • In Scripting, when we refer to a Work, we mean a Work value variable, which is prefixed in scripting with an @ symbol, there are around 440 of these in the basegame.
  • Some Work values and flags are referenced by the game as system flags/system work values, these are referenced in scripting by an $ prefix and should not be tampered with unless you know what you're doing.

What are Placedatas?

Placedatas are where you put any and all interactables that you want in your mod. Any NPC, field item, television, or legendary encounter that does absolutely anything in BDSP is a placedata object.

Placedatas are very powerful in what they allow you to express, allowing you to very simply edit the position, the size, movement or model referenced.

Unlike in NDS scripting, external areas are condensed into areas. Ie. R201 and Jubilife are all a part of Placedata_A01. The zonemap will help you with location which zones are where in the files via Ctrl+F zoneID: "your zone ID".

When editing Placedatas, you may need to leave the area and come back to get the edited changes to occur, as the game likes to cache your immediate area.

JSON Structure

Here is an example from Placedata_A01, which is a woman in T01 - Twinleaf Town, the starter town.

{
"ID": "T01_WOMAN1",
"zoneID": 422,
"TrainerID": 0,
"ObjectGraphicIndex": 135,
"ColorIndex": 0,
"Position": {
"x": 119.0,
"y": 877.0
},
"HeightLayer": 1,
"HeightIgnore": 0,
"Size": {
"x": 0.0,
"y": 0.0
},
"Rotation": 90,
"MoveLimit": {
"x": 1.0,
"y": 0.0
},
"EventType": 0,
"MoveCode": 3,
"MoveParam0": 0,
"MoveParam1": 0,
"MoveParam2": 0,
"TalkLabel": "ev_t01_woman1",
"ContactLabel": "",
"Work": 4000,
"Dowsing": 0,
"LoadFirst": 0,
"DoNotLoad": 4000,
"TalkToRange": 1.25,
"TalkToSize": {
"x": 0.0,
"y": 0.0
},
"TalkBit": 15
}

Params

ID

The unique identifier of the PlaceData. This can be referenced in Scripting for animation commands.

The ID should follow this naming scheme. It should also be capitalized.

{zone_name}_{placedata_name}

zoneID

The ID of the Zone the PlaceData should be spawned in. This is an number.

TrainerID

If you want your PlaceData object to be a "line of sight" trainer, you must provide it with a Trainer ID, which is a reference to which party you want it to have.

ObjectGraphicIndex

This is what determines what your Placedata will look like.

IndexDescription
1-121NPCs
501-505Hidden machine blockers
Assetbundle Number*Pokémon

* This is typically just DexID/00/00, the zeroes referring to formID, gender, shiny status and so forth. Example: 1510000 would be Mew. The actual value references the numbers in the name of the assetBundle for the field model found in romfs\Data\StreamingAssets\AssetAssistant\Pokemon Database\pokemons\field.

ColorIndex

The color variation that is used by the placedata. -1 matches the player's (used for mom).

Position

The X/Y position that your object will be placed at in the zone that you determined.

info

For overworld maps, 0,0 is in the top left (North West) corner of the map.

HeightLayer

The height position that your object will be placed at.

This can be lower than ground level, so if your object is not appearing/is underground, I suggest increasing this number.

info

Setting this number higher than ground level this should always set the object on the ground.

Might not work with some interactions.

HeightIgnore

This will allow you to interact with the object irrelevant of the height difference, if set to 1.

This is commonly used in-game when interacting with rock climb objects.

Size

Determines the X/Y size of the object, 1 = 1 tile.

Rotation

Determines which directional rotation your correct will stand at. 0 degrees is pointing down, 90 degrees is pointing left. See the below image for reference:

rotation_image

MoveLimit

Certain MoveCodes allow your object to "wander", this will restrict it to X/Y from the starting position.

EventType

This usually determines if something is a trainer, must be 1 if so. Otherwise, leave it at 0.

MoveCode

Determines how your object will stand/act. Up/down/left/right/moving/sitting down are all determined by this.

CodeEnum NameDescriptionMoveParam0MoveParam1MoveParam2
0MV_DMY
1MV_PLAYERStatic
2MV_DIR_RNDLook around
3MV_RNDMove around
4MV_RND_V
5MV_RND_H
6MV_RND_UL
7MV_RND_UR
8MV_RND_DL
9MV_RND_DR
10MV_RND_UDL
11MV_RND_UDR
12MV_RND_ULR
13MV_RND_DLR
14MV_UP
15MV_DOWN
16MV_LEFT
17MV_RIGHT
18MV_SPIN_L
19MV_SPIN_R
20MV_RT2
21MV_RTURLD
22MV_RTRLDU
23MV_RTDURL
24MV_RTLDUR
25MV_RTULRD
26MV_RTLRDU
27MV_RTDULR
28MV_RTRDUL
29MV_RTLUDR
30MV_RTUDRL
31MV_RTRLUD
32MV_RTDRLU
33MV_RTRUDL
34MV_RTUDLR
35MV_RTLRUD
36MV_RTDLRU
37MV_RTUL
38MV_RTDR
39MV_RTLD
40MV_RTRU
41MV_RTUR
42MV_RTDL
43MV_RTLU
44MV_RTRD
45MV_RND_UD
46MV_RND_LR
47MV_SEED
48MV_PAIR
49MV_REWAR
50MV_TR_PAIR
51MV_HIDE_SNOW
52MV_HIDE_SAND
53MV_HIDE_GRND
54MV_HIDE_KUSA
55MV_CODE_MAX

MoveParam0 MoveParam1 MoveParam2

Certain MoveCodes require this, more research required, but when using TrainerIDs, you must have a MoveCode of 14-17 and a MoveParam0 of how many tiles you want the trainer's line of sight to be.

TalkLabel

This is the function name that will be called when you interact with the object and is how you get scripts called upon interaction with an NPC.

ContactLabel

This is the function name that will be called when you walk into range of the object's TalkToRange.

Work

This is a flag and is what determines if the object is visible/invisible.

With a flag of 4000 it will always be visible.

For example, if your object has a Work of 2816 and that flag is "set" during a script with _FLAG_SET, the next time you enter that zone, the object will no longer be there.

Dowsing

Accepts values of 0-2, 1-2 if the item is intended as a hidden item, it's what determines how far away your itemfinder will pick it up.

LoadFirst

Gives a priority to the loading of objects that may exist on the same tile, or require priority loading.

DoNotLoad

Stubbed?

TalkToRange

Determines how far away you can be in order to interact with the object. 99% of the time, just leave this at 1.25

TalkToSize

Determines how far away you can be in order to interact with the object.

Talkbit

Determines which direction you can talk to an object from, best practice is to leave this at 15.