Feature description
It’s currently not always possible to know whether the local_player is attacking or defending in a round. I’d like for the roundStart event to get an additional variable that lets me know which of the two the local_player is doing.
Current workaround
The roster_XX
events provide you with the information of whether the local_player is on the Orange or Blue team.
The Orange team always starts on Defence. The Blue always on Attack. So that’s easy.
In Siege, the side-swap happens after three rounds. So you can know just by the team colour, what side (ATK or DEF) the player will play on, for the first six rounds.
However, after 6 rounds, if no winner is determined, you enter Overtime. And in Overtime, the ATK and DEF sides are randomly selected. This means there are four possible ways a match can play out:
- Blue: AAADDDADA
- Blue: AAADDDDAD
- Orange: DDDAAAADA
- Orange: DDDAAADAD
My current workaround is to literally ask the player what side they ‘received’ from the game, if Overtime occurs, through a pop-up window. That’s not ideal, of course.
Implementation recommendation
Simply expand the roundStart
game event to include information on what side (ATK or DEF) the player is playing. Thus:
{"event":{"name":"roundStart","data":{"side":"THE_CURRENT_SIDE"}}}
Or alternatively trigger an event at the start of round 7 (first overtime round) with something like:
{"event":{"name":"overtimeSide","data":”attack”}}
Technical recommendation
Pull from running process’ memory, I guess?
Feature potential
I have to admit, this is a pretty darn niche need. I’m probably the only developer ever to use it.
Possibility of exploiting
None. It’s all public information for all players in the match.