Page 1 of 1
Diver from Submarine
Posted: Sun Feb 13, 2022 12:15 pm
by Parel803
Good afternoon,
I got this from the Scenario: SakuraBlue by Rory N, very neat. I plucked this from the lua docs made by Rory (thx). A question that came up was how to get two instead of one option to drop forces ashore. I guess it is in the Key for deployed but don't know how to change that. All credits tot RN. If I should tweak it somewere, happy to here. The original docs contains much more.
regards GJ
RE: Diver from Submarine
Posted: Sun Feb 13, 2022 5:43 pm
by KnightHawk75
Attached in version where you are asked how many divers you want from the selected sub (1-10, change as you desire).
It also corrects areas where the original fell short (detects > 1 unit selected,etc now), adds a function you can use to easily clear the storage keys during development, and adjusts things such that GetUnit isn't called multiple times, but instead is obtained once and passed onto funcs that need it, added params to the 'diver' generation, along with defaults that match the original.
att: SelectedSubDropsDiversOffOnLand_514009.zip
RE: Diver from Submarine
Posted: Sun Feb 13, 2022 6:00 pm
by Parel803
KH,
I realize I ask a lot of Q's. Thanks again for the answer.
regards GJ
RE: Diver from Submarine
Posted: Mon Feb 14, 2022 2:41 am
by KnightHawk75
ORIGINAL: Parel803
KH,
I realize I ask a lot of Q's. Thanks again for the answer.
regards GJ
No worries, you're welcome.
RE: Diver from Submarine
Posted: Mon Feb 14, 2022 5:28 am
by Parel803
Thank you, much appriciated.
Follow up from first one. If want to put two recons ashore but not at the same time?
When I try that I get: There was aproblem with your selection. Ensure that you have selected a single submarine which has not yet deployed a dive team.
I found that mesage line but was wondering were to find the fact that it can only happen once? And if that can be set to e.g. two teams, so twice a drop?
regards GJ
RE: Diver from Submarine
Posted: Mon Feb 14, 2022 3:39 pm
by KnightHawk75
ORIGINAL: Parel803
Thank you, much appriciated.
Follow up from first one. If want to put two recons ashore but not at the same time?
When I try that I get: There was aproblem with your selection. Ensure that you have selected a single submarine which has not yet deployed a dive team.
I found that mesage line but was wondering were to find the fact that it can only happen once? And if that can be set to e.g. two teams, so twice a drop?
regards GJ
Follow up from first one. If want to put two recons ashore but not at the same time?
Areas that validate and check against the storage keys is where you want to look.
Probably minimal amount of work if you just want to disable that is just to remove the calls to SubmarineSelectionIsValidForDivers();
so change
Code: Select all
if (SubmarineSelectionIsValidForDivers(selectedSubmarine)) and ConfirmSpecialAction('Deploy dive team from '..selectedSubmarine.name) then
if DeployDiversFromSubmarine(selectedSubmarine) then
ScenEdit_SetKeyValue('Swimmers_'..selectedSubmarine.guid,'deployed') -- delete this line for >1 SpecOps team
return true;
end
else -- failed validation.
to
Code: Select all
if ConfirmSpecialAction('Deploy dive team from '..selectedSubmarine.name) then
if DeployDiversFromSubmarine(selectedSubmarine) then return true; end
else -- failed validation.
I did not test ^^ that before posting, but I think it should cause what you want without causing other problems.
RE: Diver from Submarine
Posted: Mon Feb 14, 2022 5:43 pm
by Parel803
again thx, also for tomorrow

Works great thx