GOOC - Game Oriented Object C
GOOC - Game Oriented Object C
14.2. Multiple-Object Event Test
14.2. Multiple-Object Event Test
When using event broadcasting or cascading, it's likely that you can encounter a scenario where you want only a specific set of objects to receive the event. The parameter that is used to determine the target object for those two types of events is instead used as the type of test to be run during event cascading or broadcasting1.
The test routine keeps track of how many objects have passed the test. This does not necessarily relate to the amount of objects that have received the event.
There are six types of test.
- 0 - Pass test and send event.
- 1 - Pass test and send event if sender and receiver hitboxes clip.
- 2 - Pass test and send event if sender is inside the receiver's hitbox clip.
- 3 - Same as 2, but only if the receiver's object category is 3 or 4.
- 4 - Same as 1, but only if the receiver's object category is 3 or 4.
- 5 - Pass test if: The receiver's object category is 3 or 4 and the receiver's hitbox clips with a bounding box with width, height and depth determined by the sender's trot vector. Send event if less than two objects have passed the test or if it's the 5th or any multiple of 5 (10, 15, etc.).
- Default - Same as 0.
1 Event cascading does use a target object, giving this field double duty in this scenario. Pay very close attention to how you use it!