1. If you're looking for help-related things (for example, the key rebinding tutorial), please check the FAQ and Q&A forum! A lot of the stickies from this forum have been moved there to clean up space.
    Dismiss Notice

Text To Coordinates Calculator

Discussion in 'Starbound Discussion' started by Surn_Thing, May 8, 2017.

  1. Surn_Thing

    Surn_Thing Pangalactic Porcupine

    Here is a calculator that converts text into numbers usable as coordinates. This is practical as "fart,knocker" is easier to remember than "5192,1563259". With this you can use (kind of) use words instead of numbers for seeds; like in Minecraft. Just enter two words into the calculator, hit "calculate" to get them as numbers, enter those numbers as coordinates and explore that system. If you find something interesting there you can say something like "I found [interesting thing] at 'comfort,wipe'".

    For the code below.
    1. Select and copy the text.
    2. Paste it in notepad.
    3. Save it as "sbcalc.html" wherever.
    4. Drag and drop the file into your web browser.


    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Text to Coordinates </title>
    <link href="https://fonts.googleapis.com/css?family=Baloo" rel="stylesheet">
    <style>
    body
    {
    background: linear-gradient(#000000,#222222) no-repeat center fixed;
    color:white;
    font-family: Baloo;
    }
    
    input[type=text]
    {
    font-family: Baloo;
    font-size: 50px;
    border-radius: 10px;
    padding: 10px;
    width: 10em;
    
    }
    button
    {
    font-family: Baloo;
    font-size: 50px;
    border-radius: 10px;
    padding: 10px;
    width: 10em;
    
    }
    
    #mainholder
    {
    
    display: flex;
    flex-wrap: wrap;
    width: 75%;
    height: 30%;
    margin: 5% auto 0 auto;
    padding: 1em;
    border-radius: 20px;
    //background: green;
    justify-content: center;
    }
    
    #mainholder div
    {
    margin: 1em;
    text-align: center;
    font-size: 50px;
    }
    
    #mainholder h1
    {
    margin: 10px 1em 10px 1em;
    font-size: 100px;
    }
    
    
    
    </style>
    
    <script>
    
    
    
    function translateToNumberL2 (grindme, outpoot)
    {
    
        var daNew = new Number(translateToNumber(grindme));
    
        document.getElementById(outpoot).innerHTML = daNew;
    
    
    }
    
    function translateToNumber (grindme)
    {
      
        var grindmel2 = new String(grindme);
        if (grindmel2 == "") {return 0;}
        var indexArray = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
        var toSend = "";
    
    
        for (a = 0; a < grindmel2.length; a++)
        {
            var leIndex = indexArray.indexOf(grindmel2.charAt(a));
            if (leIndex == -1){continue;}
    
            while (leIndex > 9){leIndex -= 9}
        
            toSend = toSend + new String(leIndex);
    
        }
    
    
        toSend = new Number(toSend);
        if (grindme.charAt(0) == "-"){toSend *= -1;}
        return toSend;
    
    }
    
    </script>
    </head>
    
    <body onLoad = "setup();">
    <div id = "mainholder">
    <h1>SB Text To Coordinates</h1>
    <div>
    
    X:<input type = "text" id = "inpoot1" onkeypress = "" maxlength = "13"></input>
    <p id = "outpoot1">0</p>
    </div>
    <div>
    Y:<input type = "text" id = "inpoot2" onkeypress = "" maxlength = "13"></input>
    <p id = "outpoot2">0</p>
    </div>
    <br><button onClick = "engine()">Calculate</button>
    </div>
    
    
    
    <script>
    var daTimer;
    
    function setup()
    {
        //daTimer = setInterval(engine,33);
        document.getElementById("inpoot1").value = "";
        document.getElementById("inpoot2").value = "";
    
    }
    
    function engine()
    {
        translateToNumberL2(document.getElementById('inpoot1').value ,'outpoot1');
        translateToNumberL2(document.getElementById('inpoot2').value ,'outpoot2');
    
    }
    
    
    </script>
    </body>
    </html>


    I'd would give it to you in a zipped folder, but there's probably some rule against that.

    I've made a suggestion to enable text to be used as coordinates in vanilla Starbound here.
     
    Last edited: May 8, 2017
  2. NuclearSlayer52

    NuclearSlayer52 Phantasmal Quasar

    for the amount of code its not worth it as you just have to bookmark it (if you want it lower down in the list and want it called "Avian Village I" add "XXX " to the start and i think numeral will put it higher so adding "1 " i think will be near the top) or screenshot the coords

    though for some people they might prefer remembering coords rather than bookmarking it but the code should (if possible) be compressed to something alot shorter

    also how does it convert the letters to numbers? or does the conversion work where multiple combination make the same number?
     
  3. Surn_Thing

    Surn_Thing Pangalactic Porcupine

    It would make it easier for sharing purposes as words are easier to remember than numbers. As for the length of the code, it really doesn't matter once the code has been saved to an .html file all you have to do is double click on it to run it (also it was good practice for me to make it). As for converting letters to numbers the same letters will generate the same code; though I imagine it is possible to get identical numbers with different words. The code converts each letter to a digit between 1 and 9 by referencing each letter in a list containing each letter in the alphabet, getting the index of each letter and reducing it by 9 until it is 9 or less. The digits are then strung together to form a number.
     
  4. Tsukistar

    Tsukistar Scruffy Nerf-Herder

    I'm kind of skeptical. Sure, words are easier to remember, although it seems like you'd possibly run into the issue of some coordinates not translating well into coherent words, and word-coords taking you to just the vague general area around the star, as opposed to directly on it like with numeral coordinates.

    Additionally, awhile words are easier to remember, yes, it isn't really necessary when you could just look at the page or chat log that you got the coord off of.

    EDIT: Don't get me wrong - I do like the concept, and I don't see any reason why one couldn't put it in, but it also seems less reliable when you're probably getting coords off the internet anyways, and can always double-check to make sure it's typed correctly.
     
    Last edited: May 9, 2017
  5. Surn_Thing

    Surn_Thing Pangalactic Porcupine

    I didn't say anything about translating numbers to words, just words to numbers. I guess accuracy would be a bit of a trade-off, but so long as the star's on the screen when you enter the co-ordinates. As for the chat, relaying words would also be quicker to type in.
     
  6. Tsukistar

    Tsukistar Scruffy Nerf-Herder

    Ohh - so you mean just putting in random words for a coord, then choosing a random star near there? Pardon me for misunderstanding, it's a bit late for me XP

    (And even if it's a bit faster - I imagine the time saved is a bit negligible, especially if you go back to the whole accuracy thing.)
     

Share This Page