Difference between revisions of "Pikmin 2 waterboxes"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Expanded.)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Waterboxes are txt files that control where water is placed in a map. They are located in "user/kando/map/<map name here>/texts.szs/waterbox.txt". Each box of water contains 6 values that control where the box is placed, although we do not know what each value does, when they are changed the water can be moved. [[File:Pikmin_water_hack.png|300px|thumb|left|A bit of water hacked in Awakening Wood]]
+
[[File:Pikmin_water_hack.png|300px|thumb|right|A bit of water hacked in Awakening Wood]]
The syntax starts with the line "0 # type" not sure what it means, maybe there are other types of water? The next line is also quite ambiguous, "# CNode" the chances are this was some initialiser in the code or something like that. After that is an opening curly brace a new line and a single number, the amount of lines of lines with 6 values. After that are lines of six values, probably doubles, that control where and what shape the box is. It will always be a box. At the end of the line is a fraction, the number in the order of the line, counting up from 0: E.g if it were the fourth line and there 6 in total, it would be 3/6. The very last number would end in 5/6. After that, all there is is a closing bracket for the block of data
+
Waterboxes are text files that control where water is placed in an area. They are located in <code>user/kando/map/*/texts.szs/waterbox.txt</code>. Each body of water is defined by a [[wikipedia:Cuboid|cuboid]].
  
 +
==Format==
 +
===Header===
 +
Waterbox files start with a number, commented with <code>type</code>, {{unsure|whose meaning is unknown}}.
  
 +
Then, the list of boxes starts after the line commented with <code>CNode</code>, and is defined inside curly braces. Each body of water is defined in one line.
  
 +
The very first line of the list of boxes indicates how many there are in total.
  
 +
===Box===
 +
The boxes are defined by two 3D points. You can think of this like the first point being the "top-left-front" point, and the other to be the "bottom-right-back" point. In the list inside the file, each box is one line long, and consists of 6 space-separated numbers. The first number is the X coordinate of the first point, the second number is the Y coordinate of the first point, etc. So, the format is basically <code>X1 Y1 Z1 X2 Y2 Z2</code>.
  
 +
Each line also has a comment at the end with the number of the box (starts at 0), and the total number of boxes (e.g. <code>2/4</code>). These comments are optional, though.
  
 +
==Example==
 +
This is the file used for the Wistful Wild's water boxes.
  
 +
{| class="wikitable"
 +
! File line || Line explanation
 +
|-
 +
| <pre>0 # type</pre> || Type of waterbox file. {{unsure|Meaning is unknown.}}
 +
|-
 +
| <pre># CNode</pre> ||
 +
|-
 +
| <pre>{</pre> || Start of the list of boxes.
 +
|-
 +
| <pre> 2 </pre> || Total number of boxes.
 +
|-
 +
| <pre> -3700.000000 -110.000000 850.000000 -2500.000000 -10.000000 1650.000000 # 0/2</pre> || <code>X1 Y1 Z1 X2 Y2 Z2</code> of the first box.
 +
|-
 +
| <pre> -2000.000000 -90.000000 50.000000 -1000.000000 10.000000 1450.000000 # 1/2</pre> || <code>X1 Y1 Z1 X2 Y2 Z2</code> of the second box.
 +
|-
 +
| <pre>}</pre> || End of the list of boxes.
 +
|}
  
{{todo|Understand each individual value and the first two lines}}
+
[[Category:Pikmin 2]]
 +
[[Category:File formats]]

Revision as of 16:35, 25 February 2017

A bit of water hacked in Awakening Wood

Waterboxes are text files that control where water is placed in an area. They are located in user/kando/map/*/texts.szs/waterbox.txt. Each body of water is defined by a cuboid.

Format

Header

Waterbox files start with a number, commented with type, whose meaning is unknown[unsure].

Then, the list of boxes starts after the line commented with CNode, and is defined inside curly braces. Each body of water is defined in one line.

The very first line of the list of boxes indicates how many there are in total.

Box

The boxes are defined by two 3D points. You can think of this like the first point being the "top-left-front" point, and the other to be the "bottom-right-back" point. In the list inside the file, each box is one line long, and consists of 6 space-separated numbers. The first number is the X coordinate of the first point, the second number is the Y coordinate of the first point, etc. So, the format is basically X1 Y1 Z1 X2 Y2 Z2.

Each line also has a comment at the end with the number of the box (starts at 0), and the total number of boxes (e.g. 2/4). These comments are optional, though.

Example

This is the file used for the Wistful Wild's water boxes.

File line Line explanation
0 	# type
Type of waterbox file. Meaning is unknown.[unsure]
# CNode
{
Start of the list of boxes.
	2 
Total number of boxes.
	-3700.000000 -110.000000 850.000000 -2500.000000 -10.000000 1650.000000 # 0/2
X1 Y1 Z1 X2 Y2 Z2 of the first box.
	-2000.000000 -90.000000 50.000000 -1000.000000 10.000000 1450.000000 # 1/2
X1 Y1 Z1 X2 Y2 Z2 of the second box.
}
End of the list of boxes.