[REL] Display "Advanced" Planet Info in Game Lobby - 51118

Discussion in 'Mod Discussions' started by sneakyness, July 24, 2013.

  1. sneakyness

    sneakyness Member

    Messages:
    106
    Likes Received:
    5
    This one was a quickie. I joined the first game I found, which happened to be a very large and boring max radius planet. I had no idea what "scale 6" meant.

    Turns out it's a 1-5 scale chunked from 0-20, up to 100, then anything above 100 is 6.

    Anyways, this mod exposes the real radius, the height range, the water height, and the temperature of the planet your commander will be landing on :ugeek:

    In \ui\alpha\lobby\lobby_alpha.html, replace the div starting at line 176 with the following:
    Code:
    <div>
    <span class="input_label">RADIUS:</span>
    <span class="input_field_static" data-bind="text: loadedPlanet().radius"></span>
    <span class="input_label">| HEIGHT:</span>
    <span class="input_field_static" data-bind="text: loadedPlanet().heightRange"></span>
    <div style="display: block; float: left;">
    <span class="input_label">WATER:</span>
    <span class="input_field_static" data-bind="text: loadedPlanet().waterHeight"></span>
    <span class="input_label">| TEMP:</span>
    <span class="input_field_static" data-bind="text: loadedPlanet().temperature"></span>
    </div>
    </div>
    This removes the silly "planet class" and replaces it with a nice little information pane. No javascript required, just using existing data binds ;)

    Attached Files:

    Last edited: July 24, 2013
  2. sneakyness

    sneakyness Member

    Messages:
    106
    Likes Received:
    5
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    I thought there was something wrong with my mod, but I guess the planet information isn't updating sometimes. I'm asking other players if they know what planet the game is on, and after they tell all of their Earth jokes, they admit it's blank :lol:
  3. masterdigital

    masterdigital Uber Alumni

    Messages:
    438
    Likes Received:
    833
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    So there is a known bug where the loadedPlanet info isn't being relayed to the players who join (instead of create) a custom game. The problem has already been fixed (so your mod should with the next patch).
  4. zaphodx

    zaphodx Post Master General

    Messages:
    2,350
    Likes Received:
    2,409
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    Nice one, thanks.
  5. sneakyness

    sneakyness Member

    Messages:
    106
    Likes Received:
    5
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    Is this a server side issue, or could I fix this client side in the current build :eek:
  6. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    wow!
  7. gunshin

    gunshin Well-Known Member

    Messages:
    790
    Likes Received:
    417
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

  8. sneakyness

    sneakyness Member

    Messages:
    106
    Likes Received:
    5
    Re: [REL] Display "Advanced" Planet Info in Game Lobby - 511

    Did you have anything to contribute? That was known information…

    It's still potentially possible to fix client side though. :lol: Here, let me walk you through what I tried:

    If you look, there's actually already a check for empty planet information built into lobby_alpha.js, around line 244 or so, which is just using a jQuery.isEmptyObject() check on model.loadedPlanet. However, in some instances this won't return true, as the server is going to give you whatever planet you've loaded last as the result for model.loadedPlanet in the game lobby, even when you join new games. Seems like you need to be using a fresh user session in which you haven't started your own game in order to actually get an empty planet.

    My hacky idea was to potentially cycle the session before joining games to clean loadedPlanet, but all that does is ensure you get an empty response instead of an erroneously cached one.

Share This Page