RMMV: Galv Map Properties TypeError Property Erased Of Undefined

Discussion in 'Javascript/Plugin Support' started by Burgerland, Mar 12, 2019.

  1. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    When I fire a projectile on a map, no projectiles is fired. This happens nine times in a row (hitting the fire button over and over). When I fire a tenth time, I get this error:

    Capture.PNG Capture2.PNG Capture3.PNG Capture4.PNG Capture5.PNG
     

    Attached Files:

    Last edited: Mar 12, 2019
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,311
    Likes Received:
    6,437
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    1) does this happen after you started a new game or after you continued a saved game or in both cases?
    2) please open your project's rpg_core.js file and tell us the number in its title line (which may or may not be identical to your editor version)
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    And a link to the plugin?
     
    #3
  4. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,891
    Likes Received:
    12,009
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA

    I've moved this thread to Plug-In Support. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #4
  5. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you.

    1. Both cases
    2. rpg_core.js v1.6.1, I have MV 1.6.1

    Capture.PNG Capture2.PNG

    Thank you, here is the plugin.
     
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    How do you call it? Can we see a screenshot of the script / plugin command?

    It's crashing because it's referring to an event id that doesn't exist.
     
    #6
  7. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you. It's called via the common event Gun. The screenshot is in my original post.

    On the map, I call Gun via this parallel process:

    Capture.PNG
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    So which one is running - the common event or the map event?

    You are calling Galv.PROJ.quickDir and passing an event id that doesn't exist on that map.
     
    #8
  9. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    Both are running. The common event is running via the map event's parallel process. Which event doesn't exist?
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Why are you calling the common event AND calling the plugin directly from the map?

    To know which event doesn't exist, you need to look at all your conditions. What is story set to? Is #0001 in the party? What is the value of extra player and extra player 2? Which part of your code is trying to run?

    How many events do you have on that map? Is every event you refer to in the common event and the map event actually there?

    You could remove the call to the common event and try it again - if it happens again, you know the error is in your map event. Then you could keep the call to the common event, but put an Exit Event Processing right after it, so no more of the map event gets run, then try it again - if it happens again, you know the error is in the common event.

    Or you could simplify it and get it working with just one or two events and once that's working properly, expand it to more events.

    There are so many things you can try before we start just guessing.

    You could change this part of the plugin:
    Code:
    Galv.PROJ.quickDir = function(id,overrideId) {
        var settings = Galv.PROJ.premade[id];
        if (overrideId) {
            var origId = settings.match(/\d+/i);
            settings = settings.replace(origId,overrideId);
        };
        if (Galv.PROJ.premade[id]) eval('Galv.PROJ.dir(' + settings + ')');
    };
    
    to add another line to identify the event id:
    Code:
    Galv.PROJ.quickDir = function(id,overrideId) {
        console.log(id);
        var settings = Galv.PROJ.premade[id];
        if (overrideId) {
            var origId = settings.match(/\d+/i);
            settings = settings.replace(origId,overrideId);
        };
        if (Galv.PROJ.premade[id]) eval('Galv.PROJ.dir(' + settings + ')');
    };
    
    then play with the console open (F8). When it crashes, the last number shown is the event id it's trying to run for and can't find.


    (you don't have to quote my whole post when you reply)
     
    #10
  11. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    There are two events, one for the gun and one for the timer. Yes, every event is there. I've screencapped all of them.

    I've run the console, here are the screencaps. First one is at title screen, second one is when the map loads, third one is when the error occurs.

    Capture.PNG Capture2.PNG Capture3.PNG
     
    #11
  12. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you had made the change I suggested and saved the plugin, there should be heaps of numbers showing before the error in that console.
     
    #12
  13. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    I forgot to close the program beforehand, here you go. I didn't see any numbers in the console.

    Capture.PNG Capture2.PNG
     
    #13
  14. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Sure there's a number. 7. Right above the error message.

    So it's saying, when you're trying to run it for event 7, that the event doesn't exist.

    Now, you've either deleted an event and haven't created a new one to replace it (so you're missing 7 but you might have 6 and 8), or event 7 is being erased by the plugin or by something you're doing, and then you're trying to target it again.


    However, just to be certain, change that part of the code back to what it originally was (you only need to remove that console.log ... line), then find this part:
    Code:
    Galv.PROJ.getTarget = function(id) {
        if (Number.isInteger(id)) {
            if (id >= -1) {
                switch (id) {
    
    and change it to this:
    Code:
    Galv.PROJ.getTarget = function(id) {
        console.log('Trying to target event ' + id);
        if (Number.isInteger(id)) {
            if (id >= -1) {
                switch (id) {
    

    This is where it's falling over, and this will determine if it's the same event or if it's doing something weird to the event ids.

    It may be possible that it'll be a different event id each time, depending on the conditions. But it's interesting that it's the first event id you target in your map event.
     
    #14
  15. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    I got bad eyesight, I can't see the seven. But here's the console:

    Capture.PNG
     
    #15
  16. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    so now it's saying it's trying to target event 113. Do you really have an event with id 113?

    Try it again - a few times - and see if it's a different event number each time (don't post screenshots - just take a look yourself - you're looking for the line right above the red background).

    If the number keeps changing, you may have to rethink your event design.
     
    #16
  17. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    Wait a minute! It can't find 113? How is that even possible?
     
    #17
  18. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That's what it says in your screenshot.
     
    #18
  19. Burgerland

    Burgerland Veteran Veteran

    Messages:
    239
    Likes Received:
    51
    First Language:
    English
    Primarily Uses:
    N/A
    OK, now I'm really curious as to why I'm getting the error with this plugin. It should not be having any trouble finding 113 or 112 because I made those events specifically for the plugin. I can see 7 not being found because I didn't tailor the event to the plugin, just added a plugin command to it, but 113 uses more than a plugin command - it uses the plugin's own parameter, so the plugin should absolutely be finding it on the map.
     
    #19
  20. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    What happens after you've targetted it? Does it get erased? If it gets erased, then the first time you hit it it will be there and will be erased, and the second time you try, it won't be there and will throw an error.

    I don't know - I'm only guessing. You're going to have to look at what your events are doing and make sure they're doing the right things, and you have no mistakes.

    Or as I suggested several posts ago, change it so it's really, really simple and make sure it works consistently. When you know it's working, then start to add more.

    And PLEASE stop quoting me every time you reply.
     
    #20

Share This Page