Any real way to implement DLC?

Discussion in 'Learning Javascript' started by The A-ster, Apr 5, 2019.

    Tags:
  1. The A-ster

    The A-ster Villager Member

    Messages:
    12
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    If so, I would like a tutorial on how to do this. I have made room for any switches I may need to use. I just want to know how to remotely turn on a switch using an outside js or json file. Thanks to anyone who can help!
     
    #1
  2. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,417
    Likes Received:
    12,650
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Afraid we don't have a forum section for requesting tutorials, and this part of the forum is for tutorials you have made. Since you asked about Js files I'll move this to Learning JavaScript.

    Moved to Learning Javascript

     
    #2
  3. Andar

    Andar Veteran Veteran

    Messages:
    28,703
    Likes Received:
    6,600
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    not by default.
    there are several ways to do this with javascript plugins, but it depends on how you want it and is never easy.

    the simplest way would be to have a plugin check for the existance of specific files and then activate content, but even that is not something to do as a beginner in javascript, and it has several problems (like anyone could trigger it by creating the file, which means you have no way to prevent dlc pirating).
     
    #3
  4. myenemy

    myenemy Veteran Veteran

    Messages:
    40
    Likes Received:
    15
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Then, if you want it to have some guarantee it's the real file and not a modified one, you could check its contents individually, or simply, check their hashes.
    The way to do stuff like this varies on the kind of dlc, and it must be prepared beforehand in that script Andar suggested. You would need to be quite more specific if you want an actual tutorial.

    Pseudocode:
    Code:
    (function(){
        if(checkDLC)
           $gameSwitches.setValue(varId, true); //The line to set a switch on. VarId is the in-editor number. Set to false to turn it off.
    })();
    
    function checkDLC()
    {
       var dlcIsRight=true;
       for each file while dlcIsRight
       {
           checkFileExists(file)
           checkFileIsRight(file)
            if anyFails()
               dlcIsRight=false;
        }
        return dlcIsRight
    }
    
    Long story short, there are real ways to do so, but not native ones.

    [EDIT] Of course, that's if we're talking about automated dlc... but you can always "update the game manually", by overwriting the files. Back on XP, I used to make a lot of empty maps, and dlcs was simply overwriting the files the game had, and that's a idea I had on maker 2003, so it's likely still working the same.
     
    Last edited: Apr 25, 2019
    #4

Share This Page