Jump to content

Recommended Posts

Posted

Hi all, does anyone have any examples that they can share where, in a lua script, you can start a listen command?

I.e. the Mission Editor command X:Start Listen Command that waits for a certain switch or button to activate a flag.

nullCheers

image.jpeg

  • 3 weeks later...
Posted

take a look at FlightAssistant 1.5 by jmossr. It uses radio button sequenced pushes to create an autopilot for the mosquito by using TrimTable. You might be able to create a flag interaction in a similar way with a certain combination triggering a flag. Just a guess.

Quote

local function performClickableCommand(deviceId, commandId, value)
    return executeLuaInServerOrMissionEnv('a_cockpit_perform_clickable_action(' .. deviceId .. ', ' .. commandId .. ', ' .. (value or 1) .. ')')
end

local pperformClickableCommand
local checkPerformClickableCommandArgs
if isDebugUnitEnabled then
    checkPerformClickableCommandArgs = function(deviceId, commandId, value, errorLevel)
        local lvl = errorLevel + 1
        checkArgType('performClickableCommand(device, command, value)', 'device', deviceId, 'number', true, lvl)
        checkArgType('performClickableCommand(device, command, value)', 'command', commandId, 'number', true, lvl)
        checkArgType('performClickableCommand(device, command, value)', 'value', value, 'number', false, lvl)
    end
    pperformClickableCommand = function(deviceId, command, value)
        checkPerformClickableCommandArgs(deviceId, command, value, 2)
        return performClickableCommand(deviceId, command, value)
    end
end

 

  • Thanks 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...