TYPE ERROR: when loading file through script call

Discussion in 'Javascript/Plugin Support' started by OktoberLove, Apr 11, 2019.

  1. OktoberLove

    OktoberLove Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    Sorry if this is in the wrong section.

    I'm using Alpha ABS and whenever I load a game file using script call I get Type Error: Cannot Read Property of "length" undefined.
    Regular loading is fine however I don't plan to use the default loading menu in my game. I will rely solely on script calls. If someone can help I will really appreciate it and add you to my support section of my credits. Thanks in advanced!

    Here's a screenshot of the Error
     

    Attached Files:

    • ss.png
      ss.png
      File size:
      636.1 KB
      Views:
      3
    #1
  2. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    973
    Location:
    Buckie, Scotland
    First Language:
    English
    That would suggest to me that there's something happening between the ABS plugin and YEP core engine that's overwriting something the other is trying to manipulate.
     
    #2
  3. OktoberLove

    OktoberLove Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    It's weird because i started a new project with only ABS and i get an Error Cannot Read "meta" of undefined. But when I put YEP Core under it. It works.
     
    #3
  4. OktoberLove

    OktoberLove Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't think Alpha ABS requires YEP Core so yeah I'm confused.
     
    #4
  5. Another Fen

    Another Fen Veteran Veteran

    Messages:
    509
    Likes Received:
    232
    First Language:
    German
    I'm not sure what exactly you're trying, but if "load a game file using script call" looks something like this
    DataManager.loadGame(X)
    you'd have the issue that you are loading a savefile in the middle of an update cycle, meaning that the first half of the cycle will utilize the data from the old savestate, while part of the latter half will utilize the new one, which could lead to anomalies in your game.

    If you want to make sure loading a savegame won't cause problems, I'd recommend just setting a switch in your script call and use a plugin to load the savestate once the scenes update call is completed.
    (Sorry for the lack of detail right now, and this might not even be the issue here of course)
     
    #5
  6. OktoberLove

    OktoberLove Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    This is the script call I'm using:

    DataManager.loadGame(2);

    StorageManager.cleanBackup(2);

    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);

    $gamePlayer.requestMapReload();

    I think you may be onto something though considering the normal load works fine.
     
    #6
  7. OktoberLove

    OktoberLove Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    So I tried using a plugin like you said and it seems to get further but now I get a different error
     
    #7

Share This Page