[QUESTION] Want to learn

Discussion in 'Mod Discussions' started by Corang, January 8, 2014.

  1. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Well I know next to nothing about programming of any sort, I tried C++ but that didn't go over too well. My point here is I would like to learn how to mod PA, I think that there is javascript and/or jquery involved but beyond that, I am not sure what to do because I do not even know the basics of javascript, does anybody have any links to good online guides, video tutorials, or if nobody knows any, a book that I can buy?
    Last edited: January 9, 2014
  2. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
  3. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    It depends a bit on what you are trying to do.

    An easy mod to use as a base for another mod would be Transparent Strategic Icons, since you can just copy it and replace the icons with your own. This is a good example of how mod file shadowing works.

    For UI modding, some relateively simple mods that can be used as a reference are:
    • Eco Efficiency
    • Chrono Click
    • Mod Batch
    I'd suggest avoiding things initially that depend on either Settings Manager (especially) or Floating Framework, as they can be confusing.

    Ultimately, I've found the best way to learn is to think of a simple mod, then make it. Maybe you don't like the colour of a particular UI element? or the wording of something? Something small like that, then use the modding system to correct it (rather than editing the files directly). Feel free to ask questions too; plenty of modders are willing to help.
    maxpowerz likes this.
  5. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    But I don't understand javascript whatsoever, I need to at least learn the basics before I start a mod. I also realize I did not explicitly state that I needed to learn javascript in my original post, sorry about that, it was edited.
  6. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Best way to learn might actually be from the web development side. Play with jquery a little and learn how it works. Make a few basic html/css web pages if you haven't already, just to get the feel for how that markup works. The jquery documentation on their website is very good and has a lot of detailed sample code, so you can try a lot of it out yourself. jsfiddle.net is a good tool for making quick little prototypes that you can test out without having to worry about a lot of other overhead. Once you have a good idea of how jquery works, you'll be ready to get into a little more of the specifics of PA. This game's UI is actually incredibly easy to tinker with because the only skill you need is some knowledge of web development.
    lokiCML likes this.
  7. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    What you're saying is that you want to learn how to code.
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Ah, right. I find W3Schools to be a good introduction: http://www.w3schools.com/js/
    Look into Javascript first before you move on to JQuery, as the later can be confusing.

    An especially confusing aspect about Javascript usage in PA is the Knockout library. That's best left until you're comfortable with Javascript/JQuery.

    Oh, and avoid a rookie mistake: Java != Javascript ;)
  9. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    I recommend Internet and World Wide Web: How To Program, 5/e because it covers HTML5, CSS3, and JavaScript as well as JQuery and JSON.

    The edition use for my intro to programming class really covered the basics well. You should follow the labs in each chapter. So you know what's happening with your code.

    Here is a resource from the mozilla foundation.
    https://developer.mozilla.org/en/learn/javascript

    As raven pointed out W3Schools is a nice resource. just no.:mad:
    EDIT: Do too unprofessional behavior I cannot recommend W3Schools as a resource. Go to this link for why.
    Last edited: January 29, 2014
    shootall likes this.
  10. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Thanks for all the answers, especially lokiCML I am going to look into renting that text book, also thanks for the quick response raevn but w3s isn't my thing I need a book :p
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    When you've come a bit further with learning programming in general I also found it very helpful to just read through the default UI's code.
  12. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Good resource to learn javascript = http://www.codecademy.com/tracks/javascript

    And yeah knockout needs some time getting used to.
    shootall likes this.
  13. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Good resource to learn javascript = http://www.codecademy.com/tracks/javascript
    and Jquery http://www.codecademy.com/tracks/jquery
    and html and css as well
    And read a lot of code

    And yeah knockout needs some time getting used to.
  14. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    shootall likes this.
  15. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Wow guys, thanks for all the resources I am currently doing the javascript class on codecadamy, after that I will do the html and then css courses, again thank you :D
    One more question though, how much html compared to javascript is used in PA?
  16. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    I think you best first do the html css course and then directly the jquery course
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    HTML/CSS are used for laying out objects, but javascript is what you need to handle all interactions, animations, and api calls. The html is really going to be the easy part for you, and you can probably get by just learning most of that as you need it. I guess it will depend on what kind of mods you are making.
  18. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    The simplest mod ever made for PA is probably my profile pic fixer. It basically just makes a couple changes to the home page's HTML to set a new profile pic. I've attached the first version of the mod since it's so simple in case you want to check it out and use it as an example. The more advanced one on PAMM uses things like settings and such.

    Attached Files:

  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    No the simplest mod is modbatch. The whole code:

    :p
    DeathByDenim and ORFJackal like this.
  20. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Oops. Profile pic fixer is still pretty close:
    Code:
    var elements = document.getElementsByClassName("div_start_menu_profile_pic");
    
    elements[0].style.background = "url(../../mods/ProfilePicFixer/pic.png) center center #333";
    elements[0].style.backgroundSize = "80px 80px";

Share This Page