Common - Add more loadout randomization options - #1783
Conversation
Only add extra mags in InitPost, prevents duplicated mags if mission maker edits loadout.
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
| }] call CBA_fnc_addEventHandler; | ||
|
|
||
| // Check missionTime so Eden placed units don't have their loadouts randomized twice | ||
| ["CAManBase", "InitPost", { if (CBA_missionTime > 0.1) then { call CBA_fnc_randomizeLoadout } }] call CBA_fnc_addClassEventHandler; |
There was a problem hiding this comment.
Not sure if there's a more proper way to do this
There was a problem hiding this comment.
xeh_postInit won't run on 3den (for now at least)
There was a problem hiding this comment.
The check is so units spawned in Eden don't have their kits randomized again, but units spawned later (e.g. script / zeus) do
Without the missionTime check Eden placed units would have their loadouts randomized on mission start
There was a problem hiding this comment.
ToDo: Should just be called from CuratorObjectPlaced eh
Add delay to eden fixAnimation call to not change animations when creating editorPreviews.
|
Been over a year since this was opened, could some take a look again? |
| // Loadout randomization | ||
| GVAR(randomLoadoutUnits) = createHashMap; | ||
| if (is3DEN) then { | ||
| add3DENEventHandler ["OnEditableEntityAdded", { |
There was a problem hiding this comment.
this will only work for new missions
take existing mission and CBA_facewearList[] gets ignored
because the unit wasn't placed in 3den
and the InitPost runs at mission time 0
There was a problem hiding this comment.
I feel like that's probably fine. Could add a special case where units that only have facewear list get randomized at mission start too but I feel like that'd cause more unexpected behavior for people editing kits
| // CBA's frame functions don't work in Eden | ||
| _unit spawn { | ||
| sleep 0.01; | ||
| save3DENInventory [get3DENEntityID _this]; |
There was a problem hiding this comment.
I don't think we have any way to tell if this has been run,
so it's probably best to just not touch 3den loadout and just run in xeh
There was a problem hiding this comment.
It you randomize at mission start you lose any changes made in efen
When merged this pull request will: