Event interacting with other events

● ARCHIVED · READ-ONLY
Started by Symbol_ 4 posts View original ↗
  1. I have a security guard in my game, I want them to walk around and if one of the autonomous crooks fall within 1 square of the security guard event I want the crook to vanish and the security guard to carry on walking around looking for more crooks.

    Currently the only way I've managed to do this is have the security guard stationary, and have the variables read game data of the crooks X and Y position, then have conditional branches if the crooks fall on that part of the map.

    But ideally I'd want the security guard event to move around and catch the crooks. Any idea on how I'd pull this off?
  2. Try this, have variables checking for the crooks position and the guards position and have a conditional with this script. It will return true if the crook is in one of the 8 squares adjacent to the guard. Make sure to replace crook x/crook y/guard x/guard y with the proper variable ids.

    Code:
    (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y));
  3. not possible by default, you'll always need a parallel process for comparing event data.

    theoretically a plugin could be written to improve this, but that has a lot of other problems as well.

    The best solution might still be an event like you have so far, only switching to a different event page on detection and then have a pathfinding plugin to let the event find the path to follow the detected event.
    But even that won't be easy.
  4. Princess Bananabelle said:
    (($gameVariables.value(crook x)+1) === $gameV
    Princess Bananabelle said:
    Try this, have variables checking for the crooks position and the guards position and have a conditional with this script. It will return true if the crook is in one of the 8 squares adjacent to the guard. Make sure to replace crook x/crook y/guard x/guard y with the proper variable ids.

    Code:
    (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)-1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)+1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y)) || (($gameVariables.value(crook x)-1) === $gameVariables.value(guard x) && ($gameVariables.value(crook y)+1) === $gameVariables.value(guard y));

    Just want to give a personal thank you for such a fast response, this script works like a charm. Thank you so much.