Problem with Common event

Discussion in 'RPG Maker VX Ace' started by Thefirelion, Jul 7, 2019.

  1. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    I'm having a strange problem with a common event that is activated from a switch when I do it, the error "undefined method "x" for Nil: Nilclass" BUT, when I execute it through an event (parallel process) on the map itself, it works perfectly, I do not know why and if I could get advice I would appreciate it.

    Note: it is the only "common event" with this happening to me.

    I do not have any script that uses that switch, I do not have any that involves the default methods in the engine used, I have the script that uses the written methods (proxy.inprox)


    Screenshots
    event.png Untitledhh.png

    EDIT: Nevermind, I found the problem, any moderator can close this threads. Thanks and Sorry. :kaoswt2:
     
    Last edited: Jul 7, 2019
    #1
  2. Bex

    Bex Veteran Veteran

    Messages:
    1,267
    Likes Received:
    300
    First Language:
    German
    Primarily Uses:
    RMMV
    The Problem is that a common Event doesnt have an Event ID.
    But if that Common Event is called by an Event with Eventcommand "Common Event", than the code becomes like the code of that Event
    and therefore if the code uses Event Id of "This Event", all is working well. Without the calling Event i assume that you get the error because of this.
     
    #2
    Thefirelion likes this.
  3. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Yes,

    I think I'll have to use another method to check the distance of the player with respect to an event, I use this script https://forums.rpgmakerweb.com/index.php?threads/proximity-events.415/ for this and other purposes but it seems that it is not for generic uses so that they can be used for a "common event". I forgot that the common events use is the current map data when using events in the list of commands (which I do not like).
     
    #3
  4. Bex

    Bex Veteran Veteran

    Messages:
    1,267
    Likes Received:
    300
    First Language:
    German
    Primarily Uses:
    RMMV
    Did you try to exchange @event_id with the direct id number of the event you want to get checked?
    Instead of Proxy.inprox?(@event_id) you do Proxy.inprox?(1)
    @event_id is referencing the Event which is executing the code. Since one Event can control the conditions for several others,
    you will not need @event_id, but maybe a direct number. But i know to little about your approach to be sure.

    Edit: And yes if you use for example Events 20 to 30 for this and you use common event,
    than you need the same event ids on the other maps to work.
    Or you do one map Event with individual Event IDs directly on each Map, but the common Event is ment to safe you from that work if possible.

    Edit: You seem not to like some stuff, would you like to elaborate what this mechanic would look like for the player when playing? If we understand that, we might can come
    up with a alternative Solution.
     
    Last edited: Jul 7, 2019
    #4
  5. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Edit:
    Well, It will be in the conventional way. Thanks for the Attention.
     
    Last edited: Jul 7, 2019
    #5
  6. Bex

    Bex Veteran Veteran

    Messages:
    1,267
    Likes Received:
    300
    First Language:
    German
    Primarily Uses:
    RMMV
    Conventional way? What do you mean by that? Maybe we can improve your approach and make it alot easier or much shorter.
     
    Last edited: Jul 8, 2019
    #6
  7. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    If there was a way to detect if an event (unimportant of the ID) is in the same tile to jump, without much tangle of events would be wonderful.

    I found this piece of code

    ($game_map.events[id].y - $game_player.y).abs == 0 && ($game_map.events[id].x - $game_player.x) == -1 && $game_player.direction == 4

    but you need to list the events and do the checks of each one, obviously in a separate event.
    Until I find a better method, the operation of my event will have to be reconfigured.
     
    Last edited: Jul 8, 2019
    #7
  8. Bex

    Bex Veteran Veteran

    Messages:
    1,267
    Likes Received:
    300
    First Language:
    German
    Primarily Uses:
    RMMV
    What about the "Get Location Info" Command, it can tell you which Event Id is on a certain Maptile.
    For example you check Location info for Infront of Player, and if the Variable is more than 0 than an Event is on that Map Position.
    Now you can make that the Player Moves 1 Step Backwards for example.
     
    #8
  9. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    I'm sorry for the delay in answering, I was busy this week. As soon as this issue I eliminated the script of proximity that I had and I ended up configuring the event so that it would work in the most summarized way possible.

    I did not use the Get Location Info command, through a conditional event check of proximity formula and the condicional facing command in the same event. That at the same time is combined with other mechanics that I implemented in my game.
     
    #9

Share This Page