Diver from Submarine (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


Parel803 -> Diver from Submarine (2/13/2022 2:15:03 PM)

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




KnightHawk75 -> RE: Diver from Submarine (2/13/2022 7:43:28 PM)

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




Parel803 -> RE: Diver from Submarine (2/13/2022 8:00:45 PM)

KH,
I realize I ask a lot of Q's. Thanks again for the answer.
regards GJ




KnightHawk75 -> RE: Diver from Submarine (2/14/2022 4:41:22 AM)


quote:

ORIGINAL: Parel803

KH,
I realize I ask a lot of Q's. Thanks again for the answer.
regards GJ

No worries, you're welcome.




Parel803 -> RE: Diver from Submarine (2/14/2022 7:28:23 AM)

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




KnightHawk75 -> RE: Diver from Submarine (2/14/2022 5:39:06 PM)

quote:

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

quote:

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




Parel803 -> RE: Diver from Submarine (2/14/2022 7:43:03 PM)

again thx, also for tomorrow :-)
Works great thx




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.875