Follow our Instagram!
Curious about what we're currently doing about bots? Check out the latest updates from staff in this thread.
Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
View the suggestions ordered by popularity here.

Done Add Ident to request.active structs

Hey guys,


Back with another random API suggestion to make life easier (well, my life at least :blobshrug: ).

When a |request|REQUEST arrives as detailed here https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md we're told the moves available like so
```
"active": [
{
"moves": [
{
"move": "Light Screen",
"id": "lightscreen",
"pp": 48,
"maxpp": 48,
"target": "allySide",
"disabled": false
},
[...]
]
}
],
```
As well as additional stuff like zmoves etc etc.

Pokemon on the side are given as Active or not like:
```
[..]
"ident": "p2: Ledian",
"active": true,
[..]
```

I'd like to identify the pokemon referenced by data blocks in 'active'.

In singles battles this isn't a problem (since only one has active:true) but in double/triple battles things get slightly more .. fun .. to figure out. At the moment I figure this out by checking who is active on the side and what move(s) they have (yes writing this pains my soul). This also raises the question of what happens if a player in doubles uses two pokemon with the same moveset :psygrump: (I don't know why someone would do this but .. hey).

I'd like to suggest that the structs in 'active' give some kind of reference to a pokemon in 'side' (perhaps the 'ident' field, their index on the team or .. anything really). Or of course we could go the other way and have pokemon in 'side' reference their active position (like p2a, p1b) or something.
active and side should be in the same order – the first pokemon in active is the first pokemon in side, etc.
Back Top