Jump to content

Wingthor

Members
  • Posts

    59
  • Joined

  • Last visited

About Wingthor

  • Birthday 03/31/1968

Personal Information

  • Flight Simulators
    DCS World
  • Location
    Oslo
  • Website
    https://www.wingthor.net

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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
  2. 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.
  3. 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.
  4. 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)
  5. 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
  6. 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
  7. In your mission script can you turn the ICLS on and off, and can you change channel?
  8. 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
  9. Check out the Finite State Machine for Moose in SET_Groups documentaion. The OnAfterAdded is already implemented.
  10. 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
  11. 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...
  12. 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.
  13. 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
  14. 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
  15. There is plenty of YT vids with examples how to use, Here :) Regards Wingthor
×
×
  • Create New...