Naval Situation

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
rmelvin
Posts: 207
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Naval Situation

Post by rmelvin »

It appears when a naval unit is cancelling and does not go on the attack, the naval goes to the near port. This has led to stranded naval units. Transport depositing units in isolated position. The system never comes back to these units and relocate these units. Most of last month script correction writing has been to fix this situation. I how got to write one for Canada and USA to get these unit off of Greenland.

Suggest: On Cancellation first check to see if the unit can return back to the friendly location for reassignment. Next check to see if safe location is not an isolated location (how, maybe road connection?).
User avatar
Lothos
Posts: 1245
Joined: Tue May 23, 2006 8:22 pm

Re: Naval Situation

Post by Lothos »

rmelvin wrote: Sun Jul 23, 2023 7:54 am It appears when a naval unit is cancelling and does not go on the attack, the naval goes to the near port. This has led to stranded naval units. Transport depositing units in isolated position. The system never comes back to these units and relocate these units. Most of last month script correction writing has been to fix this situation. I how got to write one for Canada and USA to get these unit off of Greenland.

Suggest: On Cancellation first check to see if the unit can return back to the friendly location for reassignment. Next check to see if safe location is not an isolated location (how, maybe road connection?).
Mentioned this to the devs before. The only fix is to write AI scripts to pull all these units back to a center point where your AI scripts will then send them back out.
rmelvin
Posts: 207
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Re: Naval Situation

Post by rmelvin »

That want I have been doing. Lot of script writing for these isolated locations and all the countries units getting stranded. One way to make is easier would be to have an Allied or Axis identifier. So only one script would be needed to move the units out.

Could an Assembly Script be developed. The Script will list Friendly Locations with Goal Location. Units in range will be sent to assembly area. This could be used to move units across map after conditions are met.
El_Condoro
Posts: 597
Joined: Sat Aug 03, 2019 4:35 am

Re: Naval Situation

Post by El_Condoro »

That's what the guard scripts do - you can add as many #GOAL_POSITIONS as you need and they will be filled with available units according to the other conditions set. The #COUNTRY_ID must be mobilized for this to work. Set the #ACTIVATE_POSITION to whatever the key condition is to fire the script and the #CANCEL_POSTION to whatever will end it (perhaps for another guard script to take over).

It might not be relevant to your map but I have also found that offensive scripts will not fire unless the attacker has access to the target. So, an intervening neutral country will prevent the offensive from triggering. In that case, I have found it useful for moving units into attack positions to set the script to attack the neutral country, even if is a potential ally, and use #CANCEL_POSITION to end it before war is declared on them.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
rmelvin
Posts: 207
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Re: Naval Situation

Post by rmelvin »

Thanks,
What is the mechanics of moving a large number of units over long distance.
Write a Guard script for Goal on the USSR border from Friendly deep inside of Spain.
Plus, not stop operations in the Balkans, by bleeding off units.
El_Condoro
Posts: 597
Joined: Sat Aug 03, 2019 4:35 am

Re: Naval Situation

Post by El_Condoro »

If the target is accessible, aside from not being at war yet, use offensive scripts. Until the target is at war or the AI DOWs them, units will gather as close to the target as possible - a Build-Up Offensive. When the required conditions are met, and the target country is mobilized, it becomes an Offensive unil the #GOAL is taken or the #CANCEL_CONDITION/s are met (or the combat ratio is unfavorable as determined by the AI).

Have a look at the build-up offensives for Germany against the USSR in the 1939 campaign. Many have a #LENGTH of 100, which is just to make sure that the build-up doesn't end before USSR mobilizes or war is declared; they have #GOALS, such as Kiev or whatever, and the #SIZE determines how many units are assigned to that offensive and #STEAL is used to set a kind of priority. There is usually an offensive script for each major city and other targets.

Make sure that the exclusion list is set the way you want it to be so that the AI keeps focused on those goals that are important, too.

To send an army from Spain to the USSR, I would have an offensive script that has these key conditions:
#TYPE= 1 so it only fires once
#LENGTH can be anything large but go with 100 just to ensure it doesn't end prematurely
#FRIENDLY_POSITION could be Madrid
#RANGE would be something like 15
#SIZE is whatever you want to move (6,20 units?)
That will make the AI take a minimum of 6 (and a maximum of 20) units from within 15 hexes of Madrid.
Then the #GOAL_POSITION might be Brest-Litovsk, for example.
Those 6-20 units will move across the map towards the closest point to Brest-Litovsk and gather along the border until war is declared and will then begin the attack on the city. In my experience, the AI is not an efficient mover and the time taken will be longer than for a player who might use forced march and move the forward units first.
You might have a #CANCEL_CONDITION but it's probably not necessary.

See how this goes and, again, check out the official scripts for more ideas.

[Edit]: Check the scripts for the Balkans to make sure they won't still be in effect when the one above gets the units within their range. If the Balkans offensive scripts are set to #TYPE= 2 and have a long #LENGTH and #RANGE - and especially have #STEAL= 3 - they will steal units from the moving army.

[Edit]: Make sure to check out the #SIZE notes in the guard file. 6-20 units would be 6-20 CORE units. Things like bombers and other non-core units are added after the core number is met. Also, HQs might need more than one script to get them all across the map - one per HQ where #ADD_HQ is set to 1. I'm not sure about that one, so test it (of course!)

[Edit]: Sorry if this is obvious but I just want to check that you are using the ~ KEY (not Shift-~) to look at AI information. It can be very useful to know which AI scripts are running and what they are doing.

[Edit]: Yet another thing! #SIZE will draw units from 15 hexes of Brest-Litovsk (#GOAL_POSITION in the example above) as well as Madrid, so that needs to be factored in for its values.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
rmelvin
Posts: 207
Joined: Wed Apr 06, 2022 1:41 am
Location: Tucson, Arizona

Re: Naval Situation

Post by rmelvin »

Thanks
Post Reply

Return to “Scenario Design and Modding”