Editing Cave unit definition file

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
In ''Pikmin 2'', each sublevel points to a cave unit definition file. These files can be found in <code>/user/Mukki/mapunits/units</code>, and contain a list of units that the game is allowed to use to create the cave with. This file just tells the generator how each cave unit attaches with one another. In other words, this file specifies all the rooms to spawn in a sublevel, depending on that sublevel's room count (<code>{f005}</code>).
+
In ''Pikmin 2'', each sublevel points to a cave unit list file. These files can be found in <code>/user/Mukki/mapunits/units</code>, and contain a list of units that the game is allowed to use to create the cave with. In other words, this file specifies all the rooms to spawn in a sublevel, depending on that sublevel's room count (<code>{f005}</code>).
  
 
==Header==
 
==Header==
Line 6: Line 6:
 
==Unit==
 
==Unit==
  
{| class="wikitable sortable"
+
'''Line 1:''' The version of the block's data format, this is always 1. For example, <code>1 # version</code>
|-
 
! Line || Example || Description || Comment
 
|-
 
| 1 || <code>1</code> || Version || <code>version</code>
 
|-
 
| 2 || <code>room_ike1_2_tsuchi</code> || Folder name of the unit to spawn || <code>foldername</code>
 
|-
 
| 3 || <code>7 6</code> || Width (7) and length (6) of the unit that's spawning (line 3); defines how many cave grid cells this unit || <code>dX/dZ ; cell size</code>
 
|-
 
| 4 || <code>1</code> || Room type: 0=dead end, 1=room, 2=hallway || <code>room type</code>
 
|-
 
| 5 || <code>0 1</code> || The unit's "room" flags. Judging by the name, and how most of the "room" type units have it set to 1, it's presumed to help count the room units as... well, rooms and not hallways or dead ends. Changing it to anything other than 1, or 0 for the non-room units, doesn't seem to do anything though. || <code>room Flags</code>
 
|-
 
| 6 || <code>2</code> || The number of doors (exits) the unit has || <code>num doors</code>
 
|}
 
  
From this point onwards, before ending the unit entry, there are four lines for each door sub-entry.
+
'''Line 2:''' The internal name of the unit. For example, <code>room_block1_3_tsuchi # foldername</code>.
{| class="wikitable sortable"
 
|-
 
! Line || Example || Description || Comment
 
|-
 
| 1 || <code>0</code> || Door index || <code>index</code>
 
|-
 
| 2 || <code>0 0 0</code> || Direction, offset (starting from the left, determines how many cells to the right the door is), and wpindex (The index of the route waypoint for that door) || <code>dir/offs/wpindex</code>
 
|-
 
| 3 || <code>1</code> || The number of doors this can link to || <code>door links</code>
 
|}
 
  
From this point onwards, before ending the door sub-entry, there is one line for each door link.
+
'''Line 3:''' Consisting of two numbers, this defines how many cave grid cells this unit takes up. The first number is for the length in X, the second for the length in Z (y-up). Basically, this means "this unit is X by Z units big". For example, <code>4 4 # dX/dZ ; cell size</code>.
{| class="wikitable sortable"
 
|-
 
! Line || Example || Description || Comment
 
|-
 
| 1 || <code>1258.716064 0 1</code> || Distance (used within score calculation), Door-id (Maps to another door index), and tekiflag {{unknown}} || <code>dist/door-id/tekiflag</code>
 
|}
 
  
{{Credits|Jimble, Kai}}
+
'''Line 4:''' The type of unit this is. <code>0</code> is a dead end, <code>1</code> is a room, and <code>2</code> is a corridor.
 +
 
 +
'''Line 5:''' The unit's flags. For example, <code>0 1 # room Flags</code>.
 +
{{todo|Document the unit's flags.}}
 +
 
 +
'''Line 6:''' This indicates how many exits this unit has. For example, <code>4 # num doors</code>.
 +
 
 +
===Exits===
 +
 
 +
'''Line 1:''' The exit's index, starting from 0. For example, <code>0 # index</code>
 +
 
 +
'''Line 2:''' The first of three numbers - <code>dirs</code> - is the direction of the room and player. For example, in the Emergence Cave the direction is <code>2</code>, for all other rooms to connect they must also be <code>2</code>. This value is ''currently'' useless because all rooms must be the same value for them to connect to each other. The player will always face this direction (the camera will oppose), which in a single-door room (any room name with "_1" before the room type) is always towards the next room.
 +
[[File:Dir3.png|200px|thumb|right|An example of <code>dirs</code> set on <code>3</code> while all other room <code>dirs</code> are set on <code>2</code>.]]
 +
 
 +
'''Line 3:''' The number of door links. For example, <code>2 # door links</code>.
 +
 
 +
'''Line 4(+):''' Ddst/door-id/tekiflag; there are as many lines for these three numbers as there are door links (specified in line 3). For example, <code>849.951904 1 1 # dist/door-id/tekiflag</code>.
 +
 
 +
{{Credits|Jimble, Kai-Kai}}
 
[[Category:Pikmin 2]]
 
[[Category:Pikmin 2]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Please note that all contributions to Pikmin Technical Knowledge Base are considered to be released under the Creative Commons Attribution-ShareAlike (see Pikmin Technical Knowledge Base:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: