Long story short, I have an Infection gametype and wanted to add a 'golden snitch' to it. There's a gold golf ball on one side of the map and a cup on the other and I wanted it to give 1000 points to the player who scored it. (Currently you get one point per second of survival). Trying to reverse-engineer Battle Golf scoring so far hasn't worked and I'm not sure if changing individual player scores is even possible because I ran into a similar issue with a mini-game I tried making before.
Sorry for the late response. There's no way to determine who was the last one to hit or shoot objects. We can give the score to the nearest player. Battle Golf just knows which team each ball belongs to and gives that team the point. If you use the Oddball Skull or Assault Ball, then you can add a small boundary to it and use that to identify the last player to carry it. We already have the Ball that detects the player plus the goal, and can add on the player scoring to it. If you still want to use the golf ball we might be able to come up with something good enough. Let us scripters know what you want and we'll see what we can do.
that's sorta what I wsa going to suggest for the assault ball but never got around to typing it OP, I am using that method for the "Eternity Ball" (a shield drain item) that is in the map "Eternal Flame". Sufficing to say, there is a lot of gritty detail to what you have asked, and it is not as straightforward as you might imagine. We can determine which team last held it by virtue of the last holder being on that team. You can assign a value to a Global Variable based on which team that is, and then have a scoring scheme set up for detecting when the ball enters the cup and then depending on the value of that variable, score for the appropriate team. I think golf balls can also change colors... so if we can keep that ball, you could easily visually indicate which team currently controls the ball. However, it seems like you want to "hit" the ball vs "pick up" the ball, so detection suddenly becomes more problematic. You have to find a scenario where only one player at a time can be detected, and therefore, this becomes hard to code from a situational, circumstantial point of view as well as having to work with some quirks within H5's scripting. You see, the reason the assault ball is best is because the game actually lets you pick it up, AND it rolls. a player holding it actually penetrates a very small item boundary and no other player could possible also occupy that same space. Conversely, with the golf ball, you'd need a much larger detection boundary, and as a result, you could (and will) get situations where even though one player hits it, another player is also close enough to make the script scheme think they are the one who hit it, or that there are two or more. that will cause problems, obviously. So, As my friend here suggested, we need to know more about what you really need, and what you are willing to live with. Good luck,
I'm going to abandon this aspect of the game because what I want isn't possible with the options we have.
There might be something we can do... I just don't know yet because I first need to know what the players can use to move the ball, how the cup is positioned, and how you define which player scored it. Individual scoring is straightforward. We can mark which player was the last to get within striking distance. Can't really know if a player uses projectiles, grenades, etc on it. Golf clubs and hammers, anything with knockback might let them move it into the cup from a little distance away. Let us know what the deal is and we can tell ya what we can do or not do for it.
Keep it simple. Make a scoring goal for each team. If someone knocks it into the wrong hole .. their fault