[Question] Are there any tutorials for modding PA?

Discussion in 'Mod Discussions' started by Tormidal, June 2, 2014.

  1. Tormidal

    Tormidal Active Member

    Messages:
    243
    Likes Received:
    158
    Hey guys, I'd really like to get into the modding scene of PA, but I don't know where to start in terms of editing files for values, adding units, creating new units models and implementing them in the game(through server mods, atm.).

    Can anyone help? :)
  2. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
    The UI is written in JavaScript. The unit data is stored in json.

    Look at my Sig for a tutorial on json. You should Google basic JavaScript tutorials to figure out how to mod the ui.
  3. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    There isn't much in the way of tutorials for modding. The best we have are some reference guides, and existing mods.

    Reference guides

    • If you've never programmed, follow a basic tutorial on javascript (so you can do basic things and follow what other mods are doing)
    • Knockout is a heavily used javascript library it may make sense to get used to, depending on what you want to mod: http://knockoutjs.com/
    • Look at the code of existing mods that do similar things to what you want to do, to learn how to do them (mods are installed, at least for me on windows, here: '%APPDATA%\..\Local\Uber Entertainment\Planetary Annihilation\mods')

    I may write some guides in the future, 'my first mod' sort of things, but they will probably not be around for a while.
  4. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    and then just ask if you get confused. Everyone here is happy to help so you'll get your answer in no time.
  5. Tormidal

    Tormidal Active Member

    Messages:
    243
    Likes Received:
    158
    Thanks so much guys, as soon as I have some free time, I'll start reading up and getting to work. :)
  6. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
    Also try looking at other mods and reading the source for PA once you understand JavaScript.
    squishypon3 likes this.
  7. Tormidal

    Tormidal Active Member

    Messages:
    243
    Likes Received:
    158
    I'll be sure to look into that as well.

    Are there any reference guides or tutorials for properly creating a unit to be implemented in game?
  8. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
    Not that I know of. Just try and figure out how to read json(All the json in PA is minified, so copy and paste the files in to a json formated online so you can read it).
  9. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    Adding a new unit instead of just modifying an existing one should be possible, no one's done it publicly afaik. When someone makes such a mod, you'll be able to see what new files they needed to add, and what existing files they needed to modify.
  10. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    When I build my very first UI mods I did this tutorial, it was also my first look at JS: http://learn.knockoutjs.com/
    Very helpful if you have programming knowledge already and just want to quickly understand how the UI with JS and Knockout works.
  11. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,356
    Actually someone has done it publicly, someone's re balance mod, and I just finished adding in a custom unit...

    I'd be happy to work up a quick visual/audio tutorial for quite a few things. PA's coding is very, very, simple and easy to understand. You could even get into it with next to no experience. ;)
  12. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    I would recommend Mozilla's JavaScript, HTML, and CSS tutorials and documentation. Here is a link to them. Also documentation in this sub forum.
    Just to name a few resources.

    Edit: w3c has some really nice HTML and CSS verifiers which would help with debugging. Also here is two JavaScript code quality tools to help with debugging as well as for your sanity.
    • jslint.com - "Describes problems in code with an approximate location within the source."
    • jshint.com - "Helps to detect errors and potential problems in code."
    Last edited: June 2, 2014

Share This Page