Skip to content
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

Fix Czar missing carrier auto deploy functionality #6549

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Nov 22, 2024

Issue

CZAR does not have the CARRIER category, so blueprints-units.lua external factory processing for carriers does not pick it up:

-- add order overrides to carriers
if unit.CategoriesHash['CARRIER'] then
-- override our transport function to display what we want
-- and exhibit new behavior
if not unit.General.OrderOverrides then
unit.General.OrderOverrides = {}
end
unit.General.OrderOverrides.RULEUCC_Transport = {
bitmapId = 'deploy',
helpText = 'auto_deploy',
behavior = 'AutoDeployBehavior',
initialStateFunc = 'AutoDeployInit',
statToggle = 'AutoDeploy',
}
-- add the toggle so it can be flipped to begin with
-- but add an order override to remove it from our orders table
if not unit.General.StatToggles then
unit.General.StatToggles = {}
end
unit.General.StatToggles.AutoDeploy = true
end

Description of the proposed changes

Testing done on the proposed changes

The button's description is corrected, and when you right click it gets highlighted and constructed units automatically deploy.
{E107CE8C-0027-4862-99E4-93C3A9E0314A}
{E6F41DE5-5E96-4EB5-A765-5367404447B9}

Additional context

This is the second bug I've seen because of CZAR being a flying carrier, the first being that intel/counterintel remains enabled for units inside the CZAR because its base class is that of an air transport and not a (naval) aircraft carrier.

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@lL1l1 lL1l1 added type: bug area: unit-blueprint related to issues in unit blueprints (*_unit.bp) feature: mobile factories related to mobile factory functionality labels Nov 22, 2024
@lL1l1 lL1l1 added this to the Development I of 2025 milestone Nov 22, 2024
@lL1l1 lL1l1 marked this pull request as ready for review November 22, 2024 00:26
@lL1l1 lL1l1 changed the title Fix Czar's external factory's auto deploy button Fix Czar missing carrier auto deploy functionality Nov 22, 2024
@Garanas
Copy link
Member

Garanas commented Nov 22, 2024

What would be the downside of giving it the CARRIER category? What are the side effects?

@lL1l1
Copy link
Contributor Author

lL1l1 commented Nov 22, 2024

CARRIER is frequently used as if it is implicitly a naval unit category for AI and target priorities. It's more like the DESTROYER, CRUISER, and BATTLESHIP categories where it signals a rather specific type of unit than the general ability to carry aircraft.

@Garanas
Copy link
Member

Garanas commented Nov 22, 2024

I understand. It may also mess up existing category queries where they expect naval-based carriers, but do not specify the naval category.

@clyfordv clyfordv self-assigned this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: unit-blueprint related to issues in unit blueprints (*_unit.bp) feature: mobile factories related to mobile factory functionality type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants