Help - Search - Members - Calendar
Full Version: Event Colision
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
ziden
Hello.

Lets say i have an event witch a set route to move 10 times right, then 10 times left. In the middle of this route, i have a door, witch i want to be oppened whenever the event comes to it. The way ive tought of doing this was activate one event located in front of the door, witch "on event touch" start condition, that would switch the door off. But, however, when the event passes on the event at the front of the door, he doesnt activate the event... what am i doing wrong ?

ty for the atention

[]īs Ziden
stripe103
You don't have to have a event collision. It is just to check when the event reaches the door, and then make the same event control the door to open. Then after it has been opened, then you can make another Event Command to make it continue to walk.

Something like this:
CODE
@>Comment: Make the event walk to the door
@>Set Move Route: This event
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
@>Comment: Open the door
@>Set Move Route: [Door]
   :                              :$>Turn Left
   :                              :$>Wait: 4 frame(s)
   :                              :$>Turn Right
   :                              :$>Wait: 4 frame(s)
   :                              :$>Turn Up
@>Comment: Continue the walking
@>Set Move Route: This event
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
   :                              :$>Move Right
@>


Something like that maybe
Unka Josh
On a related note, "Event Touch" triggers when the event touches the player.

If you need to track when an event touches another event or a specific square, you need to have a Parallel Process event that uses Control Variables to assign the event's Map X and Y to variables, and then uses Conditional Branches to compare those variables with the coordinates of other events/specific tiles/whatever.
ziden
i did something like that, but with a simple distance script. If distance of an event is 0 from another mean theyr on the same square, but for that i would need that event ID. Is there no way to make an event touching another trigger withou needing specific variables for that event ? i will have like 12 doors n 15 npcs walking in/out of em, i would need something that can specify when ANY event is in determine when an event is there. Heres what ive tryed:

CODE
class Game_Event; attr_reader :event; end

class Game_Character
  
  def Portz(switch_num)
    frente = @y + 1
    traz = @y - 1
    
    if $game_player.x == @x and $game_player.y == frente
      return true
    else
      if $game_player.x == @x and $game_player.y == traz
        return true
      else
        if $game_map.events_xy(@x, frente).find {|e| e.event.name.include?('*')}
          return true
          print "bingo"
        end  
        if $game_map.events_xy(@x, traz).find {|e| e.event.name.include?('*')}
          return true
          print "bingo"
        end
      end
    end
  end
end


Then , in the 'bingo' i could use a switch to open the door, using the switch_num given by the command. But however, when i use the comand Portz(2) for example in an event its get me an error of undefined method Portz.

Also by this method to work i would have to put a '*' on events that could open the door.

Wtf is wrong ? I need a solution for this.
stripe103
May I just ask why you want to it that way. Since the event that moves don't move randomly(after what you said in the first post) you know when it will move in front of the door. If the door dosen't move that is.
ziden
im using a script that will find paths for characters. Ill use that to create a semi - real village, so npcs will have theyr own routines during day. Im using a single map for the whole village, and i made roofs like Tibia / Ultima Online ones, they get off when u get inside the house (so npcs can walk in/out at ease). The big deal is house doors. The npcs will have theyr path traced to INSIDE the house, they get stuck in the door front. Using something like mentioned this post, the door could automatically open and give the impression that the npc has opened the door.
stripe103
Oh.. that was not easy. I'll see what I can find out. Can't promise anything though.
Xzygon
Perhaps this is what you want?
Mithran's Event Approach Detect
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.