(XP) event collision by terrain tags

Discussion in 'RGSSx Script Support' started by kaigames, Feb 8, 2019.

    Tags:
  1. kaigames

    kaigames Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Portuguese.BR
    Primarily Uses:
    RMXP
    hello sorry for my english .... in rpg maker it is possible to make conditions by calling scripts

    I actually did with the character colliding with a terrain:

    $ game_player.terrain_tag == 0

    with 0 being the desired terrain number.

    but when trying to do this with events does not work. events do not react to land

    I tried to exchange the $ game_player for $ game_event but it did not work well ,,,,

    is there a way to fix or a script that can fix this? desde já agradeço
     
    #1
  2. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    222
    Likes Received:
    110
    First Language:
    English
    Primarily Uses:
    RMXP
    I made a simple map and changed the sandy tile's terrain tag to 1. And then, I drew a strip of the sandy tiles onto the map. After that, I made an event that walked towards the sandy tile.

    So far, simple enough. Right?

    Okay, now here's the magic part.......

    I edited the event by adding a script call:
    Code:
    x = $game_map.events[@event_id].x
    y = $game_map.events[@event_id].y
    if $game_map.terrain_tag(x,y) == 1
      p 'Hey, I touched it!'
    end
    And then, I set the event to run by way of a 'parallel process', so it continually runs this check.

    This is a very simple test run. But it will bring up a message all the time the event is over the sandy tiles.

    :D Funny. You can have a @event_id value in a script call, and it recognizes the ID of the event using it! For over ten years, I never tried that.
     
    #2
    kaigames likes this.
  3. kaigames

    kaigames Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Portuguese.BR
    Primarily Uses:
    RMXP
    :thumbsup-left: THANK YOU VERY MUCH!!!!
     
    #3

Share This Page