ConflictNations Modding [TUTORIAL] [WIP]

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • ConflictNations Modding [TUTORIAL] [WIP]

      Okay, if this breaks any rules, please let me know. This is a documentation on modding Conflict Nations. Before you begin, you will need basic knowledge of CSS, JS (Javascript) and HTML. Let's get started. We will simply be using the following:

      - Google's services
      - Drive Notepad
      - Stylish

      Make sure you have Drive Notepad and Stylish installed before we begin. This is going to be a very lengthy post, so I'm going to divide it up into sections.

      Starting your Mod:
      Display Spoiler


      For the sake of simplicity here, I've decided to use a chromebook. You'll probably want to use a browser that has extensions on it. In my case, that's Chrome.
      Go to Google Drive and create a new folder with your mod name.










      Our mod is going to change the game's graphics just a little bit, so the interface looks nicer. I'll include details on how to change the map's look itself though.
      Next, you'll want to create a file called manifest.json:












      Double Click on your extension folder > Right Click on the gray area > Hover over More > Click on Drive Notepad

      You should be greeted with a screen that looks like this:







      Click on Title: untitled.txt and change it to: manifest.json


      Now, copy and paste the following template and rearrange the strings and parameters to your liking:


      JavaScript Source Code: manifest.json

      1. {
      2. //Manifest Version Required
      3. "manifest_version": 2,
      4. //Name of your Mod
      5. "name": "My ConflictNations Mod",
      6. "description": "Description of your mod",
      7. //Version
      8. "version": "0.1",
      9. "browser_action": {
      10. //Icon: Must be Favicon size
      11. "default_icon": "youricon.png",
      12. //Optional Info Page:
      13. "default_popup": "info.html",
      14. "default_title": "My ConflictNations Mod"
      15. },
      16. "content_scripts": [
      17. {
      18. //Required
      19. "matches": [
      20. "https://www.conflictnations.com*"
      21. ],
      22. //CSS: Link to file(s), stored as array.
      23. "css": ["yourcss.css"],
      24. //JS: Link to file(s), array format.
      25. "js": ["yourjs.js"]
      26. }
      27. ],
      28. "permissions": [
      29. "activeTab"
      30. ]
      31. //Just don't change what's in the permissions area and you'll be fine.
      32. }
      Display All

      If you decide to Only use CSS or JS, you may take out either CSS or JS depending on which one you want to use. E.g CSS-Only mods: Take out the JS. JS-Only mods: Take out the CSS. It's healthy to have a mix of both though...

      Please take the time to customize this template as I've done below:


      Now start adding your assets. This will be addressed in the next section of this tutorial.


      Deciding on your mod:
      Display Spoiler

      There are two basic types of Mods:
      - Interface Mods
      and
      - Map Mods


      Currently, Map mods are extremely difficult to do, as there is no current documentation on this, and I have not examined the file yet. So let's go with the easier option, the Interface mod. Currently, unless the development changes, we cannot modify the gameplay itself, or it would be extremely hard/tedious to do so. The Interface Modding option is very simple, and we will only need CSS for this one. In order to build upon the stylesheet as quick as possible, we may use Stylish to build a quick extension for the site, then copy and paste the CSS over to the document itself. By this time, I am assuming that you have everything in your extension figured out. For now, let's not do the information document.

      Your extension right now is probably the bare minimum with the file structure looking like this:

      extensionFolder:

      manifest.json
      conflictnations.png

      assets:

      main.css

      Your folder should be looking somewhat like this:



      In order to know what to put into main.css, you'll have to test the CSS over and over again. Save yourself some time by not downloading the extension and uploading it over and over. Instead, use Stylish to get the job done.

      Save your file with your mod name and start testing your CSS. Use Inspect Element to grab the ID and Class names of boxes. We have the ID's and Class names in the Documentation category.



      Documentation:
      Display Spoiler

      Here are the CSS Selectors you'll need to know, or at least come back to. Remember, you can simply access the Inspect Element console by pressing Ctrl + Shift + C or Ctrl + Shift + I. You can also right click and press inspect element. Once in Inspect Element, Press Ctrl + Shift + C and click on any part. The code will automatically scroll down to that piece of code.

      CSS Selectors:

      Containers:
      Display Spoiler

      //Chat Container: #chatContainer { } //Client Control Container: #clientControlsContainer { } //Bug Report Container: #bugReportContainer //Zooming: #func_zoom_container { } //Skip Tutorial: #func_skip_tutorial { } //Search: #func_search { } //Toggle Controls: #func_toggle_client_controls { } //Profile: #miniProfileContainer,#func_miniprofile_cont { } //Province List Container: #provinceListContainer { } //Resources: //#resourceBarContainer { }



      Resources:
      Display Spoiler

      ConflictNations favicon. Might be useful as a mod icon.







      Link to Favicon

      We've recently discovered a huge javascript file within the ConflictNations code. This might have to do with rendering the map, or even the overall game. If you have any idea what it is, please let me know.
      Here's sourceCode1:
      jsbust.js

      and SourceCode2, which is much larger seems to encompass the entire game at a whopping 89,230 lines of code. These might help with modding the map itself.

      sourcecode.js

      Keep in mind, this is a WIP and a large document. It might take some time for this to get fully written after being posted.

      The post was edited 1 time, last by IncogStructura ().

    • So I need to read the terms of service/rules to see if its allowed but I can start to clean the javascript files, its a slow process and doesn't expose everything but might expose more for us to build off.

      Edit: Just looked at what the second file actual was just a 'compact zlib, deflate, inflate, zip library in JavaScript" that can get from GitHub no real need to touch it right now. require.js seems to be the first one to look at.

      The post was edited 1 time, last by DSni ().

    • Anything that touches or tries to read data out of the datastream ie. the backend is a strict nogo area.

      Frontend ie. UI, sfx and gfx are fine as long as it doesn't give the player an advantage over other players.

      Hope that helps. It is our clear interest to support you guys in modding and even take inspiration from your ideas and solutions, as long as these works do not collide with the business interests of Dorado Games, bytro labs or Stillfront AB.

      //G
      "Going to war without France is like going hunting without an accordion." Gen. Norman Schwarzkopf