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

Enable paying up front in Production queue #21295

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

Porenutak
Copy link
Contributor

This PR implements some features thats D2k Starport will need.
In OG D2k Starport tab behaves like this;

  • you must pay full Unit Price up front.
  • Unit Icon is enabled only if you have enough money at the moment. If you dont unit icon is disabled.
  • When you reach max capacity all unit icons become disabled and you can click only on Purchase Icon.

This PR implements first two steps. It adds MoneyUpFront options into the ProductionQueue.

Example how its work on ClassicProductionQueues:

2024-01-10.16-54-16.mp4

Example how its work with my LUA Starport implementation:

2024-01-10.16-53-15.mp4

Im not sure if this is the right way to code this, so feal free for suggestions.

@PunkPun
Copy link
Member

PunkPun commented Jan 11, 2024

related #7055

@MustaphaTR
Copy link
Member

Generals Alpha already has a similar logic to make the actor paid fully when queued, as that's how it worked in Generals (the boolean is called InstantCashDrain there). Tho, it does not disable the icons, which was also not the case in original D2k for Starport. Icons only blacked out if you didn't have any of the units in stock or you've passed the total/per unit queue already. So i don't think that's something we want here, and even if we would want to keep the logic, it should be tried to a seperate value imo, so it can be enabled/disabled independent from MoneyUpFront.

@Porenutak Porenutak changed the title Starport Prerequsites Enable paying up front in Production queue Jan 18, 2024
@Porenutak
Copy link
Contributor Author

Porenutak commented Jan 18, 2024

  • fixed Resources to Cash exploit
  • Renamed variables according to @penev92 suggestion
  • add option to not disable icons when players have not enough money

@Porenutak
Copy link
Contributor Author

There was concerts about how this PR lead forward to d2k starport, so lets me adress it here:

  • Creating new BulkProductionQueue looks pretty strait forward, with new Order type "purchase"
  • But te widget part is total unknow to me and I dont know how to move forward here. Starpot definitly need working purchase button.

But I still think this PR hold by its own, because:

  • its allow to LUA starport implementation to work same as OG
  • its could be interesting for modder to make ORA production similar to games like Starcrat or Warcraft

This was referenced May 12, 2024
@Porenutak
Copy link
Contributor Author

Porenutak commented Jun 11, 2024

Removed BlockIconsIfInsolvent key. All unaffordable icons are blocked by default. Except for Icons that are already queued.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

It is weird that you can't even go to a tab if you don't have enough money.

OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs Outdated Show resolved Hide resolved
@Porenutak Porenutak force-pushed the Starport-Prerequsites branch 2 times, most recently from 820fdb3 to 7734d98 Compare June 11, 2024 13:09
@Porenutak
Copy link
Contributor Author

It is weird that you can't even go to a tab if you don't have enough money.

Fixed, but not sure if this is the best solution.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

yeah, that looks about correct, left some comments.

OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs Outdated Show resolved Hide resolved
Fix tab availability on low money

Co-Authored-By: Gustas <37534529+PunkPun@users.noreply.github.com>
@PunkPun PunkPun merged commit ccb1bd7 into OpenRA:bleed Jun 17, 2024
3 checks passed
@PunkPun
Copy link
Member

PunkPun commented Jun 17, 2024

changelog

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.

None yet

3 participants