11/14/17

Stepping Stones

Last time, I spoke about having each person in your party activate an event they step over.  By default, only your leader can step over switches and activated them one.  I hoped to have something a bit more dynamic by having said switches activate for each character walking over it.

After designing my event/method to trigger for each character on a certain location, I know it works if an event or player steps on it, but it doesn't work for a the followers at the time.

First, I tried Himework's Follower Touch Event, which ideally lets events make contact with followers and execute the whole event.  The issues, though, is that the script only changes how the player's position is defined by including the position of followers.  Stepping didn't work, and I think that when it did, the player got damage for each other person who triggered the event (because I used the player position to determine player and follower position for each follower, so follower position was being called twice but used to execute the player's code when it matches).

Anyway, I came to realize that since I  was stepping on the event, it wasn't the event that was triggering me back, hence the position method wouldn't be useful here.  I narrowed the code to Game_Player's something_trigger_here and something_trigger_there methods.  trigger_there is used to check on events that are nearby (person) or over the counter (shopkeeper), but this is more useful when a player is facing the event, so not much leeway to put followers here.  trigger_here is used to check on events in the same location, though, like most floor traps, so this is what I actually need.  By default, it runs an event at the player's x and y, so all I had to do was add a small loop to also run an event at each follower's x and y.

However, you may have noticed that trigger_here(triggers) is called at least two times nearby, using [0] and [1,2].  Those numbers represent the triggers you can assign to the event, which in this case are:
0 - Action Button
1 - Player Touch
2 - Event Touch
So with the modification, if I press a button while one of my followers is still on the trap, the trap will activate. All I simply had to do was return/exit the method if the triggers argument includes a 0 in the array, making that method work only up to to the player in that case.  In fact, I should probably make Player Touch return as well in case I have floor traps that shouldn't be activated more than once.

Anyway, I should probably reequip the Follower Touch Event script but modify it so that I can have moving events touch my followers...maybe mod them further so that they can also touch other events (ie, tearing down walls.)

...Anyway, the events that can be touched by everyone falls into two categories: those that affect actors (players and events) and those that launch characters around.  Currently, I'll be using a number to determine effect types as the method to determine who gets hit looks sizable enough.

No comments:

Post a Comment