Game_Interpreter line 1411 error from a common event

Discussion in 'RGSSx Script Support' started by lord_steak, Sep 14, 2014.

  1. lord_steak

    lord_steak Veteran Veteran

    Messages:
    72
    Likes Received:
    19
    First Language:
    English
    A bit thrown by this one, 'specially since the exact same lines worked peach-keen in a parallel process common event.

    I'm setting up save points, and that a bedroll or tent must be used either there or on the overworld map.  The trouble comes when the item permissions when approaching or stepping on the save point.

    Maybe what I've punched up would be helpful in diagnosing what the crap went awry.  Having it recognize map types is going without a hitch, using this script (my apologies for the lack comments).

    class Game_Map
      alias steak_wants_map_types_declared setup
      def setup(map_id)
        steak_wants_map_types_declared(map_id)
        $tell_steak_about_the_map = ["nope", "nothing"]
        @map.note[/<(Overworld|Level|Dungeon|SaveRoom|Cutscene), (Safe|Unsafe)>/]
        $tell_steak_about_the_map[0] = $1
        $tell_steak_about_the_map[1] = $2
      end
    end
    I had a common event set up to handle what items should be allowed to work on which map, as well as an exit spell (courtesy of Hime's Warp Stone script: http://forums.rpgmakerweb.com/index.php?/topic/4065-warp-stone/), and all of this seemed to work fine, too.  Switched out tags on the maps, and things were going okay.  That script:

    script.png
    Now this was where the trouble came: setting up the save point.  I placed events around the save point with the script, so that the bedroll and tent couldn't be used off the save point:

    $game_items[33].occasion = 3

    $game_items[34].occasion = 3

    And this on the save point itself, so that they could be:

    $game_items[33].occasion = 2

    $game_items[34].occasion = 2

    EDIT: I should specify, both sets of lines were set in common events, that were called for by a step-on triggered event.

    And while these lines were there, it threw me this error.

    error.png
    I'm confused; the exact same lines worked fine in the common parallel process.  Does anybody know what went awry?
     
    Last edited by a moderator: Sep 14, 2014
    #1
  2. Another Fen

    Another Fen Veteran Veteran

    Messages:
    536
    Likes Received:
    248
    First Language:
    German
    Hi,

    Sure it is $game_items and not $data_items ?

    However, you should be careful when modifying the $data_...-variables, since they are loaded only once when starting the game (or if the player hits F12). So, when you modify the item settings for example, they won't turn back to normal automatically when the player loads another savestate. When the player exits the program the changes to these variables are lost.

    You can bypass this issue by permanently updating the items though, but there should be better ways to do this (for example redefining the menu_ok? method of RPG::Item).

    The same goes for your $tell_steak_about_the_map variable: The variable is assigned only when a new map is set up. This does not include map changes caused by loading a savestate, so the variable will not update its value in that case.

    So when you exit the game, the assignment is lost. Right after starting the game $tell_steak_about_the_map will be nil, so loading a savestate then might cause the error you mentioned as well.

    A more clean way to do this would be perhaps to replace that variable by an instance variable for Game_Map and define accessor methods for it. This will guarantee you that value will always be up to date, regardless from what happens to the $game_map variable.
     
    Last edited by a moderator: Sep 14, 2014
    #2
  3. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,695
    Likes Received:
    924
    Location:
    The Internet.
    First Language:
    English
    Primarily Uses:
    N/A
    Put this script in your project and it should pinpoint the issue. There is a known issue with Hime's parallel pages where the location is inaccurate, but otherwise it should find it.
     
    Last edited by a moderator: Sep 14, 2014
    #3
  4. lord_steak

    lord_steak Veteran Veteran

    Messages:
    72
    Likes Received:
    19
    First Language:
    English
    *headdesk*

    Yeah...that was the problem.  In m' haste and glee at somethin' coming together, I didn't see the glaring mistake...should've put "data_items" instead of "game_items."

    With that fixed, I see after loading, I'm immediately thrown an error at line 450, likely the forewarned loading error.

    So...I altered the parallel process common event to reference the info passed via the $tell... variable into the in-game variables, so that they are saved.  Also moved the bit that converts in-game variables into something short enough to be used with Hime's Warp Stone, to outside the fork, so that it's being refreshed constantly and not lost upon quitting.  And added the suggested script.  Things are working...probably not the cleanest, shortest, nor best way to go about it, but it's working (for now).  I'll speak up if there's more things going wrong that I fail to see how to debug.
     
    #4

Share This Page