johnv2pt0 Posted January 7, 2020 Posted January 7, 2020 Is there a way to do this within the SSE and not ME trigger?
johnv2pt0 Posted January 7, 2020 Author Posted January 7, 2020 Ok, I got it working by just doing the math, but I would still like to know if that function is built into the SSE somewhere. Thanks! local pos = _u:getPoint() local GROUND = land.getHeight({ x = pos.x, y = pos.z }) local gID = _u:getID() local zone = trigger.misc.getZone('AGL RESTRICTION') local zoneDistX = zone.point.x - pos.x local zoneDistY = zone.point.z - pos.z local zoneDist = ( math.sqrt( ( zoneDistX*zoneDistX ) + ( zoneDistY*zoneDistY ) ) ) if (pos.y - GROUND) > 31 and zoneDist < 18288 then
Habu_69 Posted January 8, 2020 Posted January 8, 2020 If you are going to use scripts, I highly recommend you consider MOOSE. It provides a user-friendly interface to the DCS scripting API and makes your action described above pretty easy.
johnv2pt0 Posted January 8, 2020 Author Posted January 8, 2020 Thanks Habu. I do use MOOSE for some things, but honestly my problem with it is trying to keep up with changes and finding the proper documentation. If I want to do X, I need to check the sample missions within eclipse (which doesn't completely answer my question), look at the moose documentation online (which doesn't completely answer my question), watch his videos (which doesn't completely answer my question usually because something within MOOSE has changed), and then try to sift through thousands of random posts on the discord (which doesn't completely answer my question). It's an exercise in frustration for me. I think what FlightControl is doing with it is amazing, but something just doesn't click for me. 1
Habu_69 Posted January 8, 2020 Posted January 8, 2020 Completely sympathize with your frustrations. I consider my Moose coding skills as intermediate level and find that altho a new Moose.lua is published very week or so, the new versions mostly introduce new classes and fix bugs. Seldom break something that is working. In my experience it took a few dozen hours of working with Moose to finally grasp the concepts and understand how to use the docs and sample scripts.
fargo007 Posted January 12, 2020 Posted January 12, 2020 The above exercise in moose would look roughly like this: local _zone = ZONE:New("enemyzone") local _group = GROUP:FindByName("badguys") if _group:IsCompletelyInZone(_zone) then end MOOSE has the best documentation there is for any of this stuff. Hands down. Just ask here like you're doing, or better yet join the MOOSE discord. Plenty of people there to assist, and once you get the feel for MOOSE you start laying down sick functionality really fast. Have fun. Don't suck. Kill bad guys. https://discord.gg/blacksharkden/
Grimes Posted January 13, 2020 Posted January 13, 2020 Ok, I got it working by just doing the math, but I would still like to know if that function is built into the SSE somewhere. Thanks! Doing the math is how you do it. There is no native scripting engine function for that. No harm in knowing how to do it that way either. Its like math class where showing your work was as important as getting the right answer. Same concept really. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
virgo47 Posted November 21, 2024 Posted November 21, 2024 Are there any updates for this in 2024? We've got not only circular but also a 4-point zone - this makes the programmatic check much harder. And there are conditions in ME triggers - but I can't see anything in vanilla DCS Lua scripting. I know I can do this with MOOSE, but do I have to use a library for this? L-39, F-4E, F-5E, F-14, F/A-18C, MiG-15, F-86F, AJS-37, C-101, FC2024 Yak-52, P-47, Spitfire, CE2 UH-1H, Mi-8, Ka-50 III, SA342 NTTR, PG, SY, Chnl, Norm2, Kola, DE Supercarrier, NS430, WWII, CA VKB STECS+Gladiator/Kosmosima+TPR DCS Unscripted YouTube "Favourite" bugs: 1) Object local camera fast/slow inverted, 2) Yak-52 toggles not toggling, 3) all Caucasus ATC bugs
Recommended Posts