User:Espyo/PFE 0.9 to 0.10 tool
- Page tools
- What links here
- Related changes
- Printable version
- Permanent link
- Page information
- User tools
- User contributions
- Logs
- View user groups
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Pikmin fangame engine v0.9 -> v0.10 file converter</title>
<script type="text/javascript">
function convert() { var types = document.getElementsByName("type"); var type = ""; for(var t = 0; t < types.length; t++) { if(types[t].checked) { type = types[t].value; break; } } var input = document.getElementById("input").value; var replacements = []; var result = "All done.";
if(type == "area") {
replacements = {
"guide_x *= *(.+)\nguide_y *= *(.+)": "reference_pos=\$1 \$2",
"guide_w *= *(.+)\nguide_h *= *(.+)": "reference_size=\$1 \$2",
"guide_file_name *=": "reference_file_name=",
"guide_alpha *=": "reference_alpha=",
"Misc\. *\{": "Custom{"
};
if(input.indexOf("Bridge") != -1) {
result = "All done, but bridges could not be converted. Please open the converted area in-editor, remove all bridges, and re-add them.";
}
} else if(type == "animation") {
replacements = {
"frames *\{": "sprites{",
"frames *=": "sprites=",
"frame_instances *\{": "frames{",
"frame_instances *=": "frames=",
"hitboxes *\{": "body_parts{",
"hitboxes *=": "body_parts=",
"hitbox_instances *\{": "hitboxes{",
"hitbox_instances *=": "hitboxes=",
"file_x *= *(.+)\n\t\tfile_y *= *(.+)": "file_pos=\$1 \$2",
"file_w *= *(.+)\n\t\tfile_h *= *(.+)": "file_size=\$1 \$2",
"game_w *= *(.+)\n\t\tgame_h *= *(.+)": "game_size=\$1 \$2",
"offs_x *= *(.+)\n\t\toffs_y *= *(.+)": "offset=\$1 \$2"
};
} else if(type == "particles") {
replacements = {
"\\bspeed *=": "total_speed =",
"\\bspeed_deviation *=": "total_speed_deviation =",
"\\bspeed_x *= *(.+)\n[ \t]*speed_y *= *(.+)": "speed = \$1 \$2",
"\\bspeed_x_deviation *= *(.+)\n[ \t]*speed_y_deviation *= *(.+)": "speed_deviation = \$1 \$2",
"\\bx_deviation *= *(.+)\n[ \t]*y_deviation *= *(.+)": "pos_deviation = \$1 \$2"
};
result = "All done, but you'll still need to convert all angles (angle
and angle_deviation
) from radians to degrees.";
}
for(var r in replacements) { var replacement = new RegExp(r, "g"); input = input.replace(replacement, replacements[r]); }
document.getElementById("output").value = input; document.getElementById("result").innerHTML = result; } </script> <style type="text/css"> textarea { width: 100%; height: 300px; } td, th { width: 300px; padding: 4px 10px; } </style> </head> <body>
This script will convert area, animation, etc. files created in version 0.9 of the <a href="https://pikminfanon.com/wiki/Pikmin_fangame_engine">Pikmin fangame engine</a> to the format read by version 0.10.
This isn't perfect, so remember to create a backup before converting your files.
1. Paste your file here (v0.9). | 2. Choose type and press Convert. | 3. Copy the new file (v0.10) from here. |
---|---|---|
<textarea id="input" onfocus="document.getElementById('result').innerHTML = ' ';"></textarea> |
<input type="radio" checked="true" name="type" value="area">Area geometry</input> |
<textarea id="output"></textarea> |
</body> </html>