- Joined
- Sep 21, 2017
- Messages
- 462
- Solutions
- 1
- Reaction score
- 237
- Points
- 55
- Favorite Pinball Machine
- Indiana Jones (Williams)
I'm trying to create something which can act like a Trigger that tells me when one or more balls are in the trigger area and leave the trigger area. I'm only wanting to position the "mirror balls" when the balls on main playfield are within the mirror region. Currently I'm using NewtonPhysicsTick to position the mirror balls.
Options:
1. I currently have this done with a custom model of Trigger type (blue below). This is good for one ball, but FP doesn't seem to support sending a Hit event when a second ball enters the area if the first ball is already there. The limitation makes sense, but I'm just curious if there is something I'm missing.

2. I was considering a second approach by creating a Toy FP object which has 4 hit areas, and then use fpEventID in the Hit event to see what side was "hit" and check if the ball hit is different than the ball I'm tracking, and if so, start tracking the additional ball in the area (up to 4). The problem is that the FPM Editor doesn't seem to show multiple collision shapes when using a Toy object type. So, I assume that generic/custom Toy objects actually do not support doing this.


3. Of courser Occam’s razor: Since I know there is a max of 4 balls in Theatre of Magic, just write code which tracks a) the number of balls in play, and b) the location of each ball in play. And then loop through the active balls to see if the position of the ball is within the "trigger area" and I perform the mirror position logic. The problem here is that while rectangle math is easy, I was hoping to get a little more creative in my trigger model where it isn't a regular rectangle. Then the math becomes challenging if I want to calculate if the ball is within the orange area below:

Any thoughts? Any workarounds to the issues found in #1 or #2 above? I wish there was a BAM function which I could say "Is this x, y, z coordinate contained within a 3D model"
Options:
1. I currently have this done with a custom model of Trigger type (blue below). This is good for one ball, but FP doesn't seem to support sending a Hit event when a second ball enters the area if the first ball is already there. The limitation makes sense, but I'm just curious if there is something I'm missing.

2. I was considering a second approach by creating a Toy FP object which has 4 hit areas, and then use fpEventID in the Hit event to see what side was "hit" and check if the ball hit is different than the ball I'm tracking, and if so, start tracking the additional ball in the area (up to 4). The problem is that the FPM Editor doesn't seem to show multiple collision shapes when using a Toy object type. So, I assume that generic/custom Toy objects actually do not support doing this.


3. Of courser Occam’s razor: Since I know there is a max of 4 balls in Theatre of Magic, just write code which tracks a) the number of balls in play, and b) the location of each ball in play. And then loop through the active balls to see if the position of the ball is within the "trigger area" and I perform the mirror position logic. The problem here is that while rectangle math is easy, I was hoping to get a little more creative in my trigger model where it isn't a regular rectangle. Then the math becomes challenging if I want to calculate if the ball is within the orange area below:

Any thoughts? Any workarounds to the issues found in #1 or #2 above? I wish there was a BAM function which I could say "Is this x, y, z coordinate contained within a 3D model"