Jump to content

Chump

Members
  • Posts

    531
  • Joined

  • Last visited

Everything posted by Chump

  1. @Elphaba Are you saying that the radio.modulation enum is not working for you? I did a quick test mission using trigger.action.radioTransmission() and it was working for both AM and FM. Are you seeing an error in the dcs.log somewhere regarding this enum? Would you please explain how you are using this, if not similar to what I'm doing? local zone = trigger.misc.getZone("test") trigger.action.radioTransmission("l10n/DEFAULT/test1.ogg", zone.point, radio.modulation.AM, true, 123000000, 100, "testAM") trigger.action.radioTransmission("l10n/DEFAULT/test2.ogg", zone.point, radio.modulation.FM, true, 30000000, 100, "testFM") Both sounds were heard on their respective frequencies (123MHz AM & 30MHz FM) using an A-10CII hot-start on the runway of Batumi and the trigger zone out in the sea a few miles away. Scripting doc about radio enum
  2. @skypickle You would add your LUA script into the creators table in device_init.lua. Your script would then call the listen_command(), and you would trigger it with an input definition. You can see how it is done by looking at other LUAs that are called from device_init.lua. For example: -- devices.lua devices["newThing"] = counter() -- device_init.lua creators[devices.newThing] = { "avLuaDevice", LockOn_Options.script_path .. "newThing.lua" } -- newThing.lua GetSelf():listen_command(1234) -- default.lua { down = 1234, name = _("My New Thing Command"), category = _("MODS") }, There is a bit more to it like defining the functions/logic that is triggered, but this should get you started.
  3. Adding to what @Dragon1-1 said, since it was written as a Chrome plug-in, it will not be a direct port. Although it is possible to trigger LUA with a new key/button press using listen_command(), the next hurdle would be that DCS does not have native voice recognition to generate the input to send to ChatGPT.
  4. The encyclopedia says: I'm assuming that it means the BGM-109B Tomahawk, which it pulls the data from [DCS]\MissionEditor\data\scripts\Enc\Weapon\BGM-109B.txt. There is nothing connecting this to it's typeName that I can see in the exposed LUA files. Maybe someone else knows where this link is located?
  5. It would be great to free up these IDs. I think the way that most of us use this is to choose a high arbitrary starting ID that won't conflict with other marks (from other scripts, users, etc.). +1 to get a new API method for this
  6. @jonsky7 Try placing another Action in your second Trigger after the X: STOP WAIT USER RESPONSE: MESSAGE TO ALL, Text=blank, Seconds=1, ClearView=checked, StartDelay=0 The key is the ClearView, which will erase all messages on the screen.
  7. @Bestiajez MiST (https://github.com/mrSkortch/MissionScriptingTools/releases) makes a repetitive scheduled event very simple. You could do something like this inside a ONCE / DO SCRIPT trigger (after adding MiST in a MISSION START/DO SCRIPT FILE trigger beforehand): countdown_num = 60 local function showMsg() trigger.action.outText(tostring(countdown_num), 1) countdown_num = countdown_num - 1 if countdown_num == 0 then countdown_num = nil end end mist.scheduleFunction(showMsg, {}, timer.getTime(), 1, timer.getTime() + 60)
  8. There is MARK TO ALL/GROUP/COALITION and REMOVE MARK that can be used in the ME. This would take playing with the triggers, one to draw it when radio command/flag is used, one to wait for a period of time + set a flag, and one to remove the mark when the time is reached/flag is set. If you are interested in doing this in LUA, then you could use trigger.action.markToAll/Group/Coalition and removeMark after a timeout period. You could also use setMarkupColor with RGBA (desired color) then 0,0,0,0 (for transparent alpha) to toggle the visibility of the mark.
  9. Left side console.
  10. Your event handler is incorrect, and some other errors. Here is a suggestion on how to handle events: local function onPlayerAddMarker(event) local unit = event.initiator if unit and event.id == world.event.S_EVENT_MARK_ADDED then local clientName = unit:getPlayerName() if clientName then -- get some values local coalition = unit:getCoalition() local group = unit:getGroup() local markId = event.idx local markText = event.text local markPosition = event.pos -- do your stuff here end end end local eventHandler = { f = onPlayerAddMarker } function eventHandler:onEvent(e) self.f(e) end world.addEventHandler(eventHandler)
  11. @Elphaba Please see my edited post/code. Glad to help!
  12. @Elphaba I can think of a way to associate by airbase ID (it ain't pretty, just a suggestion): local radios = {} dofile(string.format("./Mods/terrains/%s/Radio.lua", env.mission.theatre)) if radio then for _, airbase in ipairs(coalition.getAirbases(coalition.side.BLUE)) do local radioId = string.format("airfield%d_", airbase:getID()) for _, r in ipairs(radio) do if string.find(r.radioId, radioId) then radios[airbase:getTypeName()] = r break end end end end -- now you have a table of associated radio entries by airbase -- ex: radios["Anapa-Vityazevo"].frequency.UHF[2] EDIT: I was originally thinking of Beacons.lua where there are multiple entries per airbase. Since here it is 1:1, it makes the loop easier.
  13. Indeed it does. It will need the usage of require. --_G['require'] = nil
  14. You can access the Beacons.lua, Radio.lua, etc. dofile(string.format("./Mods/terrains/%s/Radio.lua", env.mission.theatre)) -- makes the "radio" table available if radio then for _, r in ipairs(radio) do -- do stuff like: r.frequency.UHF[2] end end
  15. coalition.side.NEUTRAL coalition.side.RED coalition.side.BLUE That's what you want to use. Example: local group = Group.getByName("MyGroup") if group and group:getCoalition() == coalition.side.BLUE then -- do stuff for blue group end
  16. The last part is uppercase when using the enum. You really shouldn't use the value (2) in case it ever changes. coalition.side.BLUE https://wiki.hoggitworld.com/view/DCS_Scripting_orig_Part_1#coalition
  17. Seems like it might be your VR: 2023-02-01 14:42:45.451 INFO VISUALIZER (Main): OpenXR: request exit
  18. You could always set up a Mission Start trigger like so for now:
  19. GitHub added the extra dot. I will get it fixed up. Thanks!
  20. @maajr57 I added a release (https://github.com/chump29/DCS_Mod/releases/tag/Latest) that is in OvGME format for ease of install. Please let me know if you have any questions.
  21. Here is the fixed mission for "Lesson 14 - AGM-65 Maverick Training" (see attached). { ["file"] = "Lesson 20 - AGM-65 Maverick.miz", ["name"] = _("Lesson 14 - AGM-65 Maverick Training"), ["description"] = _("In this training you will be presented with four structured tactical scenarios. Each will stress one aspect of AGM-65 employment."), }, Put this in: [DCS Directory]/Mods/aircraft/F-16C/Missions/Training Lesson 20 - AGM-65 Maverick.miz
  22. The issue is stemming from an included script in the mission (HitAndCall.lua). if event.id == world.event.S_EVENT_DEAD and event.initiator:getName() == 73729948 then The event does not have an initiator but it is trying to get it's name. @Flappie Are we allowed to fix these issues (and make available) until ED can get to it?
  23. DCS uses Lua 5.1. Same error handling code for LUA_ERRERR: https://www.lua.org/source/5.1/ldo.c.html Obviously, this is a black box to us. Someone on the ED team would need to see how it is handled internally.
×
×
  • Create New...