Skip to content

Dropship Loadout remake#2270

Open
FS-21 wants to merge 23 commits into
Phobos-developers:developfrom
FS-21:feature/dropship-loadout
Open

Dropship Loadout remake#2270
FS-21 wants to merge 23 commits into
Phobos-developers:developfrom
FS-21:feature/dropship-loadout

Conversation

@FS-21

@FS-21 FS-21 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
dropship_loadout_default_view

Note: Isn't a logic restoration, is a full remake of the unfinished TS logic but expanded (why not).

Note 2: Due to the long list of variables for customizing this logic please check the documentation of this PR for updated content.

General Features of this single player logic:

  • Can be opened before the game start, during the game with a map action & with a SW.

  • You can choose a fixed budget in this window or use the player's own economy.

  • UI feedback on cameos (blue for dragging, purple to indicate restricted/forbidden, red for selling, green for buying, yellow to indicate the last unit purchased).

  • Drag-and-drop mechanics: Drag units from the right panel to the transports to buy them. Drag them from the transports back to the right panel to sell them.

  • Starting units can be set to appear in the transport at no cost to the player.

  • Fixed units can be set so they cannot be sold.

  • Each transport can have size limits to prevent heavy units from being loaded.

  • All SHP graphics can be replaced with their PCX versions.

  • Tooltips with unit information, including name, availability, cost, and description.

  • Countries can have their own graphics customization and unit lists that overwrite the map's [Basic] configuration. This doesn't include the Superweapons case.

  • Map Action 900 to open the Dropship Loadout window during the match. A different list of available units can be displayed each time this map action is called.

  • Map Action 901 to launch the specified transport (if available). Regarding the initial Team configuration: Although the Taskforce is dynamically generated with the selected transport, the Team must be configured by indicating the starting waypoint used to spawn the transport, and the user must configure the script that the transport will execute.

  • Superweapons can be used to open this Dropship Loadout window (capped to only 1 transport), and the transport launch can be executed via a separate SW from the one used to open the window. Note that the initial screen & Map actions doesn't share the graphics and unit lists with the superweapons data, both methods are independent.

  • Can be used any air/ground/Subterranean transport.

FS-21 added 17 commits August 21, 2025 14:44
- Money updated after closing the window
- Chosen units are stored for the future Map action execution
- Added map action "CreateDropshipLoadoutTransport" for launching 1 selected dropship.
- DropshipLoadout.Carriers for a custom list of dropships.
- New tags have the prefix "DropshipLoadout."
If any of these are set then overwrites the default filename used by this window, Extension included too:

DropshipLoadout.UpArrow
DropshipLoadout.Down
DropshipLoadout.Loadout
DropshipLoadout.PilotLit
DropshipLoadout.Palette
DropshipLoadout.Background
DropshipLoadout.DGreenList
- New GetAnimationPCX function for returning a std::vector of contiguous PCX files (with sufix 0000.pcx,  0001.pcx,  0002.pcx ...)
- New scenario tags:
DropshipLoadout.BackgroundPCX
DropshipLoadout.UpArrowPCX
DropshipLoadout.DownArrowPCX
DropshipLoadout.LoadoutPCX
DropshipLoadout.PilotLitPCX
DropshipLoadout.DGreenListPCX
DropshipLoadout.DGreenListPCX is the animation related to sidebar clicks.
…out window (units, themes, PCX graphics, etc...).

Moved GetAnimationPCX() into GeneralUtils.h
…section

DropshipLoadout.SidebarCameoLocations
DropshipLoadout.DropshipCameoLocations
Added support for tags in map's Basic section & Countries:
DropshipLoadout.DGreenAnimationsCount
DropshipLoadout.DGreenLocation%d
DropshipLoadout.PilotLitLocation
DropshipLoadout.LoadoutLocation
DropshipLoadout.DownArrowLocation
Other details
DropshipLoadout.BuyClickSound=  ; Defaults to [AudioVisual] -> GenericClick
DropshipLoadout.SellClickSound=  ; Defaults to [AudioVisual] -> SellSound
DropshipLoadout.ArrowsClickSound=  ; Defaults to [AudioVisual] -> GUITabSound
And added documentation.
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

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.

@TaranDahl TaranDahl added ❓New feature ⚙️T2 T2 maintainer review is sufficient labels Jun 25, 2026
Otamaa
Otamaa previously requested changes Jun 25, 2026

@Otamaa Otamaa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleae review and apply the change requested to the whole code , since the pattern are repeated all over the place , thanks .

Comment thread src/Misc/Hooks.DropshipLoadout.cpp Outdated

static ShapeButtonClass* CreateShapeButton(unsigned int nID, int nX, int nY, int nWidth, int nHeight, bool bIsAlpha)
{
auto const pButton = GameAllocator<ShapeButtonClass>().allocate(1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont really understand this part , why dont use GameCreate<ShapeButtonClass> ? , also for the 0x69DD30 are you sure that is correct args ? , the IDB it written like this :
ShapeButtonClass(ShapeButtonClass *this, int id, ShapeHeaderStruct *shape, int x, int y, int w, int h, char a8)

@FS-21 FS-21 Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because when I tried to compile in Release the game always crashed (I only could compile & run in Debug). I had to use Gemini AI for finding the annoying crash problem:
image
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah , YRPP has the bugged CTOR for sure, but iam not sure where the AI assume it to be the ConverClass* pDrawer since in our IDB there is no such construtor avaible but instead at the 0x69DD30 -> ShapeButtonClass::ShapeButtonClass(int id, ShapeHeaderStruct *shape, int x, int y, int w, int h, char a8) , which is the correct args count of 7 .

Now each transport can have customizable slots istead of following the generic slots size. So one transport can have 1 slot, another 4, another 8...
If DropshipLoadout.DropshipN.CameosCount isn't set DropshipLoadout.DropshipCameosCount will ve used as generic fallback.
@FS-21

FS-21 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Sorry but I added a new variable that I consider useful for missions:

Now each transport can have customizable slots istead of following a generic slots size (DropshipLoadout.DropshipCameosCount).

So one transport can have 1 slot, another 4, another 8...
If DropshipLoadout.DropshipN.CameosCount isn't set then DropshipLoadout.DropshipCameosCount will be used as generic fallback.

@Phobos-developers Phobos-developers deleted a comment from coderabbitai Bot Jun 26, 2026
- For customizing or localizing the interface strings, you can add the following entries to your `.csf` file:
  - `TXT_DROPSHIP_CREDITS` - The text for the credits/money label. Default value: `Credits: %d`
  - `TXT_DROPSHIP_START_MISSION` - The text prompting the player to start the mission. Default value: `Press SPACE to start the mission`
  - `TXT_DROPSHIP_AVAILABLE` - The label text for availability in the tooltip. Default value: `Available: `
  - `TXT_DROPSHIP_COST` - The label text for unit cost in the tooltip. Default value: `Cost: `
@FS-21

FS-21 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

I really forgot unharcode the texts with CSF strings:

  • For customizing or localizing the interface strings, you can add the following entries to your .csf file:

    • TXT_DROPSHIP_CREDITS - The text for the credits/money label. Default value: Credits: %d
    • TXT_DROPSHIP_START_MISSION - The text prompting the player to start the mission. Default value: Press SPACE to start the mission
    • TXT_DROPSHIP_AVAILABLE - The label text for availability in the tooltip. Default value: Available:
    • TXT_DROPSHIP_COST - The label text for unit cost in the tooltip. Default value: Cost:

    Now I really feel I can't add more features.

Previously, when the player's initial units pool became empty (either by launching the transport or selling the units), opening the UI again would check `empty()` and reinitialize the pool from the INI defaults, allowing infinite units.
Introduced `DropshipLoadout_InitialUnitsSet` and `DropshipLoadout_SWInitialUnitsSet` flags in `HouseExt` to ensure initialization only runs once per match.
@Otamaa Otamaa dismissed their stale review June 26, 2026 11:46
  • Suggestion applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❓New feature ⚙️T2 T2 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants