I have a player that is running on batteries. I’m creating power areas for him so if he is within the sphere of influence of one of these power poles then he’s being supplied with power.
I thought this would be simple but I’m having issues as follows:
Begin overlap → runs a custom event on the player that increases his energy by a given amount (works)
Begin overlap → runs a custom event on the player that decreases his energy by a given amount (works)
here’s the hard part. What if 2 of these poles overlap? The player enters the second one then leaves the first. This leaves him on battery power.
I thought I’d send the id of the current power pole so if he enters the second one before leaving the first, I can check the name and if the name is different, I set the current pole to the new pole. That worked kinda.
The issue is if he enters the second while still in the first, (he’s now in 2 areas that are overlapping), the id gets changed to the current area which should be the second, but he’s still in the first area because they are overlapping each other. Now he walks back into the first and because the id is now on the second, he’s without power.