1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Where to find modding resources

Discussion in 'Help' started by UrMum12345, Sep 13, 2016.

  1. UrMum12345

    UrMum12345 Vivacious Visitor Content Creator

    Joined:
    May 30, 2016
    Messages:
    12
    Likes Received:
    1
    So, I'm trying to write a mod. I have coding experience, but not in as3. I've only ever made mods for programs that are either open source, or with an IDE that has autocomplete for available functions. I just don't know where to get the available functions or global variables. Is there documentation for sdt mods anywhere? Better yet, if there is just a way to do it in flash, could someone point me towards a good tutorial for it? Any help would be greatly appreciated. Thanks!
     
  2. stuntcock

    stuntcock Club Regular Staff Member Moderator

    Joined:
    Jun 5, 2012
    Messages:
    1,520
    Likes Received:
    352
    There are categories of information that you'll need in order to write Loader mods:
    • AS3 itself
      • you'll need to understand the Sprite class if you intend to mess around with visuals; you'll need to understand the Matrix class if you want to work with geometric transformations; etc...
      • If you're working in Flash, then you'll have Intellisense support for all of this stuff. Just remember that you need to import the relevant libraries at the top of your *.as file
      • even if you're working in the Flash IDE, you may want to look into the Lightweight Compiler. Its output files tend to be smaller/cleaner than those created by Flash.
    • Loader syntax
      • Loader mods invoke specific functions (such as initl), and rely on certain global variables (such as g). When used properly, this stuff allows Loader mods to read local Settings files, suppress or extend SDT code, monitor the state of the game, and communicate (or interact with) other mods.
      • This stuff is mostly documented in the Guide subfolder included with the Loader package. It's also included in most of the bundles. You probably have it already.
        • Try to read through as much of it as you can. You won't understand everything right away. Remember to re-read it occasionally as you make progress.
      • Please feel free to copy-paste the "structural" code of an existing Loader mod, and simply replace its "payload" with your own. I began SDT modding by copy-pasting @sby's work. You'll find plenty of shared code, and you can get more by decompiling existing SWF files (or by asking the authors to share).
    • SDT arcana
      • In order to complete a project, you might need to know the hierarchy of SDT objects within the scene. For example: the right forearm belongs to the right upper arm, which belongs to a shared container, which belongs to the girl, which belongs to the game simulation singleton. If you want to mess around with the forearm, then you'll need a statement like: g.her.rightArmContainer.upperArm.foreArm
      • Unfortunately, Intellisense won't help you here. It doesn't know anything about these relationships.
      • You can find the complete decompiled SDT code in a few places (such as sby's thread, which also provides a video tutorial for Loader modding). If you Ctrl-F for a specific term (such as "rightArm") then you'll hopefully find a code snippet which shows the relevant hierarchy.
      • You may also need to understand the code flow of SDT, if you want to do something more invasive like changing the collision rules. This is a more difficult task. It usually involves walking through decompiled code for a while, identifying a function, disabling it (via lProxy) to confirm that it's the one you want, and then re-enabling it and adding Pre or Post function calls. But the task can quickly get messy if other mods are also attaching proxies to the same function. Thorough testing is needed.
        • If you're pursuing this approach, then it might be wise to start a new thread which explains your goals. One of the veteran modders can probably identify the key functions and provide some pseudocode, so that you can start on the interesting/productive work more quickly.
     
    tmb likes this.