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

[New Feature] Autoload Command Shortcut #1452

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

Conversation

psi-cmd
Copy link

@psi-cmd psi-cmd commented Dec 14, 2024

For selected units, pair the transport with infantry/vehicle.

  1. If vehicle loadable transports selected, it won't be loaded if there are vehicles that can only be paired with infantry within selection.
  2. It will always try to load the unit type with least amount of units first, eg. 2 GI and 3 GGI, it will match 2 GI to transport first.
  3. For transport with multiple seats, it will try to fill those seats "diversely".

@psi-cmd
Copy link
Author

psi-cmd commented Dec 14, 2024

(Falsely include irrelevent file that belongs to another feature)

@Aephiex
Copy link
Contributor

Aephiex commented Dec 14, 2024

  1. Is it possible we can have a default shortcut key for the autoload command?
  2. This doesn't seem to support garrisonable buildings and bio reactors. However if we add such support to it, we have to tell apart grinders from bio reactors, and we have to distinguish InfantryAbsorb and UnitAbsorb.
  3. This doesn't seem to support Ares features Passengers.Allowed=, Passengers.Disallowed=, Passengers.BySize=, and NoManualEnter= as well as it will still try to assign size 6 vehicles into a transport with size limit 3.
  4. Terror drones may not be auto-loaded into Flak Tracks this way. Maybe treat smaller units like they are infantries?
  5. It doesn't check if the passengers are mind controlled or are mind controlling something, in which case it is not allowed to enter a transport.

I solved 3, 4, and 5. See below for details.

@Aephiex
Copy link
Contributor

Aephiex commented Dec 14, 2024

When I select an amphibious transport on water and units on land at a same time and press the auto load button, the amphibious transport will move ashore all the way to the land unit and stop there. The land unit doesn't get into the transport. However, this is exactly the same behavior when I call a land unit to get into an amphibious transport on water, so this isn't really an issue.

The implementation is mindful. It directly gives enter order to selected units so everything will behave the same as if the player explicitly gave an enter order. It is very convenient to use, even I can now enjoy playing the Allies.

Copy link

github-actions bot commented Dec 14, 2024

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Aephiex
Copy link
Contributor

Aephiex commented Dec 14, 2024

Hello, made Ares tag support for you, and more.

psi-cmd#1

Effects:

  1. Transports with NoManualEnter=true will be viewed as if they didn't have passenger slots;
  2. If a transport has Passengers.BySize=false then every potential passenger is viewed as size 1;
  3. If a transport has Passengers.Allowed= and Passengers.Disallowed= defined then passengers unable to enter it will not try to get into it, as well as the auto assignment will never try to violent the SizeLimit=;
  4. Vehicle types with size <= 2 and passenger <= 0 are viewed as standard passengers like infantry types, and infantry types with size >= 3 are viewed as larger passengers like tanks;
  5. If a standard transport can't actually load anything due to its passenger filters, then just try to load it into larger transports;
  6. Mind controlled units and units mind controlling something can't be passengers at all.

Maybe we have to detect if Ares is present before we take compatibility with Ares tags?

@NetsuNegi
Copy link
Contributor

have you test in multiplayer game?

@psi-cmd
Copy link
Author

psi-cmd commented Dec 14, 2024

Hello, made Ares tag support for you, and more.

psi-cmd#1

Effects:

  1. Transports with NoManualEnter=true will be viewed as if they didn't have passenger slots;
  2. If a transport has Passengers.BySize=false then every potential passenger is viewed as size 1;
  3. If a transport has Passengers.Allowed= and Passengers.Disallowed= defined then passengers unable to enter it will not try to get into it, as well as the auto assignment will never try to violent the SizeLimit=;
  4. Vehicle types with size <= 2 and passenger <= 0 are viewed as standard passengers like infantry types, and infantry types with size >= 3 are viewed as larger passengers like tanks;
  5. If a standard transport can't actually load anything due to its passenger filters, then just try to load it into larger transports;
  6. Mind controlled units and units mind controlling something can't be passengers at all.

Maybe we have to detect if Ares is present before we take compatibility with Ares tags?

Wow, thanks for your work. I am not famillar with other features on transport loading and you help with the corner cases.
And also thanks for a clear documentation that explain things into details. 👍

For ares tags, maybe we could have the "original" default value for them. For example, NoManualEnter=False, Passengers.BySize=True are the default behavior without any MOD.

Ares tags support and smarter unit size logic and more
@psi-cmd
Copy link
Author

psi-cmd commented Dec 14, 2024

have you test in multiplayer game?

Not yet, trying to find someone for help.

@Aephiex
Copy link
Contributor

Aephiex commented Dec 15, 2024

For ares tags, maybe we could have the "original" default value for them. For example, NoManualEnter=False, Passengers.BySize=True are the default behavior without any MOD.

Yes, I defaulted every vehicle to allow maual enter and to count passengers by size.

@Aephiex
Copy link
Contributor

Aephiex commented Dec 24, 2024

It seems that you understand the abstract_cast. But I found some parts that can be omitted to avoid repeating check.

Thank you for your detailed review. I appreciate.

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.

8 participants