-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of Gifting API #336
Comments
Adding discussion from Discord
|
I've done some research and thinking for this. Firstly, the gifting API has the drawback for us that we don't have a natural opportunity for users to type a recipient name, which is required. I think we can instead make a custom format, roughly based on Wonder Trade features from Pokemon AP implementations. Secondly, I found it's possible to use the bot to vastly reduce the amount of necessary communication. The following is testing code for understanding the bot's capabilities, with the caveat that abilities currently don't work and require a (2 line) patch to the bot. I must've broken this when I cleaned up the bot a long time ago. for unit in self.all_own_units():
if unit.name == GIFTING_NYDUS:
sc2_logger.info(f"Gifting Unit: {unit}")
# Check for orders (for buildings this is research or training)
if not unit.is_idle:
sc2_logger.info(f" Order: {unit.orders[0].ability.link_name}") # button_name is probably more useful
# Check for passengers
passengers = unit.passengers
if len(passengers) > 0:
for passenger in passengers:
passenger_type = passenger._type_data
sc2_logger.info(f" Passenger: {passenger.name} (Tag {passenger.tag}): Type {passenger_type.name}") With
With
With these two in mind, I think the following design would work and is achievable:
When the client gets a "send" command:
When the client gets a "get" command:
If we run into message throughput issues from people spamming the buttons (though I suspect data communication will add a natural delay), just delaying the research cancel in SC2 (or adding a cooldown) would give enough downtime. |
What feature would you like to see?
https://discord.com/channels/731205301247803413/1101186175722598521/1304709275179945995
https://discord.com/channels/731205301247803413/1134306496042258482
The text was updated successfully, but these errors were encountered: