Dismiss Notice
Hey Guest,
If you are interested in ghosting, the Ghosting Awards for January 2025 has just been announced:

Click here to check it out!

Polygon's Mod

Discussion in 'Third Party Scripting & Development' started by Polygon, Apr 8, 2020.

  1. Polygon

    Polygon Forum Legend Official Author

    Awarded Medals
    We are so back!
    Sorry for leaving the mod broken for so long. I've been away from this game for quite a while. But I just released version 2.1.8, which fixes it! (fingers crossed)

    Unfortunately, there's a race condition with the load time of the modded script in relation to the other scripts, and it will occasionally fail to load. This seems to be rare, and a refresh will fix it. I have no idea how other people make their mods load more consistently.
     
    Last edited: Jun 26, 2025 at 7:48 PM
    Eryp, Zycerak, Uniior and 10 others like this.
  2. Ponjoja

    Ponjoja Casual Member Official Author

    How do I download this? ChomeExtensions won't work
     
    a_drain, TPlacella and pawflix like this.
  3. Polygon

    Polygon Forum Legend Official Author

    Awarded Medals
    Chrome extensions in general don't work? Or just this one?
    You have to be using a Chromium browser (Chrome, Edge, Opera, Brave). Here's the link to the extension: Polygon's Mod - Chrome Web Store
     
  4. Ponjoja

    Ponjoja Casual Member Official Author

    Ok, used the link and downloaded it, now what, how do I use it?
     
    a_drain and TPlacella like this.
  5. Calculus

    Calculus Community Developer Staff Member Administrator Ghost Moderator

    Awarded Medals
    I run at document_start: "Scripts are injected after any files from css, but before any other DOM is constructed or any other script is run." I've never had any issues with the current method I'm using. It has always loaded before any other scripts. The Game constructor needs to be defined as early as possible so that it can be used, referenced and initiated. If there are any DOM related things going on in your mod where you need to append an element to the DOM and document_end works better for that scenario, consider making a separate script or add a onload or DOMContentLoaded listener.
     
  6. Polygon

    Polygon Forum Legend Official Author

    Awarded Medals
    Strange, when I used document start it almost always failed. It seems like the game script needs to load after some initialization happens, but before other scripts load. Document start made it load too early, so I went with document_end, which seems to work 99% of the time.

    Just go to Free Rider, and you should see a white pentagon in the bottom left corner of the webpage. That means it worked. If you don't see it, look for it in your extensions list and make sure it's enabled.
     
    a_drain, TPlacella and FIREBEATS like this.
  7. Ponjoja

    Ponjoja Casual Member Official Author

    Ok, thanks bro
     
    a_drain and TPlacella like this.
  8. Calculus

    Calculus Community Developer Staff Member Administrator Ghost Moderator

    Awarded Medals
    Just checked your code. I don't know if it's due to the minification, but for some reason a variable is being defined outside of the class causing it to run immediately at document_start, but Application obviously isn't defined yet. These variables are only used once, there is no real need to define a variable here for this. But despite that, I removed the variable and replaced the reference points, there are still other underlying issues preventing the mod from injecting on document_start due to some dependencies which I have eliminated from Free Rider Lite such as createjs, as well as a few others.
    upload_2025-6-26_14-47-21.png
     
  9. JustAGDFan

    JustAGDFan Well-Known Member Team Balloon Official Author

    may i ask what language polygon's mod is programmed in (i use python lol)
     
    TPlacella and pawflix like this.
  10. weem

    weem supreme Elite Author Team Blob Official Author

    Awarded Medals
    Goat
     
    FIREBEATS, TPlacella and Volund like this.

Share This Page