-
Posts
90 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Kolyma
-
Querying the DCS Scripts\Database\planes type files from with LUA
Kolyma replied to Kolyma's topic in DCS Modding
I thought so. That static, cut-n-paste version of gathering that data is how I've handled the idea in the past. I'm going to write something library-like to just build up a script-useful dynamic db derived from the actual DCS files installed at runtime. Worst case scenerio (if a script ran from the LUA engine can't for some reason touch those files when running, I'll make it do some kind of out-of-script pre-procesing to build a static version of the loadable DB. If you can think it, you can do it, right? -
Civil Air Patrol skin for F-5E Tiger II download is available here: https://www.digitalcombatsimulator.com/en/files/3051127/ Anyway, here's my custom skin of a fictional F-5E Tiger II for the Civil Air Patrol (CAP), a US Air Force Auxiliary. The color scheme and markings are seen most often on their large inventory of Cessna aircraft used for Emergency Services and Aerospace Education. Getting those 3 parallel stripes all the way down the fuselage was trying. I really like the way the nose cone portion worked out. Any recommendations for changes or improvements are appreciated.
-
OK, I got it to work by creating a directory here \Bazaar\Liveries\f-5E and placing my custom skin folder there. It is the only skin in the \f-5E\ folder. Previously, I found all the other F-5E-3 skins in \CoreMods\aircraft\F-5E\Liveries\F-5E-3 and my custom skin dir was there, which worked fine to choose from in the actual DCS game and when using the ModelViewer and manually choosing the custom skin from the Liveries dialogue. So I'm thinking I really shouldn't be working out of the \Bazaar\Liveries\f-5E dir. Maybe I should even be using something out of \Users\username\SavedGames\... I suppose this a path'ing or setting problem when using the ModelViewer. Can you or someone help? Thanks
-
I think this idea is beyond currently documented info about what end-users know about the DCS API for LUA and there's no existing library doing this kind of stuff 1) From inside a script running under the DCS LUA sandbox engine, is it possible to access an existing in-memory database that contains this kind of information? \Scripts\Database\planes\A-10C.lua I'm specifically looking if I can build up or access a key/value store of the pylon locations and authorized munitions, plus other aircraft-specific capabilities defined in those files in that directory. 2) If I can't get it from the DCS API in LUA scripts under the engine, I'm thinking of trying to access the files myself from within a running script and build up the key/value store. That's assuming a running DCS LUA scripts is not permissions-blocked from accessing that area of the file system. Does anyone know the best way to integrate these files into a custom DCS script in order to generate some kind of comprehensive database? I have no problem enumerating the files themselves and cycling through accessing them. I'll admit to being more of a C++ and Python programmer, so my LUA stuff is hackety hack hack right now... return plane( "A-10C", _("A-10C"), { EmptyWeight = "11325", MaxFuelWeight = 5029, MaxHeight = "13700", MaxSpeed = "840", MaxTakeOffWeight = "21081", Picture = "A-10A.png", --!!!! Rate = "50", Shape = "a-10", WingSpan = "17.53", WorldID = 58, -- Countermeasures passivCounterm = { CMDS_Edit = true, SingleChargeTotal = 480, -- RR-170 - 30 cartridges per magazine, increment by 2 magazines chaff = {default = 240, increment = 60, chargeSz = 1}, -- MJU-7 - 15 cartridges per magazine, increment by 2 magazines flare = {default = 120, increment = 30, chargeSz = 2} }, { pylon(1, 0, -0.615000, -0.016000, -6.365000, { use_full_connector_position=true, }, { { CLSID = "{DB434044-F5D0-4F1F-9BA9-B73027E18DD3}" }, { CLSID = "{BCE4E030-38E9-423E-98ED-24BE3DA87C32}" }, -- MK-82 { CLSID = "LAU-105_1*AIM-9M_L" }, { CLSID = "LAU-105" }, { CLSID = "LAU-105_2*CATM-9M" }, { CLSID = "LAU-105_1*CATM-9M_L" }, { CLSID = "{6D21ECEA-F85B-4E8D-9D51-31DC9B8AA4EF}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E741}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E742}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E743}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E744}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E745}" }, { CLSID = "{A4BCC903-06C8-47bb-9937-A30FEDB4E746}" }, { CLSID = "{DB769D48-67D7-42ED-A2BE-108D566C8B1E}" }, -- GBU-12 { CLSID = "{BDU-50LD}" }, { CLSID = "{BDU-50LGB}" }, -- BDU-50LGB { CLSID = "{BDU-50HD}" }, { CLSID = "{Mk82AIR}" }, { CLSID = "{CBU-87}" }, { CLSID = "ALQ_184" }, -- ALQ-184 { CLSID = "{5335D97A-35A5-4643-9D9B-026C75961E52}" }, -- CBU-97 { CLSID = "LAU-105_AIS_ASQ_T50_L" }, -- ACMI } ),
-
[X52Pro] Removing Throttle Detent (1280px Photos!)
Kolyma replied to Devrim's topic in PC Hardware and Related Software
I know this thread is a bit old, but I just used it to fix my throttle after the AB detent stopped working. The instructions worked great! However I just want to point out that the detent springy plug in the case bottom that we're removing does not actually rub on the the center white bracket as circled in picture #5. It actually engages directly on the black shaft between that white center bracket and the outer white bracket. The bracket that is circled fits into a rectangular tower in the case bottom and during normal operation, it never actually moves. Please pardon the engineer in me. I cannot contain his posts... -
I tried this and it doesn't load the livery on startup. I used another F-5E-3 livery in that directory because the one you referenced wasn't there for me. I even cut-n-paste the name to make sure it wasn't a typo. The F-5E-3 model loads fine, but the livery does not. I can load it manually. And I can uncomment the default A-10C example in the source file and it loads OK. Help?
-
I know this question has been asked in several different forms over a few threads over a few years, but I'm just getting back into DCS scripting after the 1.5 change-over and a year away from scripting. I'm the author of this script, which was a lot of fun to make and play with. I've made some more edits and found a few boundary conditions and memory leaks. I want to release an updated version and continue improvements. http://forums.eagle.ru/showthread.php?t=141099 Of course, as with a lot of our random'ing AI scripted missions, at some point damage occurs on a runway or taxiway that prevents any future AI craft from taxi'ing, take-off, or landing. Even well after the actual debris has de-rezzed due to time, there remains a black spot that seems to be the cause of the stuck airbase. From what I can tell, this is caused by the spot itself or the local ATC becoming unresponsive. I've tested this myself on a simple mission and found that when I crash on the runway and respawn, the local ATC will never respond to requests to taxi to the runway or permission to take-off. So it seems the ATC knows the runway should be closed or it is causing it to be closed. For me, it is a critical function to find some way to re-open the runway. From what I can tell, this is not exactly easy or we would have all found a way to do it by now. Things that DON'T work: 1) destroy() function on crashed aircraft. Once the sim fully explodes an aircraft, it's not an addressable object within the Lua script. For my script, I could detect this happening because my array of aircraft would have an ID that would not exist and then I knew the sim had de-rezzed the aircraft and I needed to just delete the info from my internal array. But the crash spot and debris still remained and runway inactive. 2) Having a ground unit just zig-zag around the runway like a Zamboni smashing the debris. Again the black spot remains and ATC is unresponsive. 3) Re-spawning groups with same name. Black spot remains and airbase inactive. Things that MAY work and I need your HELP: 1) Finding some way to address these black spots in the sim from a lua script and then removing them. a) Either this is possible now and I can't find a way to enumerate them from with a lua script, or b) maybe I need to "dofile" load an additional installed lua file from the DCS directories, or c) maybe remove some of the "sanitize" lines from "MissionScripting.lua" so that my lua script has access to a larger scope that the "sanitized" environment. 2) Somehow changing the airbase's local ATC to ignore the black spot or just re-active the runway with the spot intact. Yes, I realize this might cause future aircraft to be damaged or crash from the black spot, but at least the runway would become active again. 3) Somehow change DCS to completely ignore this condition and never close the airbase' under any circumstances. 4) Write some kind of out-of-band parasitic helper application outside of the DCS program that somehow hacks the code periodically to fix this situation. I've got enough amateur programming skills to chase after this idea if someone more knowledgeable could point me in the right direction. There simply HAS to be a way to re-activate these damaged runways and taxiways!!! Please help. I don't mind doing the work to find out how, but I'd like to connect with some scripters, designers, or actual DCS programmers that could assist me.
-
I'm not sure where I originally got it, but the 3.5.37 is inside my *.miz files. Here's some links where they appear to discuss newer versions than those in the MIST forum sticky. Also, I've attached the version I'm using. Not sure how the script behaves with other MIST versions. Guess I should check that :) http://forums.eagle.ru/showpost.php?p=2164366&postcount=724 https://github.com/mrSkortch/MissionScriptingTools/releases mist.3.5.37.lua
-
When you create a new mission you can choose the countries assigned to each coalition. Once the mission is created, you can't change the country assignments through the Mission Editor. But you can change the country assignments through editing the mission *.miz file. For me, this requires: 1) renaming the *.miz file to *.zip 2) extracting the mission file 3) renaming it to *.lua 4) opening in Notepadd++ 5) editing to move the countries around to the desired coalition assignment 6) rename back to mission 7) put back in *.zip file 8 ) rename to *.miz Key to editing the mission file is to change country coalition assignments in 2 sections. The mission file describes country coalition assignments in 2 different areas. Both must be set to the same assignments for the change to work. There is probably an easier way to modify an existing *.miz file than my procedure and I know changing country coalition assignment after creating a mission is described elsewhere on this site. Really, you can drop this script into any existing mission you have and it'll go to work. Important parts to change in my script are: g_aircraftDistributionWhich controls the types of planes. It expects a relative distribution number across each part. So to make the script just spawn Utility aircraft (transport, refueling, reconnaissance), set it to g_aircraftDistribution= (100, 0, 0, 0, 0) To favor fighter aircraft, try something like this: g_aircraftDistribution= (5, 5, 5, 80, 5) And the other important parameter is g_maxCoalitionAircraftWhich defines how many total planes the script is allowed to keep spawned. When an ac lands or is destroyed, the count decreases and a new ac is spawned. Note the max limit does not include your own ac placed manually in your ME designed mission. As we all know, too many active ac in a running mission lowers frame rate. You'll have to modify this value to be compatible with the manually placed ac in your mission and your PC system capabilities. There's also some intricate logic to handle groups of planes when only a single ac lands or is destroyed. The script also keeps room below the max limit for a full group to possibly spawn. So if g_maxGroupSize = 4and g_maxCoalitionAircraft = {40, 40}When the current amount of spawned aircraft contained in the variable g_numCoalitionAircraft is between 37-40, no more ac will be spawned, even if the script were to randomly pick a single ac or a group size of 3....Without this, the script "ratcheted up" to 40 and eventally only spawned single ac groups because there was never more than 1 free slot under max.
-
Yeah we use the script now for kind of target practice with respawing aircraft in random areas of the map. Looks pretty cool while in your own ac during takeoff and landing with all the extra traffic. Especially groups of different ac types and numbers....and formations. I found all kinds of nice skins in the game I didn't realize were there
-
Determine airbase runway direction/heading from within script
Kolyma replied to Kolyma's topic in Mission Editor
If anyone cares to know, here's the table of the beginning and ending points for each runway... g_airbasePoints = -- These are the start and end x,z points for each airbase runway in the direction of normal take-off traffic { -- Use for the fly over points when spawning aircraft airborne -- {x1, z1, x2, z2, psi, heading} [12] = {-6495.7142857133,242167.42857143,-4321.7142857133,244091.42857143,-0.724468306690539,0.724468306690539}, -- Anapa-Vityazevo [13] = {11751.428571429,369204.85714286,11620.000000001,366703.71428572,1.62329544850684,-1.62329544850684}, -- Krasnodar-Center [14] = {-40248.857142856,279856.28571428,-41589.428571427,278650.57142857,2.40910735155739,-2.40910735155739}, -- Novorossiysk [15] = {-5579.7142857133,295210.57142857,-7585.9999999991,293555.14285714,2.45172058746978,-2.45172058746978}, -- Krymsk [16] = {-25197.428571427,459052.57142857,-27686.57142857,457036.28571429,2.46076441819486,-2.46076441819486}, -- Maykop-Khanskaya [17] = {-49706.57142857,298970.28571429,-51087.142857141,297810.85714286,2.44303961565279,-2.44303961565279}, -- Gelendzhik [18] = {-163750.28571428,463622.57142857,-165212.85714286,460870,2.05920616746982,-2.05920616746982}, -- Sochi-Adler [19] = {6652.2857142863,386738.57142858,8764.8571428577,389003.71428572,-0.820235909742805,0.820235909742805}, -- Krasnodar-Pashkovsky [20] = {-221401.14285714,566015.71428571,-219751.42857143,562707.14285714,1.10825468264437,-1.10825468264437}, -- Sukhumi-Babushara [21] = {-197811.42857143,517063.14285714,-195622.28571428,515849.42857143,0.506233740419563,-0.506233740419563}, -- Gudauta [22] = {-356549.42857143,618419.42857144,-355121.14285714,616421.14285715,0.95023583247859,-0.95023583247859}, -- Batumi [23] = {-281681.14285714,646054,-281882.28571429,648431.42857143,4.62798477132166,-4.62798477132166}, -- Senaki-Kolkhi [24] = {-318368,634520.57142858,-317545.42857143,636779.14285715,-1.22234030943342,1.22234030943342}, -- Kobuleti [25] = {-285233.71428571,682650.57142857,-284543.14285714,685056.85714286,-1.29132089859535,1.29132089859535}, -- Kutaisi [26] = {-52128.285714285,707572.28571429,-50388.857142856,703892.28571429,1.12925011719757,-1.12925011719757}, -- Mineralnye Vody [27] = {-125580.57142857,759479.14285715,-124274.85714286,761378.00000001,-0.968419584342998,0.968419584342998}, -- Nalchik [28] = {-83740.571428571,832212.57142857,-83294.857142857,835718.57142857,-1.44434563501146,1.44434563501146}, -- Mozdok [29] = {-316481.42857143,897668.85714286,-314624.28571428,895291.42857143,0.90765164013325,-0.90765164013325}, -- Tbilisi-Lochini [30] = {-316999.71428571,894496.57142857,-318664,896327.71428572,3.97469042602364,-3.97469042602364}, -- Soganlug [31] = {-318175.14285714,902274.28571429,-319966.57142857,904036.85714286,3.91887137165303,-3.91887137165303}, -- Vaziani [32] = {-148494.57142857,842108,-148685.42857143,845221.42857144,4.65116431906051,-4.65116431906051} -- Beslan } -
By default the AI aircraft are armed. There is an option in the script to spawn them without weapons if you like. g_flagRandomWeaponsAnd each aircraft has tasks assigned appropriate for their role. Again, there's an option in the script to spawn them without tasks. g_flagSetTasks So yes, by default they spawn with weapons and if close enough will definitely interact! I also use the DCS witchcraft software and console to change some of these flags during a running mission since they're global variables...
-
Attached is a script to generate random AI air traffic. There's several similar scripts on this site, and I've PM'd SNAFU about posting my own idea, which started out being based on his Random Air Traffic script. This thread includes a much more diverse random script (really a completely original re-write). It's my first attempt at DCS/lua programming, but I'm pretty sure the script works well enough now to share. RANDOM FLIGHT PLAN TRAFFIC Basic idea: -Based on airbase coalition assignment, spawn random aircraft group (some on this site have done this through trigger zones. For simplicity, I just used airbase coalition assignment) -Aircraft type and relative distribution can be adjusted between Utility, Bomber, Attack, Fighter, Helicopter types (or just spawn one type of aircraft only) -Random skins for each aircraft based on the skins available for that country -Spawns random group sizes for aircraft types that support formations -Random multi-unit formation types -Random group and unit callsigns -Take-off and landing airbases are randomized if there are more than one airbase assigned to the coalition (also an option to prevent take-off and landing from the same airbase) -Take-off waypoint type is randomized (sometimes from parking spot, hot, on runway, or airborne) -If the take-off waypoint is airborne, the AI group spawns in the air over the runway and flies down the runway until proceeding to next waypoint (kind of a touch-n-go idea) -Generate randomized intermediate waypoint between take-off and landing airbases -There's several boundary condition checks to remove AI spawned aircraft that are damaged, wayward out of range, never actually spawned by sim, or amazingly have negative altitudes, etc -Write dynamic spawn and destroy messages to the screen and log file Options: (MANY options adjustable in script file, notable ones described here) -Spawn interval high/low value (value gets recomputed after each spawn, so the actual random time between spawns is continuously randomized) -Maximum number of aircraft spawned per coalition side -By default, tries to maintain the same number of ac for each coalition side. This has several optional styles of spawn fairness. -Randomize fuel amount and settings for high/low random fuel values -Enable/disable flight tasks (attack/defend or just fly) How to use this script: -This script uses MIST. I have been using version 3.5.37 -In ME, set country assignment for each coalition. To not spawn aircraft for a particular country, assign that country to the neutral coalition in the ME. -In ME, assign desired random spawn/land airbase(s) to each coalition. Of course not all airbases need to be assigned and not all coalitions need to be used---you can assign just one airbase to one coalition and the script will only spawn aircraft for that side -As described elsewhere, make sure to initialize MIST. -As described elsewhere, add this script as a "Do Script File" in the ME Issues or future improvements: -Sometimes when a group spawns, the simulator stops or glitches for a moment. I think this is because the programming assets are not loaded yet for that aircraft in the sim and this delays the dynamic spawn. Some of the other scripts on this site include in the ME a hidden template aircraft, which causes the sim to pre-load the asset and is probably why they don't have this glitching. If anyone has suggestions on how to solve this problem in my script, please offer them. Because I spawn any aircraft from any country with any skin, I don't think I can use the hidden template aircraft idea. -Include randomized aircraft liveries (the weapons loadout). Without being able to directly read the DCS config files for each aircraft, this idea would become a huge cut-n-paste exercise that I'm not interested in doing. It may be possible to read external files from within a running *.lua file during execution; I'll have to try that later... -Ability to disable a particular aircraft type. Right now, this requires commenting line-by-line in the giant inventory matrix. -Someone somewhere must have a fix for the runways and taxiways that become unusable from damaged aircraft!!! Given enough time, this script makes a real mess of airbase runways and taxiways. However, this script will occasionally spawn ac in the air over an airbase. New ac will continue to spawn when an airbase becomes unusable. Included below are the script and 2 example missions. The first mission "bigmap" has all the airbases assigned and all countries enabled. The 2nd is called "maelstrom" and uses the 2 airbases at Krasnodar with some invincible AA ground units :) I hope you enjoy! This was a lot of fun and more than a little work to put together. Random_Flight_Plan_Traffic.lua bigmap.miz malestrom.miz
-
Still does this for me even when using a script to dynamically spawn a B-52 on the ground. Spawning from any in-flight posture works. Any update on how to get a B-52 to take-off without crashing?
-
Determine airbase runway direction/heading from within script
Kolyma replied to Kolyma's topic in Mission Editor
That's an interesting file. If I have to, I'll just make a table in my script, but I'd prefer to use some lua script way to get that information. As I learned, I can't access the functions or databases listed in native *.lua files from my own lua script. In my script, I'm getting the airbase coordinates like this: _spawnairdromeId = spawnIndex.id _spawnairbaseloc = Object.getPoint({id_=spawnIndex.id_}) _spawnairplanepos = {} _spawnairplanepos.x = _spawnairbaseloc.x _spawnairplanepos.z = _spawnairbaseloc.z I was hoping to somehow get the airbase orientation, heading, or bearing so I could spawn aircraft just above the runway but headed down the runway. I can't seem to control the aircraft initial heading from adding that info when I dynamically spawn. Best I can figure is to spawn the aircraft with its next waypoint at the other end of the runway. So at least it will spawn pointed the correct heading and travel over the runway. But in order to do that, I'll need a list of runway angle orientations. -
Is there anyway to access sim system functions like db.getUnitCallnames
Kolyma replied to Kolyma's topic in Mission Editor
Bummer dude. Most of what I'm trying to do is access some of the pre-built tables of information and the functions that run against them. Stuff like aircraft skins, loadouts, call signs. Many of the scripts by others I see here just cut-n-paste that info and I've been doing that with the randomize script I've been working on. But I had hoped to eventually be able to access those functions themselves. -
Is there any way to call the system functions I see in the lua files like in \DCS World\Scripts\Database I see lots of functions in these files and if possible, I'd like to use them in my scripts. For example, how would I invoke this function (from the file db_callnames.lua) from within my own lua script? function db.getUnitCallnames(countryId, unitAttributes)
-
How to clear taxiway and runway from AI parachute & pilots
Kolyma replied to Kolyma's topic in Mission Editor
-
How to clear taxiway and runway from AI parachute & pilots
Kolyma replied to Kolyma's topic in Mission Editor
Do you mean spawn another AI group with the same name and destroy that one? Which somehow removes the other parachute pilot on the runway/taxiway? Not sure I understand your suggestion. If there's an existing thread on this topic, just point me there. I didn't find one. Thanks -
How to clear taxiway and runway from AI parachute & pilots
Kolyma replied to Kolyma's topic in Mission Editor
lol omg AI parachute pilots must be the ultimate nemesis of mission designers then... -
Hi, I'm using some of the code from this forum to spawn AI. Of course eventually having to deal with the "destroy" function to remove stuck AI on the taxiway/runway. Question: how do I remove the parachuted pilots from taxiways and runways? Sometimes when 2 AI planes crash while taxi'ing, landing, or takeoff, pilots eject and parachute onto the taxiway/runway. And then the taxiway/runway is permanently blocked. I briefly searched the forums and didn't see an answer. TIA
-
This command was very helpful and I had looked through the (very nice) MIST lua source code before. I ran your command in witchcraft and dumped to notepad to search. Seems a lot of what I'm asking about (which I realize once learned may be a pointless exercise) for these base lua members are shown in the sections titled "function: blah blah, C function", so I guess these are core ideas found/defined only in the binaries. Thanks for the help
-
Thanks for trying to help. As I said in the 2nd post, I know about that link and information contained there, but it is far from complete. It's trivial to look at my OP and see that not all of those members are described on the link you posted.... cancelChoosingCargo __index etc I'd just like to know if any uber DCS scripters/programmers know where the source is for these structures.