Skip to content

Fix find_placement function using addon_place=True #225

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

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

BurnySc2
Copy link
Owner

Fixes #223
Related to 1ec2d72

This change fixes find_placement function to work properly with addon_place=True

It can be tested by running the terran/onebase_battlecruiser.py example with the following code change:

if self.can_afford(UnitTypeId.STARPORT):
    position = await self.find_placement(
        UnitTypeId.STARPORT,
        near=cc.position - (3, 0),
        placement_step=1,
        addon_place=True,
    )
    if position is not None:
        await self.build(
            UnitTypeId.STARPORT,
            near=position,
        )

The - (3, 0) forces the function to find a valid position on the left of the main command center.

@BurnySc2 BurnySc2 merged commit 4b15dd9 into develop Jul 20, 2025
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why use AbilityId.TERRANBUILDDROP_SUPPLYDEPOTDROP as the addon_place ability value?
1 participant