CougarFFW04
MembersCougarFFW04 发布的所有帖子
-
Hello, Je voulais juste dire en passant que je découvre ATME et vraiment c'est un travail de fous :thumbup: :thumbup: Et la doc est vraiment super complète (même si j'ai un peu de mal parfois a m'y retrouver). Je pense que je vais utiliser à donf a l'avenir :smilewink: Donc un grand bravo et un grand merci :smartass: Mais surement je vais avoir quelques questions dans les jours/mois/années à venir :D
-
Hello, Bon alors : - j'ai rééssayé la mission démo sans rien toucher et effectivement ca marche. Je n'avais pas compris que la 1.46 était inclus directement dans la mission et du coup j'avais édité pour pointer sur le 1.45lua installé. - j'ai aussi réussi a faire mon petit exemple perso (principalement la dernière version du code au dessus) et ca marche. PAR CONTRE : il me semblait qu'il n'y avait pas de différence en soit si on utilise : - exécuter fichier script (et on pointe vers le fichier en question) ou - exécuter script (et on entre le chemin explicite pour le fichier) D'autre part comme j'ai un bug connu de l'éditeur (a savoir que parfois quand on modifie un script ce n'est pas répercuté dans la mission) on m'a conseillé d'utiliser cette méthode le temps du développement : on met simplement ceci dans la condition éxécuter script : dofile([[C:\Users\CougarFFW04\Saved Games\DCS\MyLuaScript\Test_ATME.lua]]) Avec évidement le nom du bon fichier lua (ici Test_ATME.lua). J'utilise toujours cette méthode car je suis sujet a ce bug (non résolu par ED) et ca marche très bien sauf si j'utilise ATME. En effet, pour un même script Lua : - si j'utilise le éxecuter fichier script ca marche - si j'utilise la méthode précédente j'ai tout les messages chelous tel que présenté au dessus... Et je ne comprend pas pourquoi... Pourtant je dois utiliser cette méthode au moins le temps du développement a cause du bug... Donc dans un premier temps si tu pouvais essayer de voir (simplement sur ta mission en exemple avec le chemin vers ta 1.45 qui est la seule dispo ) pourquoi la méthode expliqué (en gras) pose problème ca serait déjà un grand pas pour moi. Merci d'avance
-
Hello, Bon j'avais zappé ce message donc voir ici : https://forums.eagle.ru/showthread.php?t=229556 Pour info par rapport a un message précédent, ma méthode de chargement est pourtant bien la bonne... Thanks
-
Hello, Bon ben après une journée entière a essayer d'identifier le problème je tire ma révérence en attendant le retour des codeurs/testeurs/spécialiste ATME. Le simple fait de rajouter : local moduleName = " module_Randomize_Mission " local thisModule -- TRACKING WAYPOINT local function pushWpt(events) -- retrieve data relative to this event local flightData = events:getDatas() if events:getType () == "TRACKING_WAYPOINT" then -- display data retrieved ATME.displayForAll((flightData.group:getName()),5) ATME.displayForAll( "passing Waypoint :"..(flightData.idWaypoint),5) elseif events:getType () == "TRACKING_LAST_WAYPOINT" then ATME.displayForAll((flightData.group:getName()).." end of track : last Waypoint " ,5) end end local function onSpawnGroup(leadGroup) -- start monitoring waypoint for this group leadGroup:setWaypointsTracking(true) thisModule:addCoreEventCallback(leadGroup,pushWpt) end do newHandlers = { onSpawnGroupHandler = onSpawnGroup } thisModule = ATME.C_Module(moduleName, newHandlers, true) end induit les problème mentionnés alors que sans ces lignes de code, tout fonctionne au poil... A bientot donc, ++
-
Bonjour à tous, Ce message fait suite à celui-ci : https://forums.eagle.ru/showthread.php?t=229071 Mais je préfère écrire ici ce sera plus simple. ATME semble être vraiment l'outil que je cherchais pour certaines fonctionnalités du code que je suis en train d'écrire sans avoir à réinventer la roue... Donc un grand MERCI d'avance. Comme je disais je ne suis pas très familier avec les handler et bien que l'exemple qui m'ai été fournit me semble clair j'ai un peu de mal à l'adapter à ce que je veux faire et j'ai des erreurs... D'un autre coté j'ai aussi une erreur quand je fais tourner la mission de démo au moment ou le F18 atteint son premier waypoint (cf dessous)... Le code rapporte quand même le passage du F18 au niveau du WPT1 mais après plus rien... Concernant ATME j'ai crée un répertoire ATMEScript dans mon répertoire utilisateur DCS ou j'ai mis ATME_CoreV145.lua J'ai évidement modifié la mission pour pointer vers le bon dossier pour ATME_Core mais aussi pour le code lua de démo fourni. En gros pour résumer, le code démarre un certains nombre de vols qui sont déjà en place en début de mission mais inactif et ceci a certains temps calculés peu importe comment. Pour certains ce ces vols, je souhaite faire un monitoring des waypoints pour déclencher certaines actions automatiquement au waypoint voulu via script. Supposons que j'ai écrit une fonction faitca() si je l'active directement dans l'éditeur au waypoint donné tout fonctionne a merveille. Le pb c'est que quand j'essaye de le faire tout en automatique j'ai des erreurs que je ne comprends pas... En gros ca se présente comme ca et voila ce que j'ai fait pour essayer de metttre en oeuvre le tracking des waypoint de facon automatique : -- On est d'accord ici c'est pas du vrai code de A a Z mais un cheminement des idées -- Bref ca commence normalement comme tout script lua... -- je définis un certain nombre de varaibles TOTO = "pouet" TITI = nil -- et un certain nombre de fonction local function f1() whatever... end -- y compris ma function local function pushWpt(events) -- retrieve data relative to this event local flightData = events:getDatas() if events:getType () == "TRACKING_WAYPOINT" then whatever elseif events:getType () == "TRACKING_LAST_WAYPOINT" then whatever end end -- puis vient une antre fonction qui est checké chaque seconde par un trigger dans l'éditeur de mission function activateFlights() -- peu importe ce que fait cette fonction mais a un moment, si une -- condition est vraie un vol est activé. Et c'est a ce moment la que je veux -- activer le suivi de waypoint pour ce vol en question: if true then startFlight(leadGroup, leadName) -- et je démarre le monitoring pour ce groupe leadGroup:setWaypointsTracking (true) thisModule:addCoreEventCallback (leadGroup,pushWpt) end end -- Ensuite arrive la fin du code et une function qui est lancé dans l'éditeur -- via un trigger "début de mission" checkIniFlights() -- Cette fonction fait pas mal de chose et en particulier c'est la que j'ai mis : thisModule = ATME.C_Module("peu importe", {activateFlights}, true)]] -- et le code se termine la end Et le problème c'est que ca plante avec ca comme indication : La ligne de code 337 coorespond a l'instruction : thisModule = ATME.C_Module(....) du code ci dessus. Je précise que le probléme ne vient pas d'une erreur de syntaxe lié a des instructions AUTRES que celles liées a ATME... puisque sans la partie ATME que j'ai rajouté, tout fonctionne comme prévu. Mon problème c'est que je ne maitrise pas trop ces handler et donc j'avance un peu dans le floue et du coup je ne suis pas trop sur que l’adaptions de l'exemple donné est correct... Et à l'évidence non puisque sans la partie ATME ca marche nickel mais dés que j'introduis les ligne de code afférent à ATME ca plante... Et surtout je ne vois pas trop le rapport avec ce mis....0782.lua J'ai aucune idée d'ou sort ce truc... En particulier puisque le handler fait référence a activateFlights j'immagine que je n'ai plus besoin de mettre cette fonction dans un trigger évalué chaque seconde dans l'éditeur de mission puisque le handler est "lancé par CheckIniFlight une fois pour toute en début de mission.. Bref comme vous voyez ces handler ce n'est pas trés clair dans ma tete... ceux par défaut de DCS ca va je m'en sort assez bien mais le custom handler de ATME j'ai plus de mal.. Si quelqu'un pouvait me dire ou est l'erreur ce serait cool... Merci d'avance
-
Hi Delta99, Oh yes I already noticed this... hoooo I thought it was in nautic mile... Thanks for letting me know :thumbup:
-
Hi snowsniper, Sounds this is much more than I need... and easy to use... I will have a closer look and try asap :thumbup: Thanks PS: Merci pour la documentation en Français :smartass::smilewink:
-
Hi Lua scripting Gurrus, I would like to know if it would be possible to build a custon event handler (let's call it S_EVENT_WAYPOINT) that would monitor flight and return for exemple flight name and waypoint when a flight reach his flight plan waypoints. For exemple when flight named "F18" reach his wpt 2 it would return something like {"F18", 2}. I see that scripting documentation propose a template event ( S_EVENT_{{{eName}}} as per the documention) but as I am not very familiar with handler I do not know at all what to do with that and how to build the custom handler. Help is welcome, Thanks
-
OK got it. Will post solution later.
-
Hi Lua scripting Gurrus, I would like to detect if a flight (let'say it is named "TOTO") entered a DCS area. I think the best way is to use the DCS function searchObjects. To learn how it works I ran the exemple in the documentation namely: local foundUnits = {} local sphere = trigger.misc.getZone('town') local volS = { id = world.VolumeType.SPHERE, params = { point = sphere.point, radius = sphere.radius } } local ifFound = function(foundItem, val) foundUnits[#foundUnits + 1] = foundItem:getName return true end and put world.searchObjects(Object.Category.UNIT, volS, ifFound) in a DCS trigger runing continuously Of course I have an area named "town" and planes entering this area but as soon as I run the mission, DCS complains : Parameter #2 (function) missed I tried different things but I am still sticked with this error. As I am not very familiar with handler may be I am doing something wrong... Could someone show me the code that would just write on screen "TOTO entered town" when this event occurs. Thanks in advance
-
OK got it :D The correct seems to be the following (and it make sens) The only suspicious thing is that if you mention n as the last waypoint, the escort flight RTB as soon as the flight reach waypoint n-1 :music_whistling: Is this a bug introduced recently or is like that from the begining ? Thanks
-
Nobody ? I can't find anything on the net for that although I think it is something very simple for DCS Lua Gurrus... I am sticked with that :joystick: Help welcome :helpsmilie: Thanks
-
Hi Grimes, Thanks a lot :thumbup: Any idea about the Escort script problem :joystick: https://forums.eagle.ru/showthread.php?t=228754 Thanks
-
Hello, I do agrre qith you all... But what is the prupose of isExit.... Really I think it is useless if it cannot telle you that a unti does not exist... But may be I am missing something there...
-
So after digging al lithe bit i tried this code: function setEscort(lead,relativepos,lastwpt,dshoot) local MyEscort = { id = 'Escort', params = { groupId = Group.getByName(lead):getID(), pos = relativepos, lastWptIndexFlag = true, lastWptIndex = lastwpt, engagementDistMax = dshoot, targetTypes = { "Planes", "Battle airplanes", } } } _group = Group.getByName(lead) _controller = _group:getController() _controller:setTask(MyEscort) end The mission consits of a A10 bombing some targets and a F15 to which I have attached the foolowing script at it's wapoint 1 :setEscort('A10',{-100,-100,-100},3,50.0). Unfortunatly the F15 never go to escort the A10 and the A10 rushed vericaly to the gound and crashes while the F15 does RTB :joystick::joystick::joystick::joystick: Edit :I even got much more ugly things : the A10 flying forward in reverse :cry::helpsmilie: What I am doing wrong ? Thanks
-
Hi All, I am interested to set an escort task to an AI via the setTask function. Escort task is described as follow in DCS : Escort = { id = 'Escort', params = { groupId = Group.ID, pos = Vec3, lastWptIndexFlag = boolean, lastWptIndex = number engagementDistMax = Distance, targetTypes = array of AttributeName } } All parameters are clear except the targetTypes... I understand this should be an array but I do not understand what I must put there... In particular how do I specify that I want that the escort engage - only fighter, bombers and helicopter or - only SAM Could someone give me an exemple ? Thanks
-
Yes sure I can. What I was doing in fact. But what is the purpose of the isExist if it crashes if the group does not exist ? Thanks anyway
-
Hi Guys, I am interested to test if a group exist and wanted to use the isExist function but I am running into trouble : if Group.getByName('whatever'):isExist() then trigger.action.outText("Exist", 10) else trigger.action.outText("Does NOT exist !!!", 10) endThis works fine if the group exists but gives an error if it doesn't :joystick: What am I doing wrong ? Isn't the isExist function supposed to tell you if a group exist or not... Obviously if it doesn't the getbyName will return nil but isExist is complaining :cry::joystick: Thanks
-
Hi Guys, @Grime: Thanks for your prompt reply. I will have a look at the list. @Hardcard: Thanks. Already got things in the other thread but got these ones as well. This helped a lot. This community rocks :smartass::thumbup::pilotfly:
-
Hi Hardcard, I came to a similar conclusion (using HIT instead of DEAD and reading the life point) and I got it. Thanks a lot because our discussion pointed me in the right direction :thumbup: I have just downloaded your script (and mission) and will compare/mix with what I did. Thanks again :smilewink: You rock :thumbup:
-
Hi everyone, I would like to know if : - it's possible to find elsewhere the "point of life" associated to any DCS object (for exemple what is life point associated to a TV antenna or whatever) ? - it's possible to change the point of life associated to static object we put somewhere inthe DCS world (for exemple I want that the point of life of a flag I put elsewhere is 5000) ? - or even better, is is possible to add our own object with our associated life point ? Thanks
-
Hi HardCard, Thanks for your help althought as I do not use Moose and would like to use only DCS things for "simple" (not so simple actually as I failed) stuff I am confused and still not yet sucessfull to run it. Where is this IniUnitName documantation... I cant find anything about that in the wiki... is this a Moose thing ora standart DCS one... I am also a little bit confused with DCS convention : what is the difference between a static object and a scenery object ? When I spawn let's say a red flag somewhere in DCS world is this a static or scenery object ? Still digging to have this simple thing (getting the name and coalition (red or blue) of an object (actually a red flflag) when it is destroyed) working :joystick:
-
Hi Guys, I would like to check the status of some static objects and in particular to use the S_EVENT_DEAD event to check if it is destroyed and which one it is. Although I am able to catch the event I am unable to get name of the "object" that is detroyed... Edit : just to make things clear and as I have a doubt about what DCS is considering as a static and a scenery object, I put a "red flag" named let's say "whatever" somewhere in the DCS world and would like to get the information when it is destroyed the coalition it belongs to and who destroyed it i.e. somethinhg like that :"Whatever" (red camp) has been destroyed by "whoever" I tried to apply the mecanism I use for exemple to get the name of a pilot that take off (with the unit:getName() ) or it's flight name (with unit:getGroup():getName() with unit define as unit = event.initiator) but it doesn't work in that case... What am I doing wrong ? How to do it ? Thanks in advance.
-
Hi DCS scripting gurrus I am interested to know when a IA group has landed. I would like to use S_EVENT_LAND as suggested above but didn't understand how to use the world.addEventHandler function and didn't sucess yet to do anything with that :joystick: Can someone point me to an exemple ? Thanks Edit : got it with this simple exemple : I execute world.addEventHandler(LandingHandler) in the ME with the following code. Hope this might help someone sometime. LandingHandler = {} function LandingHandler:onEvent(event) if event.id == world.event.S_EVENT_LAND then trigger.action.outText("Land event occured", 10) end end
-
Hi DCS scripting gurrus, What are the pending DCS scripting functions of the "Group alive", "Group alive less than" and "Group dead" ME conditions ? Can't find them... I would like to get the status of a flight in particular I want to test if it is still alive or if all the flight members have been destroyed. How to do that (scripting) ? Edit :After digging a bit more I think that these pending functions do not exist but one can use the Group.getSize() and Group.getInitialSize() to do it. Thanks
-
- 1
-
