How do I being development of a mod?

Discussion in 'Mod Discussions' started by moonwerewolf, September 6, 2014.

  1. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    I have an idea for a mod, it requires to store a double variable for each metal planet, and then add an new UI element in a unit. Is that possible by now? and where should I start if I want to do that?
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    You can only store data on each individual client, or on your own server.

    UI elements are possible, small ones might be added to the existing UI, a new panel would be required for anything involved.
  3. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    But would it be possible to make a mod where at the start of the game, it loop through the planets, and store their names/id as the array key, and the variable inside the array is the number. Then the unit that stands on the planet could with the UI element display that number. Ofc I'm thinking of a mod that needs to be on the server, since it will effect game play.
  4. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    That's kind of where I thought it was going - having the same variable across players is a might bit difficult just now. I haven't dealt with planets much, so I don't know how well informed the UI is about which planet a unit is on.
  5. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    If that's the case, I could probably take the x, y, and z coordinates of the selected unit, and calculate which planets it is nearest. The only problem with that is if there is two planets very close to each other. But I haven't seen that in a game yet.

    Another problem is that I have no idea where to begin, or what language it's coded in. I have been programming for 7 years, but mostly in php and java, since those two languages is the ones I find easiest.
  6. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    It's Javascript with the Knockout library.

    Totally unlike PHP or anything you have ever done in Java. Weak typed language, event oriented call structure.

    UI ist HTML with all the benefits from CSS3, bound as a model to Knockout.
  7. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    That's good news, I have worked with javascript. Mostly with manipulating html dom objects, and ajax calls/request.
  8. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
  9. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I'd advise against that - the game does locations as [planet, planet-local-coordinate]
  10. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    No need to advise, it's impossible. But I think the UI knows what planet the player currently looks at. Though via hotkeys it is possible to select units on other planets as well.
    thetrophysystem likes this.
  11. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    but I need to know which planet the unit is on, and not which one the player is looking at.
  12. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Not sure if there is such information available to you.
    thetrophysystem likes this.
  13. moonwerewolf

    moonwerewolf Member

    Messages:
    93
    Likes Received:
    64
    Then I probably need to wait until the mod support gets better.
  14. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Depends on what exactly you want to do. Sometimes there are funny workaround. That's what modding is all about ;)
    thetrophysystem likes this.
  15. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    When a location is reported, it's usually in a format suitable for passing to the camera api to look at, which includes the planet. What I'm unsure about is whether such a location can be had for any unit of interest, or only for alerts.
  16. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Only alerts. At least last time I checked there was no way to record all unit positions at all times.

    ... that possibility will put me in a hard position, having PA Stats record that all would be fun, but ... lots of data xD
    thetrophysystem likes this.

Share This Page