Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Edit Door & Key IDs (Manual): Difference between revisions

From LMHack
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


== Tutorial ==
== Tutorial ==
[[File:Image 2024-07-03 182711204.png|thumb]]
In this tutorial, we will learn how to manually edit door entries.
In this tutorial, we will learn how to edit door entries.
   
   
All of the door entries are in start.dol and start at offset 0x002FFF84 in the NTSC-U / US version, and offset 0x003050A4 in the PAL / European version.
All of the door entries are in start.dol and start at offset 0x002FFF80 in the NTSC-U / US version, and offset 0x003050A0 in the PAL / European version.
 
Each door entry itself is 28 bytes long. [[Door List#Door Information|The exact breakdown of the an entry's layout can be found here.]]
 
 
=== Breakdown ===
As an example, I'll use the entry starting at offset 0x2FFFB8 (Which corresponds to the Spade door connects section C of the basement hallway to the Secret Altar) in order to break down how it's laid out. Here's the first entry in full:
 
<pre>01 00 00 00 00 48 0E 00 00 00 08 FC FF FF FE 70 FF FF EA AC 00 C8 01 2C 00 00 47 49</pre>
 
 
And here's the breakdown of each section:
 
{| class="wikitable"
! Field Name !! Description !! Value (Hex) !! Value (Decimal) !! Outcome
|-
| Orientation
| 1 = front-facing, 2 = side-facing. 0 marks the end of the door list.
| 01
| 1
| Since the value is 1, the door is front-facing.
|-
| Type
| 0 = door, 1 = viewport, 2 = window.
| 00
| 0
| Since the value is 0, it renders as a door.
|-
! Padding
! Two bytes of padding.
! colspan="2" | This value is intentionally empty.
! N / A
|-
| JMP Door Number
| This is the door number referenced in ''iteminfotable, objinfo, keyinfo,'' etc.
| 00 48
| 72
| N / A
|-
| Model ID
| [[Door Models]]
| 0E
| 14
| Since the value is 14, it uses the Spade door model.
|-
| Door Index
| The number of the door in the door list. This is used primarily in the [[Door Loading List]].
| 00
| 0
| This door's index is 0, so it's the first door to be loaded.
|-
| X Position
| Permanent X spawn coordinates for the door or viewport.
| 00 00 08 FC
| 2300
| The X coordinate is 2300, so it'll be placed there. Pretty self-explanatory.
|-
| Y Position
| Permanent Y spawn coordinates for the door or viewport. -400 = Basement, 150 = Floor 1, 700 = Floor 2, and 1250 = Floor 3.
| FF FF FE 70
| -400
| Since the Y position equals -400, that means this door is in the basement.
|-
| Z Position
| Permanent Z spawn coordinates for the door or viewport.
| FF FF EA AC
| -5460
| It's the Z position!
|-
| Viewport X Size
| X size for the viewport drawn by a door or a normal viewport. Forward facing doors need a size of 200. Sideways facing doors need no X size.
| 00 C8
| 200
| The value is 200, which is correct for a forward-facing door.
|-
| Viewport Y Size
| Y size for the viewport drawn by a door or a normal viewport. All doors use a size of 300.
| 01 2C
| 300
| All doors use size 300, as stated above.
|-
| Viewport Z Size
| Z size for the viewport drawn by a door or a normal viewport. Forward facing doors need no Z size. Sideways facing doors need a size of 200.
| 00 00
| 0
| Since this is forward-facing door, the value is 0.
|-
| Next Room Index
| rowspan="2" | For forward facing doors, ''next'' ''room index'' refers to the room to the '''south''' of the door. For sideways facing doors, ''next'' ''room index'' refers to the room to the '''west''' of the door. Refer to the [[Door Loading List]] for ''room index'' numbers.
| 47
| 71
| Room 71 is section C of the basement hallway (going to Secret Altar).
|-
| Current Room Index
| 49
| 73
| Room 73 is the Secret Altar.
|}
 
 
=== Conclusion ===
Based off of that breakdown, simply modify whichever values you please in order to get the results you desire.
 


The image seen to the right should be how that area of the dol generally looks.
Each value highlighted with yellow corresponds to a door model found in the folder '''game\game_X.szp\iwamoto\door\'''. [[Door Models|A list of door models can be found here.]]
Each value highlighted with cyan corresponds to a Key ID for each door, which can be declared in treasuretable and keyinfo in ''game\map2.szp\jmp''
(NOTE: The door frames are not a part of the doors' model themselves, they're a part of the rooms model. Therefore, if you'd like to add a door frame, you will have to modify the room's model.)
(NOTE: The door frames are not a part of the doors' model themselves, they're a part of the rooms model. Therefore, if you'd like to add a door frame, you will have to modify the room's model.)



Latest revision as of 16:18, 9 October 2024

Original Author(s)

weirdboo


Tutorial

In this tutorial, we will learn how to manually edit door entries.

All of the door entries are in start.dol and start at offset 0x002FFF80 in the NTSC-U / US version, and offset 0x003050A0 in the PAL / European version.

Each door entry itself is 28 bytes long. The exact breakdown of the an entry's layout can be found here.


Breakdown

As an example, I'll use the entry starting at offset 0x2FFFB8 (Which corresponds to the Spade door connects section C of the basement hallway to the Secret Altar) in order to break down how it's laid out. Here's the first entry in full:

01 00 00 00 00 48 0E 00 00 00 08 FC FF FF FE 70 FF FF EA AC 00 C8 01 2C 00 00 47 49


And here's the breakdown of each section:

Field Name Description Value (Hex) Value (Decimal) Outcome
Orientation 1 = front-facing, 2 = side-facing. 0 marks the end of the door list. 01 1 Since the value is 1, the door is front-facing.
Type 0 = door, 1 = viewport, 2 = window. 00 0 Since the value is 0, it renders as a door.
Padding Two bytes of padding. This value is intentionally empty. N / A
JMP Door Number This is the door number referenced in iteminfotable, objinfo, keyinfo, etc. 00 48 72 N / A
Model ID Door Models 0E 14 Since the value is 14, it uses the Spade door model.
Door Index The number of the door in the door list. This is used primarily in the Door Loading List. 00 0 This door's index is 0, so it's the first door to be loaded.
X Position Permanent X spawn coordinates for the door or viewport. 00 00 08 FC 2300 The X coordinate is 2300, so it'll be placed there. Pretty self-explanatory.
Y Position Permanent Y spawn coordinates for the door or viewport. -400 = Basement, 150 = Floor 1, 700 = Floor 2, and 1250 = Floor 3. FF FF FE 70 -400 Since the Y position equals -400, that means this door is in the basement.
Z Position Permanent Z spawn coordinates for the door or viewport. FF FF EA AC -5460 It's the Z position!
Viewport X Size X size for the viewport drawn by a door or a normal viewport. Forward facing doors need a size of 200. Sideways facing doors need no X size. 00 C8 200 The value is 200, which is correct for a forward-facing door.
Viewport Y Size Y size for the viewport drawn by a door or a normal viewport. All doors use a size of 300. 01 2C 300 All doors use size 300, as stated above.
Viewport Z Size Z size for the viewport drawn by a door or a normal viewport. Forward facing doors need no Z size. Sideways facing doors need a size of 200. 00 00 0 Since this is forward-facing door, the value is 0.
Next Room Index For forward facing doors, next room index refers to the room to the south of the door. For sideways facing doors, next room index refers to the room to the west of the door. Refer to the Door Loading List for room index numbers. 47 71 Room 71 is section C of the basement hallway (going to Secret Altar).
Current Room Index 49 73 Room 73 is the Secret Altar.


Conclusion

Based off of that breakdown, simply modify whichever values you please in order to get the results you desire.


(NOTE: The door frames are not a part of the doors' model themselves, they're a part of the rooms model. Therefore, if you'd like to add a door frame, you will have to modify the room's model.)