Jump to content

Wingthor

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by Wingthor

  1. Hi, In Moose, groups from Mission Editior (ME) are templates. You don't need a ME template for every spawn, you can use same template as many times you like. However watch out so when spawning that you don't overwrite an already spawn group. Consider SpawnWithAlias... https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Spawn.html Also feel free to join the Moose Discord community https://discord.gg/gj68fm969S Good luck with Moose scripting.
  2. Hello CidTheViking, Great question! MOOSE (Mission Object Oriented Scripting Environment) is built on DCS Lua to facilitate object-oriented scripting in DCS World. Some developers prefer working directly with the DCS API, but MOOSE provides an abstraction layer that simplifies complex scripting tasks. What is MOOSE? You can think of MOOSE as a large library that contains numerous convenient functions, making it significantly easier to write scripts for DCS World. Essentially, it allows you to create very complex missions with just a few lines of code. The object-oriented approach provides several benefits, including: Reuse of code through inheritance Flexibility through polymorphism Modularity for easier troubleshooting Overhead & Differences Overhead: MOOSE introduces some overhead due to its abstraction layers, but it greatly reduces the amount of manual coding required. Performance impact depends on how efficiently MOOSE is implemented within a mission. Differences & Capabilities: MOOSE offers structured tools for AI behavior, mission automation, and dynamic campaign elements, streamlining mission scripting. The DCS API, however, grants direct access to the core game functions, allowing for deeper customization at the cost of more effort. Importantly, MOOSE and the DCS API can be used together—developers don’t necessarily have to choose one over the other. Since MOOSE is built on DCS Lua, scripts can integrate elements from both, taking advantage of MOOSE’s simplicity while still utilizing direct API programming for specialized tasks. Community MOOSE also has an active community on Discord, where developers can discuss scripting strategies, troubleshoot issues, and collaborate on projects: Join the MOOSE Discord Community Would love to hear insights from experienced developers on this!
  3. Not easy to grasp your issue based on the info you gave in your post. It might be you have a script lifecycle issue... Initially I will advice you to read the documentation for the class. You can find it here and also you will find documentation more about Moose in general following this link. You can download test missions from this link... https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/Ops/CTLD https://github.com/FlightControl-Master/MOOSE_GUIDES I guess it would be easier for me if you pasted your script into this forum or even better join the Moose discord community... https://discord.com/invite/gj68fm969S Hope this will bring you forward. Regards
  4. Will spawn GROUP Reaper if it exists in your mission editor (ME). Read the beginner section in the The MOOSE Companion Guide page 5-9 at least. Then check your dcs log file. Check for errors. Any error will halt your script. OnSpawnGroup() is a callback function which will "fire" when the GROUP is spawning. :InitLimit(1,0) will make only one live group at same time :InitLimit documentation Also check the Debug Guide.
  5. Not sure what your problem is related to this mission. Moose has many sources for learning. You can find most of them by following this link. Also, Moose has a community in discord in which you can ask questions to dedicated people Moose community on Discord. Anyway, if you have a more precise description of your issue, I perhaps also can help you here. Regards.
  6. Fixed... https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Message.html#%23(MESSAGE).ToAll
  7. Did you use this example: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Message.html##(MESSAGE).ToAll I seems example code might be wrong? Ill pass issue the Moose team. Sorry for unconvinience.
  8. Preferably it would be better to support you in a Discord channel, since its more convenient to realtime chat than do support in a forum like this.However, I understand language might represent an issue for you. Ill try supporting you here. I am not quite sure if you get any errors in your dcs.log file. Probably you do, cause this line: CalculateIntercept(DetectedItem looks strange . Perhaps just remove it. You will find documentation for how to set up DETECTION at this URL https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Detection.html , and you will find documentation for AI_A2G_Dispatcher at this URL https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/AI.AI_A2G_Dispatcher.html At this URL you can find example missions with code for the AI_A2G_Dispatcher class https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/AI/AI_A2G_Dispatcher If you’re starting out or looking for information, please read these first and it might be worth doing some basic Lua tutorials. No use getting frustrated by jumping into the pool without being able to swim. There are some docs that can help you out (very easily over looked) Moose users manual - https://github.com/FlightControl-Master/MOOSE_GUIDES/releases/download/v0.1-rc1/Moose_User_Guide.pdf <<< read first chapter at least ** Basic Moose debugging guide PDF - <https://ufile.io/nzduno3q> MOOSE demo missions, great source http:// https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop MOOSE documentation, has info on functions and how to use them - https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/ Lua tutorialhttp:// https://www.tutorialspoint.com/lua/index.htm
  9. It's difficult to help you cause I don't understand what you want to achieve.Your Chinese "is greek to me."However, if you need help, you can join the Moose Discord group. If you will have help in this forum please be be more specific about whats the problem, preferably in English.
  10. This is what I get when typing `coalition`: Here `coaltion`is picked from Moose `coalition`enum. Not sure where your intellisence is picking up the `coalition` keyword? Where you get `coalition.troops` from I don't know. Dont think its Moose database enums? Check if the coalition is defined elsewhere. It might get you in to trouble if you redefine Moose keywords.
  11. Sorry for late reply. Intellisence works for Visual Studio Code (VSC). You need to add a LUA extension to the VSC eg. EmmyLua. Then you need to add the scrips folder witin DCS world main folder to your worksspace in VSC (if you want). And/or other DCS lua libs. If you are using Moose, you can add the uncommented version of the Moose.lua to your workspace, then not so many problems will be (falsely) reported, since Moose are using LUA docs for documentation. Moose Include Reposotory, use then uncommented static version of Moose (Moose_lua)
  12. Indeed, it takes DCS UnitID as input. Strange why it not works with example code though: local UnitID = Unit.getByName("Teddy"):getID() Anyway good to know it was sorted out, glad it works.! Wingthor
  13. I have attached a test mission in initial message, which both tries the Moose function and example from hoggit. Mission starts with ICLS on, channel 1, you can turn ICLS off, but not get it back on with F10 radio menu triggered functions. Functions are called, but no ICLS on. Test mission has been tested with latest DCS version as per 2022-06-27, and even latest version of Moose. But Moose/Airboss is not the issue here. I have not tested with Airboss, since the function should also be used elsewhere. Would be nice @Nealius if you could take a quick test with the provided mission, to rule out if anything wrong with my or @Amarok_73system. This is the function which seems "dead": function ACtivateByHoggit() env.info("DEBUG: -------------------------------- Turning ICLS ON by Hoggit function --------------------------------") local gp = Group.getByName("CV59TF"):getController() gp:setCommand({id = "ActivateICLS", ["params"] = { ["type"] = 131584, ["channel"] = 5, ["unitId"] = 2, }, }) end
  14. In your mission script can you turn the ICLS on and off, and can you change channel?
  15. While debugging Moose command: CONTROLLABLE:CommandActivateICLS(Channel, UnitID, Callsign, Delay) it turns out that the bug seems to be dcs world it self. I have tested turning on ICLS with example code from the hoggit code: local gp = Group.getByName("CV59TF"):getController() gp:setCommand({id = "ActivateICLS", ["params"] = { ["type"] = 131584, ["channel"] = 5, ["unitId"] = 2, }, }) https://wiki.hoggitworld.com/view/DCS_command_activateICLS I have a test mission attached with both Moose and Scritping Engine command to test. Guess bug is related to other reports about th ICLS in this forum https://forum.dcs.world/search/?q=ICLS&quick=1&type=forums_topic&nodes=486 Regards... DEBUG_ICLS.miz
  16. Check out the Finite State Machine for Moose in SET_Groups documentaion. The OnAfterAdded is already implemented.
  17. Happens when its an AI kill due to if PlayerGroup:GetName() == playerGroup:GetName() then ... KillDataTable.target_name = EventData.TgtTypeName is never reached, and MESSAGE:New(KillDataTable.target_name.." destroyed",5):ToGroup(PlayerGroup) holds a nil value... But putting --show kill message if ES_Settings.PilotKillNotification == true then MESSAGE:New(KillDataTable.target_name.." destroyed",5):ToGroup(PlayerGroup) end inside the if PlayerGroup:GetName() == playerGroup:GetName() then clause seems to take away the error: So: function EasyStatsEnemyGroup:OnEventKill(EventData) BASE:I("------------ Extracted EVENTS.Kill---------------\n" .. PVPCrashHandler.TableSerialization(EventData)) KillDataTable = {} local PlayerUnit = EventData.IniUnit local PlayerGroup= EventData.IniGroup local TargetUnit = EventData.TgtDCSUnit if PlayerGroup:GetName() == playerGroup:GetName() then --data KillDataTable.player_name = playerName KillDataTable.player_module = PlayerUnit:GetTypeName()--player module used KillDataTable.player_coalition = EventData.IniCoalition if type(EventData.TgtTypeName) == "number" then KillDataTable.target_name = "Scenery Object" else KillDataTable.target_name = EventData.TgtTypeName end if KillDataTable.target_name == nil then KillDataTable.target_name = UNIT:FindByName(EventData.IniUnit.UnitName):GetTypeName() end KillDataTable.target_unit_name = EventData.TgtUnitName KillDataTable.target_coalition= EventData.TgtCoalition KillDataTable.timestamp = os.time(os.date("!*t")) EasyStats.LogKill(player_name,StatsFile,KillDataTable) --show kill message if ES_Settings.PilotKillNotification == true then MESSAGE:New(KillDataTable.target_name.." destroyed",5):ToGroup(PlayerGroup) end end end
  18. Just tested and version 1.2 works fine. However it seems not work when setting Skill "Client" and playing in a "Single Player" mission. Not sure if that is addressed before. I would like to propose a few enhancement: Report Carrier Landings. Night (or low visibility landings, instrument landings) Regards...
  19. Scripts functions: Spawning, AI tasks, Client Tasking, Cargo generating and more Script Tool: MOOSE. (Mission Object Oriented Scripting Environment) Reason: The object oriented approach Moose provides to mission scripting. Overide functions, inheritance and reuse of code. I can make rather sophisticated missions/sceneries with just few lines of code. Moose provides a huge API, which makes me able to do much with less code. Documentation written and Youtube vids Moose community provides help with code and sharing of code and such.
  20. You need to specify? Does the Moose spawn change unit names? or do you mean Groups name. When regular spawning and also with the ai-a2a-dispatcher Groups name have the original names from the mission editor plus a #number as a suffix If spawning with warehouse class name might change. You can have a look at this docs from Spawn class. Regards :) Wingthor
  21. Hi Mano, many things to fix here, First when grabbing object from Moose Wrapper (eg UNIT, GROUP, AIRBASE +++) classes you will use the FindByName(). For Unit that will be units name in Mission Editor (ME) So to grab carrier your call: carrier = UNIT:FindByName("Stennis")So now you have the carrier as a Wrapper.Unit#UNIT object which you can use. Next you have built a function which will be called from a menu object, fine. However you are using the GetPosition (with lower G which prob will return nothing) which will return a table with x,y,z values which is probably not what you want. However Moose provides a CLASS called point which is very handy. If you rather call for it coordinates, you can us carrierPos = carrier:GetCoordinate()Now when you look into docs for Core.Point, you see you have many option. the COORDINATE object which you now have can give you useful text, if you look at function starts with ToString (See). As I understand your issue, you want BRC text, and I assume that is Bearing, Range and Course, from the user. So when generating a text like that you need to know the players location as well. However, I will not go into that now. So since this is called colation wide, it makes more sense to give position in BULLS with carrierPos = carrier:GetCoordinate():ToStringBULLS(coalition.side.BLUE), which returns a string. So get carriers heading in string format arrierHeading = string.format ("Heading: %i", carrier:GetHeading())Concatenate the two string to something like Message = carrierPos .. " " .. carrierHeading And now you have a string you can wrap into a message like posMessage = MESSAGE:New(Message,25,nil,true):ToAll()You can try this as code, and see if that gets your further: carrier = UNIT:FindByName("Stennis") local function getCarrierPosition() local carrierPos = carrier:GetCoordinate():ToStringBULLS(coalition.side.BLUE) local carrierHeading = string.format ("Heading: %i", carrier:GetHeading()) local Message = carrierPos .. " " .. carrierHeading posMessage = MESSAGE:New(Message,25,nil,true):ToAll() end MenuTop = MENU_COALITION:New( coalition.side.BLUE, "Stennis" ) MenuPosition = MENU_COALITION_COMMAND:New( coalition.side.BLUE, "Position", MenuTop,getCarrierPosition)But again if you want Bearing and Range stuff you need to grab players location, then perhaps better use MENU_GROUP and send group (sender) as argument to function. Then you can calculate BRC text. Hope this help. I have NOT TESTED the code though. Also plz join our Discord channel for further help Regards Wingthor
  22. There is plenty of YT vids with examples how to use, Here :) Regards Wingthor
  23. Hi Ciribob, I am currently working with function which is called from CTLD (Latest from github) callback function. I have tested in both single player and multiplayer and I seems not to receive any inforantion about user in args table? I can see only information about AI group involved. Regards Wingthor
  24. Here is a log file where only the latest connected player gets a file. dcs.zip
×
×
  • Create New...