Difference between revisions of "Cave unit definition file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
  
 
==Unit==
 
==Unit==
The first line in the block is {{unsure|the version of the block's data format}}.
 
  
The second line is the internal name of the unit.
+
'''Line 1:''' {{unsure|The version of the block's data format}}.
  
The third line consists of two words, each a number, that define how many cave grid cells this unit takes up. The first word is for the length in X, the second for the length in Z. Basically, this means "this unit is X by Z units big".
+
'''Line 2:''' The internal name of the unit. For example, <code>room_block1_3_tsuchi # foldername</code>.
  
The fourth line determines 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 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>.
  
The fifth line determines the unit's flags.
+
'''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.}}
 
{{todo|Document the unit's flags.}}
  
The sixth line indicates how many exits this unit has. The lines after this one contain data about each exit.
+
'''Line 6:''' This indicates how many exits this unit has. For example, <code>4 # num doors</code>.
 +
'The lines after this one contain data about each exit.'
  
====== Line 8: <code>dirs/offs/wpindex</code> ======
+
====dirs/offs/wpindex====
 
This line contains three words, all numbers.
 
This line contains three words, all numbers.
 
The first number, <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 the 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.
 
The first number, <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 the 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.
Line 28: Line 30:
 
{{todo|Document the remaining lines.}}
 
{{todo|Document the remaining lines.}}
  
 +
{{Credits|Jimble, Kai-Kai}}
 
[[Category:Pikmin 2]]
 
[[Category:Pikmin 2]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Revision as of 16:25, 19 February 2018

In Pikmin 2, each sublevel points to a cave unit list file. These files can be found in /user/Mukki/mapunits/units, and contain a list of units that the game is allowed to use to create the cave with.

Header

After a decorated set of comments that say units definition file comes a line containing the number of units defined in this file. This line is commented with number of units. Each unit's data is defined inside its own block, and conveniently has a comment before it that mentions its name.

Unit

Line 1: The version of the block's data format[unsure].

Line 2: The internal name of the unit. For example, room_block1_3_tsuchi # foldername.

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, 4 4 # dX/dZ ; cell size.

Line 4: The type of unit this is. 0 is a dead end, 1 is a room, and 2 is a corridor.

Line 5: The unit's flags. For example, 0 1 # room Flags.

To do: Document the unit's flags.

Line 6: This indicates how many exits this unit has. For example, 4 # num doors. 'The lines after this one contain data about each exit.'

dirs/offs/wpindex

This line contains three words, all numbers. The first number, dirs, is the direction of the room and player. For example, in the Emergence Cave the direction is 2, for all other rooms to connect they must also be 2. 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 the 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.

An example of dirs set on 3 while all other room dirs are set on 2.

Exits

The first line in an exit's data is its index. This starts at 0.


To do: Document the remaining lines.

Credits: Jimble, Kai-Kai