How do I trigger Event Touch condition with Followers (in addition to Player)?

 

Hi all, I've been trying to figure this one out for a few hours but I'm relatively new to this. It seems simple, but it's just eluding me at the moment.

I'm experimenting with a physical encounter system (ie. you fight the monsters you touch on the map). This is easy to do with the Touch Event condition, but annoyingly this condition is not fired when the event (the monster) touches a Follower. I could hide your followers on "hostile" maps, but I feel that's a cop-out. And in any case, it would place an interesting disadvantage to having a large party, trying to slip past guards etc.

I've narrowed down where the condition is in the script to set off the trigger, I just can't seem to figure out how to include a check against followers occupying the spot too.

#-------------------------------------------------------------------------- # * Determine if Touch Event is Triggered #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) return if $game_map.interpreter.running? if @trigger == 2 && $game_player.pos?(x, y) start if !jumping? && normal_priority? end endI can see it checks against position with "$game_player.pos?". So how can I get it to start if it's a follower too?

(For what it's worth, I'm very new to scripting with RGSS3, but I am a longtime c# user)
Tsukihime has a script 'Follower Event Touch' which might show you how this is done.
Followers are being controlled by class Game_Followers in the game.

If you check there, you can see that it checks for:

follower.pos?(x, y)under collide?(x, y)

so .pos?(x, y) works for it too.

and game_player has included game_followers under @followers.

so i believe your script call to check for that will be something like:

$game_player.followers[N].pos?(x,y)Where N is the position in the caterpillar.

If that doesn't work, you might need to add event collision to the game_followers class or follower collision to the game_character/game_event class.
Looking over Hime's script and I think I get it now. Thanks so much!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-trigger-event-touch-condition-with-followers-in-addition-to-player.44881/