Skip to content

Add ability to choose a random color of selling shop items#13634

Merged
Gymnasiast merged 1 commit into
OpenRCT2:developfrom
8street:Addi_shop_item_random_color
Jul 12, 2022
Merged

Add ability to choose a random color of selling shop items#13634
Gymnasiast merged 1 commit into
OpenRCT2:developfrom
8street:Addi_shop_item_random_color

Conversation

@8street

@8street 8street commented Dec 23, 2020

Copy link
Copy Markdown
Contributor

I'd added ability to choose a random color of selling shop items: tshirts, hats, balloons, umbrellas. Save and load works correctly. Old saves also works.

random

This PR should Close #1438

@duncanspumpkin

Copy link
Copy Markdown
Contributor

I'm not a fan of adding more additional special cases to the sv6 format.

@Gymnasiast Gymnasiast self-requested a review December 23, 2020 10:36
@8street

8street commented Dec 23, 2020

Copy link
Copy Markdown
Contributor Author

Сan you suggest your own idea, where to save the state of this option?

@duncanspumpkin

Copy link
Copy Markdown
Contributor

@8street i know its been a while but would you like to retarget this feature at the new save format branch. I've no issues with it on the NSF.#10664

@8street

8street commented Jun 30, 2021

Copy link
Copy Markdown
Contributor Author

Thank you for reminding. I will try do it next week or another week later.

@Gymnasiast Gymnasiast changed the base branch from develop to new-save-format July 1, 2021 10:20
Comment thread src/openrct2/ride/Ride.h Outdated
Comment thread src/openrct2-ui/windows/Ride.cpp Outdated
@8street

8street commented Jul 3, 2021

Copy link
Copy Markdown
Contributor Author

For some reason, the game cannot load files after updating to new-save-format branch. Therefore, I cannot test the changes. The debug console outputs a lot of lines:

Unable to load park: NinSFOT.sv6
Failed to load: "NinSFOT.sv6" for the title sequence.
[rct2.terrain_surface.grass] Object not found.
[rct2.terrain_surface.sand] Object not found.
[rct2.terrain_surface.dirt] Object not found.
[rct2.terrain_surface.rock] Object not found.
[rct2.terrain_surface.martian] Object not found.
[rct2.terrain_surface.chequerboard] Object not found.
[rct2.terrain_surface.grass_clumps] Object not found.
...

Also:

Unable to load park: E:\Steam\steamapps\common\RollerCoaster Tycoon Deluxe\Scenarios\sc18.sc4
Failed to load: "Ivory Towers" for the title sequence.
Unable to load any parks from rct1.
ERROR[E:\git\OpenRCT2\src\openrct2\rct1\S4Importer.cpp:615 (S4Importer::AddAvailableEntriesFromSceneryGroups)]: Cannot find object rct2.scenery_small.roof5
ERROR[E:\git\OpenRCT2\src\openrct2\rct1\S4Importer.cpp:615 (S4Importer::AddAvailableEntriesFromSceneryGroups)]: Cannot find object rct2.scenery_small.roof7
ERROR[E:\git\OpenRCT2\src\openrct2\rct1\S4Importer.cpp:615 (S4Importer::AddAvailableEntriesFromSceneryGroups)]: Cannot find object rct2.scenery_small.brbase
ERROR[E:\git\OpenRCT2\src\openrct2\rct1\S4Importer.cpp:615 (S4Importer::AddAvailableEntriesFromSceneryGroups)]: Cannot find object rct2.scenery_small.roof1

Also:

...
: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2ww.scenery_wall.wwind03.json'
Object conflict: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2.ww.wwind04.json'
: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2ww.scenery_wall.wwind04.json'
Object conflict: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2.ww.wwind05.json'
: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2ww.scenery_wall.wwind05.json'
Object conflict: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2.ww.wwind06.json'
: 'E:\git\OpenRCT2\bin\data\object\rct2ww\scenery_wall\rct2ww.scenery_wall.wwind06.json'
2087 object conflicts found.

The file paths are correct. The develop branch is working fine. Can someone help me?

@duncanspumpkin

Copy link
Copy Markdown
Contributor

Yes its a bit of a pain switching between develop and new-save-format due to the changes in the objects. You need to redownload your objects and delete the old ones. (I find the easiest way to test is to just download the portable build from the github actions saves having to delete things)

@duncanspumpkin

Copy link
Copy Markdown
Contributor

You'll also need to save your variable into the park file. i.e just modify here to add in the new member variable.

cs.ReadWrite(ride.music_position);

@8street

8street commented Jul 3, 2021

Copy link
Copy Markdown
Contributor Author

I find the easiest way to test is to just download the portable build from the github actions saves having to delete things

I'd downloaded portable files and put them in OpenRCT2\bin folder. Objects are not loaded anyway. I see a black screen instead of a park. But main menu is visible. How can I delete objects manually? I have not found any menu that is responsible for objects.

UPDATED: I figured it out. I had to delete the OpenRCT2\bin\data\object folder first. Sorry for trouble.

@8street 8street requested a review from duncanspumpkin July 3, 2021 08:41
@8street

8street commented Jul 6, 2021

Copy link
Copy Markdown
Contributor Author

Can be merged I guess.

Comment thread src/openrct2/actions/RideSetAppearanceAction.h Outdated
@duncanspumpkin duncanspumpkin added the testing required PR needs to be tested before it is merged. label Jul 6, 2021
@duncanspumpkin

Copy link
Copy Markdown
Contributor

This would normally break replays but as this is NSF we don't have replays recorded. So no change required for that. Will require a network version bump though. Increment the number in NetworkBase.cpp

@duncanspumpkin duncanspumpkin added the network version Network version needs updating - double check before merging! label Jul 6, 2021

@duncanspumpkin duncanspumpkin 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.

Still need to do some testing of this but code is fine

Comment thread distribution/changelog.txt Outdated
Comment thread src/openrct2/ParkFile.cpp Outdated
Comment thread src/openrct2-ui/windows/Ride.cpp Outdated

@Gymnasiast Gymnasiast left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apart from the line notes, there are some things I immediately noticed:

  1. It allows setting a random colour for ice creams, which of course makes no sense. The best way to solve it, I think, is by adding a shop item flag (IS_RECOLOURABLE), set it for balloons/umbrellas/t-shirts/hats and only show the toggle if that flag is set.
  2. You reused a "random" string that was completely unrelated. While it just happens to be the same in English, this does not apply for other languages. Please just introduce a new string "Random colour" and use that.
  3. The colour dropdown is not disabled when this option is checked, which is confusing
  4. When the option is selected, the shop item preview goes berserk, cycling through hundreds of colours each second. Cycling through them might be nice, but obviously not at this rate - taking the date in days and modulo’ing it by the number of colours might be a good alternative.

@8street

8street commented Jul 13, 2021

Copy link
Copy Markdown
Contributor Author
  1. The colour dropdown is not disabled when this option is checked, which is confusing

This color dropdown changes а store color.
I'll see what I can do on your other comments later.

@8street 8street marked this pull request as draft July 13, 2021 16:02
@8street

8street commented Jul 15, 2021

Copy link
Copy Markdown
Contributor Author

I added the "IS_RECOLOURABLE" flag as requested. Not really a good solution, but it works. Perhaps someone will suggest a better solution for polling all shop items in the store for this flag.

Comment thread src/openrct2-ui/windows/Ride.cpp Outdated
@Gymnasiast

Copy link
Copy Markdown
Member

I added the "IS_RECOLOURABLE" flag as requested. Not really a good solution, but it works. Perhaps someone will suggest a better solution for polling all shop items in the store for this flag.

I’m curious, why do you think it’s not a good solution? We will most likely have more stalls in the future where the stall itself can be recoloured but the item cannot, so it seems to me that simply adding a flag is the cleanest way to go.

@8street

8street commented Jul 16, 2021

Copy link
Copy Markdown
Contributor Author

I’m curious, why do you think it’s not a good solution?

Adding a flag is not bad in itself. But a best solution here would be like GetRideDescriptor(ride).HasRecolourableItems() method or something like that. Inside this method, we would iterate over all sold items. I'll try to implement this if you don't mind.

@duncanspumpkin

Copy link
Copy Markdown
Contributor

@8street we eventually want to make ride type descriptors into objects that can be generated by users. Using flags for this is generally the way we would handle things like this.

@duncanspumpkin duncanspumpkin force-pushed the new-save-format branch 2 times, most recently from 35b62be to 6b25b1d Compare October 28, 2021 20:42
@duncanspumpkin duncanspumpkin force-pushed the new-save-format branch 2 times, most recently from c29194c to 9fd37c1 Compare November 14, 2021 21:01
@Gymnasiast Gymnasiast changed the base branch from new-save-format to develop July 12, 2022 19:38
@Gymnasiast Gymnasiast force-pushed the Addi_shop_item_random_color branch from c0eba51 to 4c63487 Compare July 12, 2022 20:16
@Gymnasiast Gymnasiast force-pushed the Addi_shop_item_random_color branch from 4c63487 to e1c93be Compare July 12, 2022 20:18
@Gymnasiast

Copy link
Copy Markdown
Member

I have reworked the PR to use a lifecycle flag instead of abusing an 8-bit integer.

Comment thread src/openrct2-ui/windows/Ride.cpp Outdated
Co-authored-by: 8street <nikolai_e@rambler.ru>
@Gymnasiast Gymnasiast force-pushed the Addi_shop_item_random_color branch from e1c93be to fd711fc Compare July 12, 2022 21:54
@Gymnasiast Gymnasiast enabled auto-merge (squash) July 12, 2022 21:55
@Gymnasiast Gymnasiast merged commit 213696e into OpenRCT2:develop Jul 12, 2022
@Gymnasiast Gymnasiast added this to the v0.4.2 milestone Jul 12, 2022
@telk5093 telk5093 mentioned this pull request Jul 15, 2022
22 tasks
Gymnasiast added a commit that referenced this pull request Oct 5, 2022
- Feature: [#6326] Ability to load .SV6 files from RCT Classic that have more than 9601 guests.
- Feature: [#6570, #10860, #17929] Fully support RollerCoaster Tycoon Classic as a RCT2 base install path.
- Feature: [#13634] Add ability to sell merchandise in random colours.
- Feature: [#16164] Add new track elements for Flying Coaster and Lay-Down Coaster and add paint code for more elements.
- Feature: [#16283] Added parkinfo command line tool to list objects in a save file.
- Feature: [#16662] Show a warning message when g2.dat is mismatched.
- Feature: [#17107] Ride operating settings can be set via text input.
- Feature: [#17638] Added Zero G rolls, medium loops and large corkscrews to the Hybrid and Single-Rail coasters.
- Feature: [#17821] [Plugin] Add API for track subpositions and vehicle subposition.
- Feature: [#17877] Add three real-life flying roller coaster colour schemes.
- Feature: [#17900] Add “Classic Wooden Coaster” with shallow banked turns.
- Feature: [#18057] Staff members now wait for passing or stalled vehicles before crossing railway tracks.
- Feature: [#18168] Add additional track pieces to the LIM Launched Coaster and the Looping Coaster.
- Feature: [objects#198] Add additional pirate roofs.
- Feature: [objects#205] Add additional glass roofs.
- Feature: [objects#209] Add the Steel Roller Coaster train and 2-across Inverted Train from RollerCoaster Tycoon 1.
- Feature: [#18050] Add asset pack manager and asset packs.
- Improved: [#15358] Park and scenario names can now contain up to 128 characters.
- Improved: [#15589] Numpad Enter can now be used to close text input.
- Improved: [#16819] Don’t prompt to “Save game as” when saving a loaded saved game (excepting autosaves).
- Improved: [#16840] Add support for rectangular heightmaps.
- Improved: [#17575] You can now search for Authors in Object Selection.
- Improved: [#17806] Added warning when using RCT1 objects without RCT1 linked.
- Improved: [#17868] [Plugin] You can now change active tab of a custom window programmatically.
- Improved: [#17909] Track elements that are not supported by any train are now hidden by default.
- Improved: [#17924] Improved performance when loading JSON object images from a .DAT file.
- Improved: [#17955] Modifying ratings via in-game console is now multiplayer-safe and also freezes the ratings.
- Improved: [#18177] [Plugin] Widget tooltips can now be read and changed.
- Change: [#9104] Calculate maze support costs.
- Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection.
- Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements.
- Change: [#17655] Lower default price for the Crooked House.
- Change: [#17745] Make maintenance cost of Mini-Golf more balanced.
- Change: [#17762] Use vertical tabs in the New Game dialog.
- Change: [#18113] Increased limit of Loan Interest in Scenario Editor to 255%.
- Fix: [#5141] Headless server is counted as a player.
- Fix: [#7466] Coaster track not drawn at tunnel exit.
- Fix: [#10535] Guests getting stuck at specific level crossings.
- Fix: [#14337] Guest blocking ride entrance after ride price changed to be unaffordable.
- Fix: [#15328] Wooden Roller Coaster incorrectly draws a railing on the first station piece (original bug).
- Fix: [#16392] Scenery on sloped surface is placed at wrong height.
- Fix: [#16476] The game sometimes crashes when demolishing a maze.
- Fix: [#17053] Crash when trying to open files under 4 bytes in length.
- Fix: [#17312] (Flying) Inline Twist appearing under the surface when placed on ground level.
- Fix: [#17339] Distorted visuals when changing scaling factor between integer numbers in OpenGL rendering mode.
- Fix: [#17394] Six-seater Hyper-Twister Trains focuses ride window camera on Car 2 rather than Car 1 (original bug).
- Fix: [#17430] Possible crash when toggling tile element visibility in multiplayer.
- Fix: [#17444] “Manta Ray” boats slowed down too much in “Ayers Rock” scenario (original bug).
- Fix: [#17503] Parks with staff with an ID of 0 have all staff windows focus on that staff.
- Fix: [#17508] Grid doesn’t disable after setting patrol area.
- Fix: [#17532] Object Selection window allows unselecting all station types.
- Fix: [#17533] Missing audio when specifying ‘--rct2-data-path’.
- Fix: [#17535] Multiplayer desync when placing rides with scenery.
- Fix: [#17541] Station style not correctly saved to TD6.
- Fix: [#17542] Stalls will autorotate towards paths outside the park.
- Fix: [#17544, #17754] Visual glitches in Invention List window.
- Fix: [#17553] Crash when moving invention list items to empty list.
- Fix: [#17571] All researched tracked rides show up as new vehicles in .park scenarios.
- Fix: [#17600] Notifications are not properly cleared when loading a park.
- Fix: [#17605] Crash when opening parks which have had objects removed externally.
- Fix: [#17639, 17735] When building upside down, the special elements list contains many items twice (original bug).
- Fix: [#17664] Unable to save after an extended period of time due to inactive ride music data leaking.
- Fix: [#17703] (undefined string) when building on invalid height.
- Fix: [#17776] “Other Parks” tab uses separate lists for SC4/SC6 and .park scenarios.
- Fix: [#17784] Colour preset RNG is biased (original bug).
- Fix: [#17788] Guests could leave queue if another guest rejoins it from the entrance building.
- Fix: [#17834] Finance window becomes blank after 4096 years.
- Fix: [#17816] Option to pause game when Steam Overlay is active is not greyed out when using the OpenGL renderer.
- Fix: [#17897] Guest can get stuck on tiles with construction rights outside the park.
- Fix: [#17904] Trees are removed at no cost to make way for ride entrance/exits.
- Fix: [#17905] The chain button in the map window is enabled for rectangular maps when (re)opened.
- Fix: [#17931] The in-game command ‘count_objects’ crashes the game.
- Fix: [#17865] With difficult guest generation, tested but unopened rides still contribute to the guest cap.
- Fix: [#17866] [Plugin] Wrong Soft Guest Cap at start of new game.
- Fix: [#17889] Peeps don’t stop at level railway crossings if approached from downhill.
- Fix: [#17980] Queue lines of track designs mess up existing queue lines if dragged through them.
- Fix: [#17959] Areas marked for dirty drawing are too large.
- Fix: [#17963] Some marketing campaigns can’t be started after Finances window tab has been on Research.
- Fix: [#17964] Sprites don’t show up on two sides of the view-clip selection.
- Fix: [#17966] Reversed steel trains do not properly import from S4.
- Fix: [#17973] Bins and lamps overlay parts of the land (original bug).
- Fix: [#18008] Steeplechase S-bends has multiple gaps visible in the tracks (original bug).
- Fix: [#18009] Visual glitch with litter at edge of sloped path.
- Fix: [#18025] Fix land ownership in Six Holland, Six Flags Magic Mountain, North America - Grand Canyon and Asia - Great Wall of China Tourism Enhancement scenarios.
- Fix: [#18026] Park rating drops to 0 with more than 32k guests, total ride excitement or intensity.
- Fix: [#18032] All non-interactive widgets (labels, groupboxes) produce sound when clicked.
- Fix: [#18035] Favourited servers don’t get their online status updated.
- Fix: [#18051] Visual glitch with Mine Ride’s large unbanked turn (original bug).
- Fix: [#18059] [Plugin] Width and height of custom window not changeable via script.
- Fix: [#18063] Guests can stop for all kinds of actions at railway crossing.
- Fix: [#18087] Bank balance is clamped to a 32-bit integer every transaction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

network version Network version needs updating - double check before merging! requires new save format Cannot be done until the new save format is deployed. testing required PR needs to be tested before it is merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random balloon/hat color

4 participants