Search the Community
Showing results for tags 'scripting'.
-
Not sure if it could induce a bug or not, but while scripting a little tool around dtc files, I found out that threats name and hint encoding in those may vary between threats types or between F-16 and F-18 dtc files. For example, SAM Hawk MPQ-50 is encoded as "SAM Hawk – MPQ-55" in the F-18 dtc file and as "SAM Hawk - MPQ-55". The difference lies in the dash between Hawk and MPQ: one uses the \u2013 encoded value whereas the other uses \u002d. Don't know if it is intended or not or if it can even induce a bug but i prefer to inform about this.
-
Working on the current EW Script and having some problems. Getting error messages like this: Going over my current script where all I did was change Prowler1 to Growler1: EW script EA18G.lua I think what I need to do is add to the script a way to know jammer = Growler1 to represent the EA-18G I'm using in the mission below. Simple Hornet HARM Mission 04vD6v2-Scripts.miz Thoughts?
-
[18th April update: Thanks to the thread contributors and all those documents, this is such a fascinating and amazing topic. This project was massively ambitious and in a competition for my time between everything else and a 5th month old Border Collie puppy with no manners, I submit my work to date to the community 'as is' to do what you like with! Attached kmz. ] I could use some help from the armchair army to check the Google KML I am producing, before public release. Using a combination of KML's from Speedy on the army rumour service for the British and Soviet installations, a filtered SAMsite overview and my own work to collect, locate and organize the US installations I have over 1210 Google mapmarkers in the most complete rendition of 1960-1995 Germany's Cold War installations. The KML will eventually become a key reference resource for locations in the upcoming DCS map. Mission makers can check the details provided for targets and mission use. The KML will eventually be imported to DCS as a rough template of locations. I don't intend to place any objects as there won't be a 1:1 parity and there are clearly too many, but it is enough to add sites for your missions. The KML for Cold War Germany comprises of: Over 1200 placemarks categorised and colour coded (so far) The inner border reference line East and West Air defence sites (for West, the Nike Hercules is available for pre 1984 but dates are pretty tough to get) British American Soviet/E. German --Airbases and minor Helicopter airfields --Barracks and installations --Ammo Depots --Training Areas --Special Weapons Compounds --Stores --Fuel dumps/CEPS The rough time range for these is 1960-1995. What I am looking for initially is anyone interested in helping expand on this, specially if they want to zero in on, for example, enriching the US Kazernes with any reference links, tidying up the current placemarks, finding names for the unamed ammo dumps, checking the data with online references, etc. I'm definitely interested in anyone with knowledge of the Eastern European theatre, the locations and names of units and their stations, the airbase complements and time ranges. Also those with good knowledge of the FEBA and plans who can identify major themes that can be added to the KML or fill holes and gaps, such as the areas east of Luneburg and Hamburg, east of Braunschweig, east of Salzgitter and Northeim, etc. Please don't ask for the WIP copy, it will arrive here when its done. Feel free to add details of the theatre to this thread. Whilst I've seen a lot of resources online, its not the finding of the information so much as the time it takes to create a nice placemark with links, find the modern day geo coordinates from the resource that is now hidden under a Lidl or BMW factory and so on. there's issues of time and date filters which I havent even attempted. It will never be perfect but thats not the aim. Cold War Germany.kmz
- 57 replies
-
- 33
-
-
-
Title, having an event you can use to see if a flare was dropped to see if it was within a radius of a convoy to get them to turn away (Show of force), have a SAM operator count chaff before shooting another missile etc. etc. opens a lot of scenarios and use cases if this was added. This is something people would like, reference this post.
-
[Scripting] Expose functions to send datalink messages.
OttoPus posted a topic in DCS Core Wish List
Hello, as the title says it would be very useful to have APIs to be used via mission scripting or Export.lua to send datalink messages directly to aircraft that support it, like the A-10C, the Apache, and so on. Thanks-
- lua
- lua script
-
(and 1 more)
Tagged with:
-
Я скачал скрипт, засунул его в Макс 12, делал все по инструкции, указываю путь к папке Shapes а модельки не открывается, приложу видео для просмотра проблемы более понятно, заранее спасибо большое за помощь VID_20250110_190403_802.mp4 I downloaded the script, put it in Max 12, did everything according to the instructions, I specify the path to the Shapes folder, but the models do not open, I will attach a video to view the problem more clearly, thank you very much in advance for
-
Hi guys! Do you want to dynamically spawn, respawn and despawn groups in your DCS mission? Do you want to have sub folders in the F10 menu? Did they tell you you'll need to learn LUA coding and the DCS scripting environment to do it? Well, I learned LUA so you don't have to. This script will create submenu's in the F10 menu based on the names of groups. It will create a sub menu for every group that has within a spawn and despawn button, these do exactly that. For now it's possible to go 1 submenu deep and also to add multiple groups to 1 spawn/despawn button. An example: If I have the following groups: !! Red 1 !?Wave 1?! Red 2 !?Wave 1?! Red 3 !?Wave 2?*BULK 1*! Red 4 !?Wave 2?*BULK 1*! Red 5 The following F10 menu will be created (not accounting for the random order it will be in): Red 1 Spawn Despawn Wave 1 Red 2 Spawn Despawn Red 3 Spawn Despawn Wave 2 BULK 1 Spawn Despawn As you can see Red 4 and 5 are not shown as they are a part of BULK 1 and both will be spawned or despawned by the buttons. To learn more check it out on GitHub: https://github.com/Markoudstaal/DCS-Simple-Spawn-Menu Need help? Join this Discord: https://discord.gg/8VbKnKvN5r
-
This should be trivial. Unfortunately, my limited programming skills are hampering my ability to solve this. Essentially, I have this challenge for a racing mission I put together for my pals 1) Capture the time an aircraft crosses a start line (zone) using DO SCRIPT 2) Capture the time that aircraft crosses a finish line (different zone) using DO SCRIPT 3) Subtract #1 from #2 and output to screen using same DO SCRIPT from #2 My poor understanding of LUA isn't allowing the math operation on #3. I can post the mission if its easier. Its basically 2 triggers that I currently have on timers so they fire and there's no requirement to fly/enter the trigger zones. Start trigger local _StartTime = timer.getTime() -- Put start time into variable local _CharacterTime = mist.getClockString(_StartTime) trigger.action.outTextForGroup(1, _CharacterTime, 30, false) -- Print start time to screen for debugging End Trigger local _FinishTime = timer.getTime() -- Put finish time into variable local _ElapsedTime = (_FinishTime - _StartTime) -- Calculate Elapsed Time (this is the command that crashes scripting engine) local _CharacterTime = mist.getClockString(_ElapsedTime) trigger.action.outTextForGroup(1, _CharacterTime, 30, false) --Print ET to screen for debugging How do I perform this subtraction of variables captured at different times in the mission by different DO SCRIPT events? Also, I am using MIST because I saw some other posts using it. I do NOT have to use it. Simply looking for the easiest way in which to do this. Thanks!!
-
I propose some small improvements to ME that are easy to implement and would add a lot of value for users. General QOL Option to leave values in waypoint options blank to be populated with value from earlier waypoints. This would allow altitude/speed of a whole route to be changed with a few clicks, instead of needing to edit every waypoint Better randomization options All editor fields that accept numbers should accept basic syntax for random min-max between two numbers, so that airspeed, altitude, timed conditions, etc. could easily be randomized by typing in a range instead of single value All editor fields that accept numbers should also accept variables / flags as well as simple equations (f.e.: varA*varB-varC) Random placement circle option for every asset and waypoint (would choose position randomly on mission start within defined radius) Multiple possible routes per group within the UI, without scripting (f.e. option to create "dummy-objects" and make a route for them and allow proper units to switch to those routes by advanced "switch waypoint logic" with probability option to have multiple possible paths Nested mission files / smart dependencies Ability to open a mission file in another mission as "smart dependency" without hard merging. This would allows mission designers to make variations of missions based on template missions that could be edited later and thereby update all missions that use said template. A template could f.e. hold most AI and static objects, where the "active" files could hold setups for different player aircraft, friendly AI, additional AI for balancing or simply different weather and time of day... If users want to edit assets from the template file, the editor would load that file as active template If you like the proposed improvements, please rate this thread 5 stars: Thanks!
-
I would like to export some data out of a mission while it's running using socket.http, but I can't for the life of me get it to work. I've editod my MissionScripting.lua file so nothing is sanitzed and I have access to the require module. Looking at other (older) threads on the forum here, as far as I can tell the following code should work? package.path = package.path..";"..lfs.currentdir().."\\LuaSocket\\?.lua" package.cpath = package.cpath..";"..lfs.currentdir().."\\LuaSocket\\?.dll" local http = require("socket.http") But it errors out with: 2022-01-23 16:36:37.313 ERROR SCRIPTING: Mission script error: [string "G:/My Drive/Coconut Cockpit/Missions/DCS_CaucasusTraining/Scripts/init.lua"]:58: module 'socket.http' not found: no field package.preload['socket.http'] no file '.\socket\http.lua' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\lua\socket\http.lua' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\lua\socket\http\init.lua' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\socket\http.lua' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\socket\http\init.lua' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\\LuaSocket\socket\http.lua'socket.http no file '.\lua-socket\http.dll' no file '.\socket\http.dll' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\lua-socket\http.dll' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\socket\http.dll' no file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\\LuaSocket\socket\http.dll' no module 'socket.http' in file 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\lua-socket.dll' stack traceback: [C]: ? [C]: in function 'require' [string "G:/My Drive/Coconut Cockpit/Missions/DCS_CaucasusTraining/Scripts/init.lua"]:58: in main chunk [string "ROOT_PATH = "G:/My Drive/Coconut Cockpit/Missions/DCS_CaucasusTraining/Scripts/"..."]:8: in main chunk Does anyone have an idea what I'm doing wrong? Any help is appreciated!
-
I would imagine ED is aware of what the next level of immersion on the deck is, crew not just stationary, but kneeling, interaction with other crew (moving arms/hands as if communicating) moving between aircraft and work areas, driving tows/tractors, AI pilots entering exiting aircraft etc. The scripting is already there in the launch crew (great job btw). This would be a big step forward. Also some scripting templates to use in ME to populate the deck based on what type of tasks the mission you want to build needs and much more simple way to spawn aircraft in the parking spots preferred.
- 5 replies
-
- 6
-
-
- supercarrier
- deck crew
-
(and 1 more)
Tagged with:
-
Currently the possible AI tasks depend on a fixed mission type (e.g. CAS, CAP, Runway bombing, etc.), but I would like to see a mission type that includes all AI tasks for multipurpose missions. It was a great idea adding the blue/red combined arms coalitions to unlock all units for a side, so if something similar could be done for AI tasks, it would allow mission designers and scripters to add more complexity to their missions. Another restriction that should be removed is that ground units cannot be assigned to attack designated aerial targets. This would be very helpful especially for Lua script designers, who could tell AI SAM units to engage only specific targets (like e.g. only attack bombers with a Sa-2 group, or attack only aircraft above a certain altitude, or attack only HARM missiles with a Sa-10 site, etc.). Currently ground units can only be assigned to attack other ground units. I hope ED considers to add these simple changes. Imo it would open up a lot of opportunities.
-
Hi guys, I don't know where to post this question, but I'll just start here I'm trying to export info from LoGetTWSInfo() export function yet it keeps being Nill. LoIsSensorExportAllowed() // returns true in my case (it's single player anyways) There is other functions that get Sensory data that work. So I'm curious why this one isn't. I've been testing with the F-16. Anyone got some pointers?
-
Hello! How do i via File in "Do script file" change a Game Flag's value? I have a simple script that counts Kills for both sides, Players and AI... But my script dies on it, it only shows the totals but it don't interact with game itslef... I tryed to imput totals to a Flag but every time a kills happens a scritping error is thrown... I tryed the following: local Temp = Event.initiator; if Event.id == 5 then if Temp then _ = Temp:getCoalition(); if _ == 1 then Blue=Blue+1 trigger.action.setUserFlag('10000', flag_value + 1) end if _ == 2 then Red=Red+1 trigger.action.setUserFlag('10001', flag_value + 1) end return end end And i get the error in attached image. I'm not sure if this is the correct approach... So i'm open to new ideas! Thanks in advance!
-
Hi, I've been having issues where AI aircrafts do not fly at the altitude I gave them through the task mission in scripting. I have a mission with two fighter groups (Rafale C), an AWACS (E-3A) and a Tanker (KC-135MPRS). At first, I make them start from parking. I then give them this task : local on_the_way = { id = 'Mission', params = { airborne = true, route = { points = { [1] = { type = "Turning Point", action = "Fly Over Point", x = coordinates_plane.x, y = coordinates_plane.y, alt = args.altitude, alt_type = "RADIO", }, [2] = { type = "Turning Point", action = "Fly Over Point", x = coordinates_racetrack_start.x, y = coordinates_racetrack_start.y, alt = args.altitude, alt_type = "RADIO", } } }, } } local orbit = { id = 'Orbit', params = { pattern = "Race-Track", point = coordinates_racetrack_start, point2 = convertCoords(args.point2), speed = args.speed, altitude = args.altitude, } } local controller = Group.getByName(args.group_name):getController() controller:resetTask() controller:pushTask(on_the_way) controller:pushTask(orbit) The aircrafts all go to their zones and perform their race track orbit so I know that it works. The issue I have is that my AWACS flies close to ground level despite the altitude of 20000 feet I give them (I checked this altitude by printing it). When I change the AWACS plane to any other plane it then works and the AWACS flies at the right level. Things get weirder with the fighters, when starting from parking, my Rafales fly at the right level. But when they start from the runway, they fly at ground level as well. And when I change their type to Mirage 2000C, they work again and fly at the right level, even when starting on the runway. So what I thought to be a plane issue seems to also be an issue with their starting zone. But I tried changing the start of the AWACS and none of my changes made it work. I'm also thinking the issue could come from mission scripting as the altitude works when I set the planes routes from the mission editor and not from scripting. I was wondering if anyone had encountered the same issue in the past. And if so, is there a solution to these issues. Thanks a lot for your help.
-
Am I correct in thinking there is no script access to the Resource Management? Even read-only? Are there ways to interact with the Resource Management through unit spawning/despawning? If not, what is the intention behind the Resource Management system, beyond the restriction of player loadouts?
-
Hello everybody. I am not sure this is the right spot to post my questions, but I am quite new both to DCS and the forum. Leveraging on 30 years of Air Force experience, I have been contacted to develop BFM/AFM and BVR training scenarios. Mission Editor helps, but I am still struggling with some controls. Cutting to the chase… Is there a way to: - Make red air (AI) notch (turn approx 90 degrees off the initial heading) at a pre-determined distance? I get the trigger/moving trigger zone, the problem is the specific action - Make red air (AI) commit on condition (eg. X many seconds after the notch or at a specific distance) - Make red air (AI) resume CAP if blue air “strays” I have been dabbing with Combined Arms (it CAN control Air Assets as well as Ground) but it becomes a challenge with multiple units (it’d be easier to play the Flight of the Bumblebee on a piano!) Thanks for your help. By the way: I have zero scripting skills. P.S.: I might repost this in other pages, as I attempt to discover more suitable Topics headers, digging in the forum.
-
At any point, tell an AI unit to go immediately to it's NEXT waypoint. If there are no more waypoints left, go back to it's first waypoint. This prevents the need to get and parse the table of waypoints to work out which one it's between and what the next one is (a huge overhead), and whilst 'goToWaypoint(n)' does work, you have to do all the work I've just mentioned to work out which one is the next one. Alternatively, have a 'getNextWaypoint' function that returns the number of the next waypoint. And a 'getTotalNumberOfWaypoints()' function, so we can see where it is in the list and then call 'goToWaypoint()' with the correct number.
-
Hi, When flying in VR the compass rose is easy to move around on the map, would it be possible to expose the geographical location of it to the scripting environment? It would open up a lot of possibilities, ie. create WP for AI, target for AI, call in artillery on a point etc. Regards, Dan.
-
Hi, my name is Morris and I am CAG of vitural Carrier Air Wing 22. Part of our flight training is Field Carrier Landing Practice on Rota Island to get our pilots used to carrier procedures as it is done in real life. Since there is no Shore Based IFLOLS system in DCS (at least not anymore) I figured, I'll code a mod to trigger a IFLOLS overlay similar to the one coming with supercarrier, so that the pilots can learn to fly the ball, without the need to fly to the ship. I got a solid understanding of most programming terms from years of python coding, but most of my programs were only single scripts. So I need a little help with using functions from one file inside another and stuff like this. Furthermore I do not really get how the structure of DCS Mods works and what triggers what or what depends on what. First of all: What is the minimum I need to do to show my overlay inside the game after loading into an aircraft? The overlay I am using is a copy of the FLOLS from supercarrier. So I assume the DLG file works. The next thing: How do I read the aircrafts coordinates from DCS? To calculate the position of the Ball, I need to know the aircrafts coordinates and altitude I know I need to write a hook, so that I can get data from DCS. But how do I do this? This is my first try to mod DCS, so any help is appreciated. I hope you guys understand what I am trying to do. Thanks in advance, Morris "Cuzy" Messing
-
It's long been known that this trigger is unreliable or dysfunctional for most applications. There has been comments made that this maybe be a placeholder or has some 'unknown' workings. However, it's exposed in the DCS Scripting Engine API. Therefore it SHOULD be documented and fully working. As it's the ONLY possible event trigger relating to units/groups ENTERING or LEAVING a trigger zone, this is a truly crucial and valuable event to hook into. Kindly, like the 'menuItemsForUnits' and the broken ' S_EVENT_PLAYER_ENTER_UNIT for MP Dedicated servers, consider this an urgent fix that would enable a huge amount of efficiency and power to the scripting engine and functionality for all mission designers.
-
add setCoalition fuction to match getCoalition function
Drofseh posted a topic in DCS Core Wish List
There are a lot of requests already on this forum in support of the idea of having additional sides or coalitions beyond the existing Red, Blue, and Neutral, I fully support these requests, and they should also include functions to set the hostility of the different coalitions. In a similar vein adding a command that woud allow units or nations to have their coalition switched would be a welcome addition to DCS. My use case for this is that I am making a mission in which the players will be primarily operating inside one country (UAE on the Persian Gulf terrain). I would like to have AI air patrols in adjacent countries (Qatar, Oman, Saudi Arabia) that will only become hostile only if they players stray into the airspace of the adjacent countries. My current work around is to have the AI flights always as Opfor set to Late Activation, and then activate them with a triggers shaped to the airspace of the adjacent country. If I had a way to change their coalition I could have them set to Neutral and actually on patrol, then use a fuction like setCoalition to change them to hostile if the players stray into their country's airspace. Possible implementations of a setCoalition command could either change the coalition of the entire nation, or just of a specific unit, or add a command for each option. Examples: Change unit's side CoalitionObject.setCoalitionUnit(coalition.side) myPlane.setCoalitionUnit(RED) Change nation's side coalition.side.setCoalitionCountry(countryId) RED.setCoalitionCountry(73)