Page 1 of 1

I asked ChatGPT about CMANO/CMO...

Posted: Sun Apr 30, 2023 4:04 pm
by lumiere
Do you know anything about "Command: Modern Air/Naval Operations" or "Command: Modern Operations" provided from Matrix Games?
ChatGPT
Yes, Command: Modern Air/Naval Operations (CMANO) and Command: Modern Operations (CMO) are both military simulation games developed and published by Matrix Games.

CMANO is a simulation game that focuses on modern air and naval operations. The game allows players to plan and execute complex military operations using a range of modern military equipment, including aircraft carriers, submarines, and fighter jets. The game is known for its realistic depiction of military operations and its attention to detail.

CMO is a follow-up to CMANO, and it expands the scope of the game to include ground operations as well. It features improved graphics and gameplay mechanics, and it includes a range of new features such as enhanced AI and a multiplayer mode.

Both CMANO and CMO are complex and challenging military simulations that require careful planning and strategic thinking. The games are popular with military enthusiasts and strategy gamers, and they have received positive reviews for their realism and attention to detail.

If you enjoy military simulations and strategic games, you may want to consider checking out CMANO or CMO. However, be aware that both games have a steep learning curve, and they may not be suitable for casual gamers.
キャプチャ.JPG
キャプチャ.JPG (136.03 KiB) Viewed 2084 times
Edit: Title correction.

Re: I asked ChatGPT about CMANO/CMO...

Posted: Sat May 06, 2023 7:41 am
by Grazyn
I asked it to write a Lua script to randomly spawn downed pilots when an aircraft is shot down and this is what it wrote

Code: Select all

-- Define a function that creates a downed pilot unit
function createDownedPilot(lat, lon)
  local new_unit = Unit.getByName('Downed Pilot')
  if new_unit == nil then
    new_unit = Unit.create('Downed Pilot')
    new_unit:getGroup():setTask({
      id = 'Nothing',
      params = {}
    })
    new_unit:setCoalition('NEUTRAL')
  end
  new_unit:setPosition(lat, lon)
end

-- Define a function that handles downed pilots when an aircraft is destroyed
function downedPilotOnCrash(event)
  if event.id == world.event.S_EVENT_CRASH then
    local unit = event.initiator
    local pos = unit:getPosition().p
    local chance = math.random(1, 10) -- 10% chance of spawning a downed pilot
    if chance == 1 then
      createDownedPilot(pos.lat, pos.lon)
    end
  end
end

-- Register the downedPilotOnCrash function to be called when a unit is destroyed
world.addEventHandler(downedPilotOnCrash)
Would this work, provided I change the ID number to a real unit? I know almost nothing about Lua

Re: I asked ChatGPT about CMANO/CMO...

Posted: Sat May 06, 2023 4:39 pm
by kevinkins
Interesting. Post this over in the lua sub-forum (Lua Legion) where the experts can further comment.

Re: I asked ChatGPT about CMANO/CMO...

Posted: Sun May 07, 2023 2:44 am
by boogabooga
Grazyn wrote: Sat May 06, 2023 7:41 am Would this work, provided I change the ID number to a real unit? I know almost nothing about Lua
Close, but no. ChatGPT would need to know the specific Command API to spawn units and such- this is just sort of generic.

Re: I asked ChatGPT about CMANO/CMO...

Posted: Sun May 07, 2023 3:57 pm
by BDukes
boogabooga wrote: Sun May 07, 2023 2:44 am
Grazyn wrote: Sat May 06, 2023 7:41 am Would this work, provided I change the ID number to a real unit? I know almost nothing about Lua
Close, but no. ChatGPT would need to know the specific Command API to spawn units and such- this is just sort of generic.
Exactly. I've been using it to clean up code for the most part. Does fine with the simple stuff.

Mike

Re: I asked ChatGPT about CMANO/CMO...

Posted: Sun May 07, 2023 3:58 pm
by BDukes
Grazyn wrote: Sat May 06, 2023 7:41 am I asked it to write a Lua script to randomly spawn downed pilots when an aircraft is shot down and this is what it wrote

Code: Select all

-- Define a function that creates a downed pilot unit
function createDownedPilot(lat, lon)
  local new_unit = Unit.getByName('Downed Pilot')
  if new_unit == nil then
    new_unit = Unit.create('Downed Pilot')
    new_unit:getGroup():setTask({
      id = 'Nothing',
      params = {}
    })
    new_unit:setCoalition('NEUTRAL')
  end
  new_unit:setPosition(lat, lon)
end

-- Define a function that handles downed pilots when an aircraft is destroyed
function downedPilotOnCrash(event)
  if event.id == world.event.S_EVENT_CRASH then
    local unit = event.initiator
    local pos = unit:getPosition().p
    local chance = math.random(1, 10) -- 10% chance of spawning a downed pilot
    if chance == 1 then
      createDownedPilot(pos.lat, pos.lon)
    end
  end
end

-- Register the downedPilotOnCrash function to be called when a unit is destroyed
world.addEventHandler(downedPilotOnCrash)
Would this work, provided I change the ID number to a real unit? I know almost nothing about Lua
If you look in the lua folder you can find the code for this and some to generate a downed pilot message.

Mike