Sensor that detects non-player events

Discussion in 'JS Plugin Requests' started by watermark, Jan 9, 2019.

  1. watermark

    watermark Veteran Veteran

    Messages:
    545
    Likes Received:
    477
    First Language:
    English
    Primarily Uses:
    RMMV
    There exists sensor plug-ins (Moghunter, Lyson) that triggers when the player gets within a specified tile range of an event. Is there one that could do the same thing but with other events? If not could someone make one or mod an existing one to do so? That would be really awesome.

    What this could be used for is for puzzles. For example I could push a metal ball event close to a magnet event, and the magnet would auto-detect the ball and pull it when it's within range.
     
    #1
  2. VeryXInh

    VeryXInh Veteran Veteran

    Messages:
    90
    Likes Received:
    114
    First Language:
    Japanese
    Primarily Uses:
    RMXP
    Or you can simply do it with parallel event :uswt:
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,586
    Likes Received:
    11,303
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    It would cause a great amount of lag. The way the engine detects events within range of the player now is already very inefficient. You would be better off putting the logic on your metal ball event so that every time it's pushed, it detects the proximity, then moves towards the magnet when within range. You could do this easily using regions to specify when the event is in range, and you don't even need a parallel event, because you know exactly when it could move into range (which is when you push it).
     
    #3
  4. ozubon

    ozubon Villager Member

    Messages:
    21
    Likes Received:
    12
    First Language:
    English
    Primarily Uses:
    RMMV
    Here is an attempt at making the code I use for my game (a little) more user friendly. It plucks event names instead of specific ID's so it is event spawner compatible. There is no plugin parameters, you set it up in the file so it helps to be able to read and edit some basic javascript. I tried to explain how to use it as best as I could however :kaoswt2:

    OzuSensor:

    It might cause lag in a standard project, IDK. Here it updates with events. For my game I have it set up so it's only activated when the player moves which works fine for me. But I figured that's not how most people want it to work so I've redacted that part for the upload.

    I recommend using it together with https://forums.rpgmakerweb.com/index.php?threads/iavra-self-variables.51106/ so you can do $gameSelfVariables.setValue([$gameMap.mapId(), s.eventId(), "burning"], 1) and things like that.
     
    Last edited: Jan 9, 2019
    #4

Share This Page