Event activation upon enering certain distance

Discussion in 'RPG Maker VX Ace' started by Unizaga, Apr 19, 2016.

  1. Unizaga

    Unizaga Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Hi!


    I am trying to activate this event, when my player goes near it.


    I have set up variables:


    variable1 = player x (on map)


    variable2 = player y (on map)


    variable3 = event x (on map)


    variable4 = event y (on map)


    I want to make a script for conditional branch which would subtract one variable from another and gives absolute number(if answer is ,,-'' it makes it positive)


    I tried doing it this way. $game_variables[1] - $game_variables[3] = 3.abs


    but it activates even when this isn't true. Same method would go for y coordinates.


    I tried using a proximity detection script, but that caused me errors, maybe because I have other scripts in my game as well, that might be interrupting each other.


    Event.png
     
    #1
  2. Arisa

    Arisa probably dead Veteran

    Messages:
    490
    Likes Received:
    1,749
    Location:
    Florida
    First Language:
    English/Spanish
    Primarily Uses:
    RMVXA
    Hmm, put the event where your character is going. 
     
    #2
    Marsigne likes this.
  3. Andar

    Andar Veteran Veteran

    Messages:
    27,525
    Likes Received:
    6,150
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    where did you read the variables? that parallel process isn't updating them.


    Additionally, the result of the operation needs to have the abs applied, not the three - 3.abs is always three and that ignores the possibility of the calculation becoming negative.


    And third, common events CANNOT be moved because they don't exist on maps - you'll need to target the move route on the map event, not on the common event.
     
    #3

Share This Page