Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA Script in Don of a New Era and unexpected results

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> LUA Script in Don of a New Era and unexpected results Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA Script in Don of a New Era and unexpected results - 10/27/2018 4:44:57 AM   
Cpt Black

 

Posts: 17
Joined: 10/17/2018
Status: offline
I was trying to figure out some odd behavior on the Russian side of this scenario. Specifically the attack on the AEGIS Ashore site. The first script that activates the inactive mission is straightforward and works fine. Then there is this.



if not ScenEdit_GetSideIsHuman('Russia') then
for i=1,9 do 
	if ScenEdit_GetUnit({Side='Russia', Name="Cheglokov #"..i,}) ~= nil then  
	if not ScenEdit_AssignUnitToMission("Cheglokov #"..i, "AEGIS Ashore Strike") then
	end
    end
end 
for i=1,15 do 
	if ScenEdit_GetUnit({Side='Russia', Name="Drozdov #"..i,}) ~= nil then  
	if not ScenEdit_AssignUnitToMission("Drozdov #"..i, "AEGIS Ashore Strike") then
	end
    end
end 
end


What this is doing assigning units from one mission to the other. Units named "Cheglokov" are assigned, one by one, to the now active mission. They see they now have a mission and execute it. They fire their missiles (they are already in range). This seems to happen within the script loop (for i=1,9). Nothing is done except the missiles are fired to the target, no other mission logic appears to be applied at this time (even automatically programming the missiles in a "spread".) Each unit, most likely because it's still in this scripting loop, doesn't recognize the other unit's existence.

The second loop begins. Because, at the beginning of the loop there are now 9 other units on the mission, the behavior is completely different. The other 9 units have already fired 108 missiles at this poor SAM site. Being thrifty Russians the second group decides to wait on the results and not waste their missiles. This may just be normal mission logic, see below.

The unexpected results are:

1. The first 9 firing units thinks they are alone at the time the logic to shoot fires because they are still in the scripting loop. They unload all their missiles on a direct bearing to the target. No spread, just 108 missiles straight at the target. It is difficult, but not impossible to stop.

2. The second group of bombers don't fire at all. Because the mission target is still valid but the salvo requirement has been met, they proceed to the target. 15 fat, lumbering bombers wander right over the battlefield and don't stand a chance even though they have a payload with a 1600 mile standoff range.

Now for the truly bizarre. When you pause the scenario, after the mission is active, and add in the units you would think they would all fire. But they don't. The first group executes a flawless attack. They fire off all their missiles, programming a proper spread that will be nearly impossible to stop.

The second group, once again, turns to the target and begins it's march to oblivion at the hands of the NATO fighters.

The units are different types of aircraft with different types of weapons. However, the range and WRA settings on the weapons are identical. It's got to be some weird interaction between the scripting loop in LUA and the logic inside the mission editor.
Post #: 1
RE: LUA Script in Don of a New Era and unexpected results - 10/27/2018 6:14:39 PM   
Cpt Black

 

Posts: 17
Joined: 10/17/2018
Status: offline
After a lot of testing last night I'm not really sure.

First of all the game itself seems to be responsible for the lack of planned routes for the missiles. I tested the scenario in the editor, and the missiles do plan a route. Because the group of bombers is strung out over about a 100 mile area, the game actually planned the missiles to take the same route. I mean they all went to one point, then from that point to the target effectively causing a stream of missiles all on one bearing.

It's exactly the opposite behavior the player sees. If the mission runs while switched to the Russian side the missiles spread out, lust like you're used to seeing. One has to assume this is done to make it easier on the human player. I wonder if there is a setting that controls this. I'm not so sure I like it, but it seems normal. At least it's consistent.

In any event it's not the script's doing at all.

The Bears still don't fire. Again, it's probably not the script, but the mission manager code. One unit has has fired enough ordinance to destroy the target. The second unit of bombers assumes the role of back-up. And would fire if the initial salvo was intercepted. The problem is they proceed towards the target while they wait at only a slightly slower speed than the cruise missiles. They actually do survive if you run the scenario in the editor and just let all the pre-planned missions run. They only survive because the computer controlled NATO fighters rightly prioritize the missiles and ignore the bombers until either the missiles impact or are destroyed.

Then, of course, NATO slaughters them quickly as now there are twelve bombers in Romanian airspace.

All this is to say the whole thing might just be working as intended. The 108 missiles are tough to deal with, but not impossible (in one play through they passed directly over a guided missile destroyer that literally emptied it's magazines at them and a few fighter patrols could finish them off). It is also worth noting that the AEGIS Ashore site is the only SAM site represented on the NATO side. Even defeating the missiles will seriously dent the NATO supply of air-to-air missiles or, in the case of that destroyer, leaving it defenseless (though probably too late in the game for Russia to do anything about.)

For my own play I think I will remove the Bear bombers from the mission. They are way too valuable to expose like they are. I can use them to really cause a headache or two to a couple of NATO airfields, especially if I can time it to come at the same time, or shortly after the initial missile strike. As it stands now, they only shoot if the original strike fails and only then if they survive, not likely against a human player as they incredibly big and juicy targets marching across the board in plain view for a couple of hours of game time. You could shoot them down with a Sidewinder-armed blimp. Note: we need blimps. With Sidewinders.

(in reply to Cpt Black)
Post #: 2
RE: LUA Script in Don of a New Era and unexpected results - 10/27/2018 7:34:19 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I would have thought that the mission would be marked 'inactive' before transferring all units to it. And as final step, make 'active'. The mission editor should then see them available in bulk.

_____________________________

Michael

(in reply to Cpt Black)
Post #: 3
RE: LUA Script in Don of a New Era and unexpected results - 10/28/2018 11:17:07 PM   
Cpt Black

 

Posts: 17
Joined: 10/17/2018
Status: offline

quote:

ORIGINAL: michaelm75au

I would have thought that the mission would be marked 'inactive' before transferring all units to it. And as final step, make 'active'. The mission editor should then see them available in bulk.


I tested this. Assigning a unit that is airborne (as these are) to an inactive mission causes the aircraft to follow the mission flightplan, but not actually attack. In my test I took a flight of F-35s with laser-guided bombs and assigned them to an airfield strike that was inactive. They flew to the airfield, increased speed and changed bearing to attack etc. But they didn't release their bombs. Then they returned to base.

The aircraft in question here are not only already airborne, but already in range of their very long range cruise missiles (1600 NM). Assigning them to an inactive mission would cause them to turn towards the target, not fire, then RTB. I see your reasoning, but it just wouldn't work in this case.

(in reply to michaelm75au)
Post #: 4
RE: LUA Script in Don of a New Era and unexpected results - 10/29/2018 11:24:02 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I actually mean to assign them while the mission is inactive, and then once all assigned, make the mission active.
If you have a save before the script runs, I would like to check it out. I have a feeling I have seen it work but can't recall exact details.

_____________________________

Michael

(in reply to Cpt Black)
Post #: 5
RE: LUA Script in Don of a New Era and unexpected results - 10/29/2018 1:07:44 PM   
Cpt Black

 

Posts: 17
Joined: 10/17/2018
Status: offline

quote:

ORIGINAL: michaelm75au

I actually mean to assign them while the mission is inactive, and then once all assigned, make the mission active.
If you have a save before the script runs, I would like to check it out. I have a feeling I have seen it work but can't recall exact details.


Yes, but because they are already in range in this instance they try to shoot as soon as they are assigned to the inactive mission. Because it IS inactive they don't release weapons, they just go to RTB mode. Moving the mission to active after they are already RTB has no effect. So they make a flight plan to the target, realize they are already inside max range, instantly try to shoot, and are blocked because the mission is inactive. Then they go into RTB mode before you could possibly activate the mission. They've advanced the flight plan beyond the attack phase and into "go home" stage.

I also tried to set the minimum/maximum range of the attack (with the mission active when moving them into it) to overcome this. The aircraft are ~1400 miles out but still fired immediately with the range set in the mission to 1000 miles minimum and 1150 miles maximum (measured the aircraft distance with the range/bearing tool and they were well outside the max range when assigned to the mission.) Perhaps I just don't understand what that mission attack radius thing is meant for, or perhaps it's only checked when the mission is activated, not sure.

(in reply to michaelm75au)
Post #: 6
RE: LUA Script in Don of a New Era and unexpected results - 10/29/2018 2:50:08 PM   
LMychajluk

 

Posts: 126
Joined: 10/8/2017
Status: offline
The flight size on the AegisAshore Strike mission is set to 1, so I would think each assigned unit acts independently.

If you set the flight size and/or the number of flights required to trigger mission (if the units are actually different), you may be able to get the results you're looking for. For instance, if you set a flight size of 3, and set the # of flights to 1, then they shouldn't fire until at least 3 units are assigned to the mission (I think...).

(in reply to Cpt Black)
Post #: 7
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> LUA Script in Don of a New Era and unexpected results Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

2.656