Jump to content

Wingthor

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Wingthor

  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
  16. 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
  17. Here is a log file where only the latest connected player gets a file. dcs.zip
  18. I am using feature "export a separate file for each player" in TacView 1.7.1. It appears like it only exports TacView file for the latest connected player. Anyone else have this problem? Regards :)
  19. Can someone confirm the fix? From tacview it seems like ARMs Kh-58 and Kh-25mpu does either to far without hit, or when hit do no dammage. That is Open Beta latest ver. as pr this date.
  20. Have you solved this? Look into Moose demo mission. I do believe you will find demonstration of what you try to achieve here: Moose Demo Missions for Groups (Patrol) If not plz ask and I will try to help. Moose also has a community on Discord, for more instant help :) Regards
  21. [string 'C:\Users\xxx\AppData\Local\Temp\/DCS~mis000000920']:4: attempt to index 'EVENT' (a nil value) slack traceback: [C]: ? [string 'C:\users\xxx\AppData\Local\Temp\DCS\/~mis000000920']:4: in main chunk AM I screwing something simple here? I mean, this is not a huge complicated script. Its hard to say based on this info. I wonder if you can share your troubled code with us, especially line 4 in your script is of interests. :)
  22. SpawInZone will execute the spawn. Same with SpawnScheduled. Look for all the commands prefixed with Init. These will defined the Spawn Settings. If you look at Moose docs, you will find InitRandomizeZones which takes a table of Zones as argument. By give a table with only one Zone I guess will achieve what your want by use SpawnScedueld. So if you have BluelaunchZone (A Zone defined in Mission Editor (ME)) you use BluelaunchZone = ZONE:New("Bluelaunch") -- What ever its called in ME SpawnArray = {BluelaunchZone} BlueSpawn3 = SPAWN :New( "Blue Strike 1" ) :InitLimit( 4, 10 ) :InitRandomizeZones(SpawnArray) :SpawnScheduled(10, 0.20) -- Will spawn a new group each 10 sec, with 20% variation, Limit is 4 Hope this works for you :) Also you can have a look here Regards
  23. Right,but any 20 sec. if zone is empty you redefining RussianConvoyNorth1. What you wanna do is to make a zone template outside scheduler, like: RussianConvoyNorth1Template = SPAWN:New( "Warg" ):InitLimit( 40, 5 ) :OnSpawnGroup( function(MooseGroup) BASE:E("Spawn!") local pivot = 0 for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do local UnitAction = UnitData -- Wrapper.Unit#UNIT --BASE:E(UnitAction:GetName()) BASE:E(UnitAction:GetTypeName()) if pivot % 2 == 0 then AddDismounts(UnitAction:GetName(), "ZU-23") else AddDismounts(UnitAction:GetName(), "Rifle") end pivot = pivot + 1 end end) Messenger = SCHEDULER:New(nil, function() --if not Poticlear then if RussianTroopsPoti:AnyCompletelyInZone(PotiZone) then BASE:E("Spawn Triggered") RussianConvoyNorth1Template:SpawnScheduled( 180, 0 ) end end, {} ,20 ,10) (NOT TEST CODE) And call the Spawn from within time scheduler. However SpawnScheduled( 180, 0 ) is a scheduler by it self and will spawn a new group each 3 minute. However I am not 100% confident about what you want. Will this "Warg" group spawn inside PotiZone?
  24. Something is strange in your code. Why are putting a timer function into a timer function? Also you are redefining RussianConvoyNorth1 every 20 second if PotiZone is empty. My guess is that the strange behavior of OnSpawnGroup is that you are re respawning, RussianConvoyNorth1 every 20 sec.
×
×
  • Create New...