mirror of
https://github.com/marcrobledo/savegame-editors.git
synced 2025-04-28 09:05:10 +00:00
Add algorithm to calculate grid location based on X, Z coordinates, and
add starting position for Divine Beasts
This commit is contained in:
parent
2af4950684
commit
ee8b99e990
@ -81,36 +81,46 @@
|
||||
<!-- Coordinates (Requires a memory editor) -->
|
||||
<h3 class="border-green">Coordinates</h3>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-x">X</label></div>
|
||||
<div class="two columns"><input id="float-pos-x" class="full-width" type="text" /></div>
|
||||
<div class="six columns"><label for="float-pos-x">X</label></div>
|
||||
<div class="three columns text-right">
|
||||
<button onclick="fixPCCoords()">Fix for Dungeon</button>
|
||||
</div>
|
||||
<div class="three columns">
|
||||
<input id="float-pos-x" class="full-width" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-y">Y</label></div>
|
||||
<div class="two columns"><input id="float-pos-y" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="float-pos-y">Y</label></div>
|
||||
<div class="three columns"><input id="float-pos-y" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-z">Z</label></div>
|
||||
<div class="two columns"><input id="float-pos-z" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="float-pos-z">Z</label></div>
|
||||
<div class="three columns"><input id="float-pos-z" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="input-pos-map">Map (44A0)</label></div>
|
||||
<div class="two columns"><input id="input-pos-map" class="full-width" type="text" /></div>
|
||||
<div class="seven columns"><label for="input-pos-map">Map (44A0)</label></div>
|
||||
<div class="two columns text-right">
|
||||
<button onclick="guessMainFieldGrid()">Guess</button>
|
||||
</div>
|
||||
<div class="three columns">
|
||||
<input id="input-pos-map" class="full-width" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="input-pos-maptype">Map Type (DC658)</label></div>
|
||||
<div class="two columns"><input id="input-pos-maptype" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="input-pos-maptype">Map Type (DC658)</label></div>
|
||||
<div class="three columns"><input id="input-pos-maptype" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-x-horse">Horse X</label></div>
|
||||
<div class="two columns"><input id="float-pos-x-horse" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="float-pos-x-horse">Horse X</label></div>
|
||||
<div class="three columns"><input id="float-pos-x-horse" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-y-horse">Horse Y</label></div>
|
||||
<div class="two columns"><input id="float-pos-y-horse" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="float-pos-y-horse">Horse Y</label></div>
|
||||
<div class="three columns"><input id="float-pos-y-horse" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ten columns"><label for="float-pos-z-horse">Horse Z</label></div>
|
||||
<div class="two columns"><input id="float-pos-z-horse" class="full-width" type="text" /></div>
|
||||
<div class="nine columns"><label for="float-pos-z-horse">Horse Z</label></div>
|
||||
<div class="three columns"><input id="float-pos-z-horse" class="full-width" type="text" /></div>
|
||||
</div>
|
||||
|
||||
<!-- ITEMS -->
|
||||
|
@ -1,5 +1,5 @@
|
||||
CACHE MANIFEST
|
||||
#v20180311b
|
||||
#v20180311c
|
||||
#CACHE:
|
||||
index.html
|
||||
zelda-botw.css
|
||||
|
@ -662,6 +662,54 @@ function loadMapPins(){
|
||||
setValue('number-map-pins', count);
|
||||
}
|
||||
|
||||
function guessMainFieldGrid() {
|
||||
if (getValue('pos-maptype') == "MainField")
|
||||
setValue("pos-map",guessMainFieldGridInternal(getValue("pos-x"), getValue("pos-z")))
|
||||
else
|
||||
MarcDialogs.alert("This only applies for MainField, not trials or divine beasts.")
|
||||
}
|
||||
|
||||
function fixPCCoords() {
|
||||
let dungeon = getValue('pos-map')
|
||||
if (dungeon == "RemainsFire") {
|
||||
setValue('pos-x', 0)
|
||||
setValue('pos-y',16.8)
|
||||
setValue('pos-z',69.5)
|
||||
} else if (dungeon == "RemainsWater") {
|
||||
setValue('pos-x',47.7)
|
||||
setValue('pos-y',6.05)
|
||||
setValue('pos-z',6.3)
|
||||
} else if (dungeon == "RemainsWind") {
|
||||
setValue('pos-x',0)
|
||||
setValue('pos-y',3.4)
|
||||
setValue('pos-z',-77.7)
|
||||
} else if (dungeon == "RemainsElectric") {
|
||||
setValue('pos-x',0)
|
||||
setValue('pos-y',71.9)
|
||||
setValue('pos-z',3.7)
|
||||
} else if (dungeon == "FinalTrial") {
|
||||
setValue('pos-x',0)
|
||||
setValue('pos-y',-0.4)
|
||||
setValue('pos-z',64.5)
|
||||
}
|
||||
}
|
||||
|
||||
function guessMainFieldGridInternal(xpos, zpos) {
|
||||
// A1 = -4974.629, -3974.629
|
||||
// J8 = 4974.629, 3974.629
|
||||
// X and letter part of grid: west/east
|
||||
// Z and number part of grid: north/south
|
||||
|
||||
// grid also visible at https://mrcheeze.github.io/botw-object-map/
|
||||
|
||||
// idea: Take position fraction out of the whole grid and divide equally.
|
||||
|
||||
let gridvalX = Math.min(10, Math.max(1, Math.trunc((xpos + 4974.629) / 9949.258 * 10 + 1)))
|
||||
let gridvalZ = Math.min( 8, Math.max(1, Math.trunc((zpos + 3974.629) / 7949.258 * 8 + 1)))
|
||||
|
||||
return String.fromCharCode(64 + gridvalX) + '-' + gridvalZ
|
||||
}
|
||||
|
||||
function clearMapPins(){
|
||||
// types
|
||||
var count = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user