Store vehicles to rebel outposts (again)#885
Open
wersal454 wants to merge 3 commits intoAntistasi-Ultimate-Community:unstablefrom
Hidden character warning
The head ref may contain hidden characters: "garage-vehicles-to-rebel-outposts-\u21162"
Open
Store vehicles to rebel outposts (again)#885wersal454 wants to merge 3 commits intoAntistasi-Ultimate-Community:unstablefrom
wersal454 wants to merge 3 commits intoAntistasi-Ultimate-Community:unstablefrom
Conversation
Signed-off-by: wersal <wroma@bk.ru>
outpost_create functions probably should be merged into one with additional checks and parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Sub-categories:
What have you changed, and why?
Information:
Continuation of #390, closed that one because of the conflict fixes fuck up.
This PR extends the ability to assign specific vehicles to rebel outposts (roadblocks, AA, AT, and HMG emplacements). Previously, outposts would always spawn with a default vehicle type. Now, players can choose to either purchase a vehicle from the store or assign one from their garage. The chosen vehicle, its customization, and (for roadblocks) its orientation relative to the barricade are saved persistently and restored when the outpost respawns.
🚗 Vehicle Selection & UI
Added new dialogs (vehicleFromGarage.hpp, vehicleFromStore.hpp) and supporting UI functions (fn_UI_vehicleFromGarage.sqf, fn_UI_vehicleFromStore.sqf, fn_UI_buyVehicleTabs.sqf) to allow selection of a specific vehicle class with live 3D preview and detailed stats (crew, weapons, skins).
When establishing a roadblock or static emplacement, the commander is prompted to choose between garage and store. If the garage is empty, the store opens automatically.
Roadblock placement now includes an option to align the vehicle parallel to the road or facing the barricade.
💾 Persistence & Data Structures
New global arrays (roadblocksData, aapostsData, atpostsData, hmgpostsData) store vehicle class, customization, and direction for each outpost type.
Updated fn_saveLoop.sqf and fn_loadStat.sqf to serialize and restore this data alongside garrison information.
fn_initZones.sqf initializes these arrays and broadcasts them to clients.
🔄 Spawning & Despawning
Modified fn_distance.sqf to read saved vehicle data when respawning outposts, falling back to default templates if no data exists.
Updated *Distance spawn functions (fn_outpost_createRoadblockDistance.sqf, etc.) to accept vehicle class, customization, and direction parameters, applying them when creating the vehicle.
Improved crew assignment: gunners, commanders, and additional turret gunners are now properly seated.
♻️ Disbanding & Refunds
fn_garrisonDialog.sqf overhauled for outpost removal:
If the vehicle is still alive, it is returned to the garage (via HR_GRG_fnc_addVehicle).
If destroyed, a partial refund is granted.
The corresponding *Data array entry is cleaned up.
Refund percentage increased from 75% to 85%.
🛠️ Support & Utility Functions
Added helper functions for vehicle analysis:
fn_getVehicleClassCrew.sqf – extracts crew layout.
fn_getVehicleClassSkins.sqf – lists available texture sources.
fn_getVehicleWeapons.sqf – returns usable weapons.
fn_isUsableWeapon.sqf – filters out non‑weapon devices (smoke launchers, fuel tanks).
fn_getVehicleClassComponents.sqf – retrieves animation sources.
fn_processVehicleCategory.sqf – populates garage listboxes.
📦 Server & UI Definitions
defines.hpp and ids.inc updated with new IDCs and icon macros for garage/store dialogs.
dialogs.hpp includes the new dialog headers.
fn_initVarServer.sqf declares new server variables for tracking selected vehicles and garage operations.
🧹 Miscellaneous
fn_mrkUpdate.sqf now accepts an optional side parameter to force marker side updates (used when ownership changes).
fn_ui_setOutpostCost.sqf no longer includes vehicle cost in the initial price estimate (since vehicle is selected separately).
(Yes, I asked LLM to write up the changelog)
How can your changes be tested, or reproduced?
Try spawning rebel outposts (except watch post), you will now have options to use vehicle from garage or buy it from HQ store
When placing roadblocks, you will now have option to select if vehicle should be parallel to the road or not.
Cost of the outposts should now be calculated from vehicle cost from HQ store and cost of the rebel units.
Does this PR include changes not authored by you?
Further info:
Please verify the following (If possible).
*- Mandatory**Is further work needed?
Please specify which Issue this PR Resolves (If Applicable).
This PR closes #XYZ.
Notes:
Only real ISSUE with this version is UI scaling for garage menu in 1080p (and probably less), functional but looks off. Otherwise everything should work fine.