FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
290 stars 98 forks source link

TSK A2G BAI #771

Closed JGrinnelli closed 6 years ago

JGrinnelli commented 6 years ago
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )

CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )

Scoring = SCORING:New( "BAI Demo" )

Mission = MISSION
  :New( CommandCenter, "Overlord", "Primary", "Perform a Battlefield Air Interdiction in the area!", coalition.side.RED )
  :AddScoring( Scoring )

AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()

TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "Target" ):FilterStart()

TaskBAI = TASK_A2G_BAI:New( Mission, AttackGroups,"BAI", TargetSetUnit )

ISSUE: Menu is still missing in Multiplayer. This is a much needed way to create Tasks. Sometimes less is more. This system would allow a designer to send different aircraft to different target locations and or attack different targets within the same area in the online environment without detection and designation. Task_A2G_BAI or CAS or SEAD would be amazing to use for the pvp missions. ~JG

FlightControl-User commented 6 years ago

The reason is because the menu needs to be generated by the HQ. Every time you add a task, the HQ menu needs to be regenerated. I've done it this way because otherwise a menu would be regenerated every time a task was added to the HQ menu, which would become a performance CPU spike.

You need to add a line at the end of your logic:

CommandCenter:SetMenu()

Also note that, when a player is logging into your system, the HQ menu should also be regenerated automatically.

I will do some testing with this my self and will come back to you.

FlightControl-User commented 6 years ago

I think the issue is solved with a recent fix I did related to S_EVENT_PLAYER_ENTER_UNIT that was not fired properly. So, you don't need to add anything.

I just tested mission TSK-100 A2G - BAI and it ran perfectly. The task is automatically added now when the client plane is "born".

JGrinnelli commented 6 years ago

Works in Single Player still no menus in Multiplayer.

FlightControl-User commented 6 years ago

Didn't test mp.

victorcotap commented 6 years ago

Very rarely happens nowadays with the quick change in menu generation hooked on "EVENT_BIRTH" or similar that was used as a last resort to be able to make it work in MP

FlightControl-User commented 6 years ago

@victorcotap @JGrinnelli I will investigate this further...

FlightControl-User commented 6 years ago

I think this is fixed. Can you retest this?

FlightControl-User commented 6 years ago

closing this one. this is fixed.