Code Monkey home page Code Monkey logo

dcs's Introduction

python dcs mission framework

pydcs is a python framework for creating and editing mission files from digital combat simulator.

Possible use cases are:

  • assisting mission creators
  • random mission creation
  • write an external mission editor on top of it
  • data export from existing missions
  • ...

Sample

import dcs
m = dcs.Mission()

batumi = m.terrain.batumi()
batumi.set_blue()

usa = m.country("USA")
m.awacs_flight(
   usa, "AWACS", dcs.planes.E_3A,
   batumi, dcs.Point(batumi.position.x + 20000, batumi.position.y + 80000),
   race_distance=120 * 1000, heading=90)

m.save("sample.miz")

This code generates a mission with a AWACS flight starting cold from batumi.

Random mission scripts

pydcs comes with 2 proof of concept scripts:

dcs_random

This script can generate 3 different mission types

  • refuel

    Generates a refuel mission for A-10C or M-2000C aircrafts, search your tanker and refuel.

  • CAS

    Support ground troops.

  • CAP

    Take care of your tanker and AWACS.

For options see the script help with dcs_random --help

dcs_dogfight_wwii

This script randomly generates WWII dogfights with a given number of planes near a random airport. For options also see the script help dcs_dogfight_wwii --help

Install

pip install pydcs

Documentation

The current documentation can be found here

TODO

  • Failures
  • More/better documentation

dcs's People

Contributors

332fg-raven avatar adamdoda avatar andyfangdz avatar bgreman avatar bobmoretti avatar ccuadrado avatar colinm9991 avatar danalbert avatar davidp57 avatar gregretkowski avatar gronank avatar hornet2041 avatar justin-lovell avatar khopa avatar lordeath19 avatar magwo avatar magwo-aza avatar metalstormghost avatar nosajthedevil avatar pschiel avatar raffson avatar rndname avatar rp- avatar shdwp avatar snappycomebacks avatar spark135246 avatar spencershepard avatar ugene143 avatar vhirtham avatar zhexu14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcs's Issues

Add all possible option classes

Currently there are some missing option classes and their possible values missing in task.py.
They can mostly looked up in Eagle Dynamics\DCS World\MissionEditor\modules\me_action_db.lua

Error loading mission file - FARP __init__ signature incorrect

I get an error when trying to load an existing .miz file.

Traceback (most recent call last): File "C:/Users/U/PycharmProjects/dcs_dnd_campaign/test.py", line 4, in <module> successLoad = m.load_file('C:\\Users\\U\\Saved Games\\DCS\\Missions\\dcs_dnd_campaign\\testmission.miz') File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\mission.py", line 342, in load_file self.coalition[col_name].load_from_dict(self, imp_mission["coalition"][col_name]) File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\coalition.py", line 173, in load_from_dict static = FARP( TypeError: __init__() got an unexpected keyword argument '_type'

It seems as though the init signature for FARP is incorrect, or the code constructing it is wrong.
class FARP(Static): def __init__(self, unit_id=None, name=None, frequency=127.5, modulation=0, callsign_id=1): super(FARP, self).__init__(unit_id, name, "FARP") self.category = "Heliports" self.shape_name = "FARPS" self.heliport_frequency = frequency self.heliport_modulation = modulation self.heliport_callsign_id = callsign_id self.can_cargo = False

Additional trigger things are not implemented

The following conditions are not implemented:

  • c_missile_in_zone
  • c_unit_altitude_lower_AGL
  • c_unit_hit

The following actions are not implemented:

  • a_shelling_zone
  • a_aircraft_ctf_color_tag
  • a_set_briefing
  • a_remove_scene_objects

KeyError: 0

I've had 25 missions trigger this exception and only looked at one, so this may be an incomplete description.

It appears when a trigger action is set to AlertAI / 1. Start, there is no 0 index task.

dcs/dcs/action.py

Line 1591 in a5ace97

return cls(d["set_ai_task"][0], d["ai_task"][1])

>>> d['set_ai_task']
{1: 9, 2: 1}

Example mission (trigger is named scarmble call)
Axis_-_Uninvited_Guests.zip

KeyError: 'FAC_AttackGroup'

It looks like sometimes a unit task can be set to FAC_AttackGroup (FAC - Assign Group in the mission editor), which is not a defined task in pydcs (though FAC_EngageGroup is.)

t = tasks_map[_id].create_from_dict(d)

tasks_map.keys()
dict_keys(['ControlledTask', 'Escort', 'AttackGroup', 'Bombing', 'BombingRunway', 'EngageTargetsInZone', 'EngageGroup', 'EngageUnit', 'AWACS', 'Refueling', 'Tanker', 'Orbit', 'Follow', 'Aerobatics', 'FAC', 'FAC_EngageGroup', 'Hold', 'Land', 'Embarking', 'EmbarkToTransport', 'DisembarkFromTransport', 'CargoTransportation', 'EWR', 'GoToWaypoint', 'FireAtPoint'])

Example mission below - relevant unit is ID 128.
desert_creechure_Harrier.zip

ValueError: hour must be in 0..23 when parsing a mission

I'm gonna have a bunch of these, FYI. I'm parsing a large number of missions.

Parsing some older mission files results in ValueError: hour must be in 0..23. Glancing through the code, it looks like this used to be accounted for, but got removed (I assume because DCS updated the way it tracks date/times). Given that the code is already aware of the mission version, would it be possible to re-introduce the old logic for older versions of missions?

https://github.com/pydcs/dcs/blob/master/dcs/mission.py#L312

Attached is an example mission file :)
SierraHotel_Training_Mission_04.zip

Minor error in presented sample

Hello,

AWACS position should be Batumi.position.x and Batumi.position.y in the sample. To make it complete, imports should also be added. Otherwise, it works pertfectly :) Thank you very much for the efforts and the great tool you made, I enjoy it a lot to create very easily random and globally consistent missions!

Flupke.

random_season_temperature() is expecting zero based datetime months

This is a tiny bug, but I noticed that if your mission starts in December and you have random weather turned on, the random_season_temperature() function in each terrain will give an out of range error, when applying temperatures.

https://github.com/pydcs/dcs/blob/master/dcs/terrain/caucasus.py#L3046

On the line linked above, self.temperature is a zero based array. Python's datetime month is an integer between 1 and 12.

Thank you very much for your time.

Document, annotate, and comment task.py

Hi, I'd like to contribute to the project by making it pep8 compliant and generally adding annotations, documentation, and comments.

Which version of Python is targeted by the code?

Given there are annotations in the code I assume at least Python 3.5.

Create new release

It looks like there has been a substantial number of commits to this repo since the last release in November of 2017.

Please build and upload to pypi a new version of this library so we can enjoy all of the hard work done by you fine code authors without having to clone the repo and build the package ourselves.

KeyError: 'clearview'

It looks like if MessageToGroup is used as an action without clearview being checked (whatever that is), the clearview value is not included in the resulting dictionary.

return cls(d["group"], mission.translation.get_string(d["text"]), d["seconds"], d["clearview"])

Attached is an example mission - the offending trigger is for BlueHawg2.
Batumi_V1.zip

heliport_modulation load_from_dict default value missing

self.heliport_modulation = d.get("heliport_modulation", 0)
Default value is missing so if it was not present in the loaded mission file value will be None. After saving DCS is able to load the mission but reloading in pydcs will raise an exception.

Option to bypass trigger parsing

Add an option to bypass trigger parsing as it often fails.
Save the original unparsed triggers at load.
When the mission is saved the original triggers are exported.

Add a safe_parse function

A lot of the issues which seem to be had with parsing missions is because everything is being loaded and looked at. For my current use case, I actually only want to know a few basic details - modules (including if they're flyable), time, map, and mission version. Would it be possible to add a limited parse function (I imagine it being called safe_parse but whatever) which skips all of the heavy task loading and just pulls the safest, least likely to crash attributes. Perhaps it could disable saving to prevent loss of data (or throw a warning / exception if you do save), but that'd be strictly nice-to-have.

[Question] Can pydcs_export.lua export in a format that could be exploited by javascript code?

Hi,

I've been looking around to compile a list of all the weapons and their specs aswell as a list of the fliable planes and the weapons they take on each pylons. I'm new to web dev and would like to learn Vue.js by making an app that mirrors the ingame rearm/refuel screen.

I've asked on Reddit of it's possible to extract tho data and I've been told about your project and weapons_data.py and planes.py. Those exported files contain everything I need. I started looking into converting those files into JSON, or modifying the export lua script so it outputs JSON i'd be able to consume, or even write something in python that would work with your extract and export some JSON. Or a C# program that would eat up your python and output JSON.
But I don't know python, nor lua, so I'm kinda stuck.

Do you have by any chance a setting for your extractor that already extracts data in JSON instead of creating the python classes?

I've looked into how it works but without python knowledge, I'm kinda lost.

I also started making my own JSON files by hand but there's 23000 lines and I would need to go over it every time some module changes or is added. Your method is clearly the best, a script that automatically extract fresh data without your input.

If you have any tips or solutions, i'll be glad to read those. This is not a request for the project, per se, it's more a message in a bottle tossed in the github ocean.

Thank you for your work and have a good one.

Invalid Script Entry Point Notification

C:\Users\divine>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\Users\divine>pip -V
pip 9.0.1 from c:\users\divine\appdata\local\programs\python\python35-32\lib\site-packages (python 3.5)

C:\Users\divine>pip install pydcs
Collecting pydcs
  Using cached pydcs-0.9.0-py3-none-any.whl
Installing collected packages: pydcs
Invalid script entry point: <ExportEntry dcs_oil_convoy = dcs.scripts.destroy_oil_transport:None []> for req: pydcs - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information.

A number of additional tasks are not implemented

The following tasks are not implemented:

  • Silence (key: 7)
  • Restrict Afterburner (key: 16)
  • Radio Usage When Contact (key: 21)
  • ECM using (key: 13)
  • Chaff / Flare using (key: 4)

I haven't gone through yet to determine what the tasks are, but also:

  • key: 0

[Question] forcefully removed trigger from m.triggerrules.triggers makes trigger load order randomly shuffled!

EDIT: it turns out, sometimes when "loading"the .miz file, the load order of triggers shuffled up, from the start. so it has nothing to do with remove.
current workaround is m.triggerrules.triggers.sort(key= .. ), right after loading the miz file.

--- original post (depricated)
I need to add/remove triggers in the miz file,
since there are no "remove_trigger" method, i removed some triggers by

m.triggerrules.triggers.remove(t)

the trigger removed, then the triggers load order are all randomly re-ordered.
Any idea why this is happening, (or I am not even sure this is pydcs issues. maybe it's DCS who shuffles it?)
or proper way to add/remove triggers, or any workaround?

Couldn't load loadouts

I've tried loading loadouts using both:

group.load_task_default_loadout(dcs.task.CAS.name)

and

group.load_loadout("the name as it is in mission editor loadouts page")

but when I load the mission aircraft is there but with nothing under its wings.

The group itself is generated by Mission.flight_group like this:

return self.m.flight_group( country=side, name=name, aircraft_type=unit, airport=airport, position=at, altitude=WARM_START_ALTITUDE, speed=WARM_START_AIRSPEED, maintask=None, start_type=starttype, group_size=count)

group.task is set later along the callstack.

Could you share an example that works? Or is this a bug?

KeyError: 'speed'

Looks like the trigger for checking if a unit speed is above a certain value isn't properly being parsed. Given that I assume this has worked in the past, it may be worth catching the keyerror and trying to read the other key instead. Two random missions I tested with this were versions 14 and 17.

https://github.com/pydcs/dcs/blob/master/dcs/condition.py#L1147 (probably also happens on Lower, but I didn't test that)

Attached mission - LUNA.zip

Parking parsing is sometimes messed up

I'm not sure why, but sometimes the "start from ramp" positions of units are messed up, causing AttributeError: 'NoneType' object has no attribute 'unit_id'. Loading the mission in the mission editor shows the correct number on the unit, but the preview is often in the wrong spot.

Here's the relevant code: https://github.com/pydcs/dcs/blob/master/dcs/coalition.py#L112

Via debugging, it appears that plane.parking_id returns the correct value (19 in the case of the attached mission), while plane.parking returns an invalid space (121).

Note that although this mission is version 14, I've seen it happen with version 16 as well.

Ironically named example mission:
No Room for Error.zip

Position Point to Lat Long?

Hi,
Thanks for this great project.

Is there a way to convert a Mission unit's position to Lat/Long values?
I'd like to plot unit's position on a real map.
Any ideas or pointers please?

Cheers

JF-17 lua parsing error

The newly released JF-17 payload file cannot be parsed by pydcs because they don't include keys on each payload entry. I haven't the faintest idea if this is valid LUA or not, but it's what was shipped with the module.

File "C:\Users\user\PycharmProjects\dcs_liberation\venv3_7\lib\site-packages\dcs\lua\parse.py", line 170, in object
raise se
File "", line 4
Expected character '[', got '{'

Original payload entry:

local unitPayloads = {
    ["name"] = "JF-17",
    ["payloads"] = {
		{
			["name"] = "PL-5Ex2, C802AKx2, 800L Tank",
			["pylons"] = {
				[1] = {
					["CLSID"] = "DIS_C-802AK",
					["num"] = 5,
				},
				[2] = {
					["CLSID"] = "DIS_TANK800",
					["num"] = 4,
				},
				[3] = {
					["CLSID"] = "DIS_C-802AK",
					["num"] = 3,
				},
				[4] = {
					["CLSID"] = "DIS_PL-5EII",
					["num"] = 7,
				},
				[5] = {
					["CLSID"] = "DIS_PL-5EII",
					["num"] = 1,
				},
				[6] = {
					["CLSID"] = "DIS_C-701IR",
					["num"] = 6,
				},
				[7] = {
					["CLSID"] = "DIS_C-701IR",
					["num"] = 2,
				},
			},
			["tasks"] = {
				[1] = 30,
			},
		},
    },
    ["unitType"] = "JF-17",
}
return unitPayloads

Fixed payload entry (note the addition of [1] on line 4):

local unitPayloads = {
    ["name"] = "JF-17",
    ["payloads"] = {
		[1] = {
			["name"] = "PL-5Ex2, C802AKx2, 800L Tank",
			["pylons"] = {
				[1] = {
					["CLSID"] = "DIS_C-802AK",
					["num"] = 5,
				},
				[2] = {
					["CLSID"] = "DIS_TANK800",
					["num"] = 4,
				},
				[3] = {
					["CLSID"] = "DIS_C-802AK",
					["num"] = 3,
				},
				[4] = {
					["CLSID"] = "DIS_PL-5EII",
					["num"] = 7,
				},
				[5] = {
					["CLSID"] = "DIS_PL-5EII",
					["num"] = 1,
				},
				[6] = {
					["CLSID"] = "DIS_C-701IR",
					["num"] = 6,
				},
				[7] = {
					["CLSID"] = "DIS_C-701IR",
					["num"] = 2,
				},
			},
			["tasks"] = {
				[1] = 30,
			},
		},
    },
    ["unitType"] = "JF-17",
}
return unitPayloads

Various airports missing from Normandy

Attempting to parse a Normandy mission results in AttributeError: 'NoneType' object has no attribute 'load_from_dict'.

After looking through the code and map, the following airports are missing:

  • Conches
  • Argentan
  • Goulet
  • Vrigny
  • Essay
  • Hauterive
  • Barville

You can reproduce by saving any mission on the Normandy map, but just in case, here's one anyway.
normandy.zip

Missing some Nevada airport / data in Nevada.py

Hi ๐Ÿ‘‹

Thanks for putting in the work and mapping the mission file into a more actionable format!

I've been trying to get some of our missions parsed by the lib, both on 1.5 and 2.1 and I'm getting some issues.
Some of it I've been able to fix myself as pydcs is simply looking for keys that do not seem to exist in 2.1 anymore in the mission file so I skip them ( used/needModules for example).
Still I'm getting to the point where I realize that some of the airports in our warehouse file are simply not present in the Nevada.py file. Even with adding a condition to ignore any airport not present in that file, when trying to assign parking spots to units, it seems like some are missing as well.

I'm fairly new to this so I'm simply wondering if it's just because the newest Nevada terrain data hasn't been extracted into Nevada.py or if I'm looking at this from a wrong angle.

Adding MOOSE to generated missions

Can't figure this out for the life of me, I've tried a couple of approaches using the DoScriptFile() trigger action.

Tried using the full path of my Moose.lua as an argument, tried adding the script to the .miz file via MapResource and then using the key returned as an argument, no joy.

The trigger does show up fine, but the script file field in mission editor is empty. Tried comparing the mission file inside the .miz file for differences when compared against a file from an identical mission made in the ME instead, no major differences there either when it comes to trigger parameters.

Is this just me not doing it right or is it an actual bug/WIP feature?

Trigger code pasted below:

moose_trigger = TriggerStart(Event.NoEvent, "Moose") moose_trigger.add_action(DoScriptFile("E:\\Projects\\lua\\Moose\\Moose.lua")) self.mission.triggerrules.triggers.append(moose_trigger)

Airport data export for Channel map

Hello,

I've been trying to add support for the newly released "Channel" map.

I figured out that the Python script tools/airport_import.py was to be used to generate the Python code representing the map and i found this comment :

This script imports airport data, that was previously exported by a lua function.

The lua function to export is just beneath this comment block, insert it somewhere in the mission editor
and call it somewhere

The lua function being :

function dumpairportdata()
    local S	= require('Serializer')
    local airdromedump = {}
    for k, v in base.pairs(MapWindow.listAirdromes) do
        --MapWindow.listAirdromes[unit.boss.route.points[1].airdromeId].roadnet
        local sList = Terrain.getStandList(v.roadnet, {"SHELTER","FOR_HELICOPTERS","FOR_AIRPLANES","WIDTH","LENGTH","HEIGHT"})
        info = {}
        info["airport"] = v
        info["standlist"] = sList
        airdromedump[k] = info
    end
    local f = base.io.open("C:\\tmp\\standlist.lua", 'w')
    if f then
            local s = S.new(f)
            s:serialize_simple2('airports', airdromedump)
            f:close()
    else
        showWarningMessageBox(_('Error saving standlist'))
    end
end

But I'm a bit confused about how to exactly use the lua script...

I first naively tried to add the lua script in a DoScript action in the Mission Editor, and then to call the function in a running mission. But this would not work as the code in this function does not look like it could be run from a running DCS mission script environment.

insert it somewhere in the mission editor and call it somewhere

After re-reading that, I figured out that the function probably has to be added to "/MissionEditor/MissionEditor.lua" in DCS World files ?

But then, where do you usually call dumpairportdata() ?

I've tried calling it from random location in the Mission Editor UI code (for instance when the briefing editor is opened for a mission), but at best i just managed to crash DCS on startup without error logs... ๐Ÿ˜ฉ So I'm probably missing something.

Could you clarify how to use this script ?
It would make me able to add support for new DCS maps in the future ๐Ÿ˜.

Thanks,

Khopa

would like to get in touch plz

hi i see ur hon stats project well im writeing a project in scala akka all that for csgo mm mind lending a hand we are a ibm startup thx !!

Only helicopter parking spots allowed for some airports?

free_slots = [x for x in free_slots if x.helicopter]

This restricts helicopters to being parked only in helicopter specific parking spots. Airports using the other parking resolution method are allowed to park helicopters in other spots:

return heli_slots + large_slots

Could be that = was intended to be +=, but I'm not sure why there are two different resolution methods so perhaps there's a reason for this? The result is that airports like Bandar Lengeh cannot have helicopters parked at them.

Update data export (F-16C support)

Hello,

It would be great to perform a new data export to include the newly added F-16C.
(Along with some others units that were added since last update of pydcs, such as the HQ-7 SAM)

Is there just the pydcs_export.lua with the appropriate path set up to run ?
If so, i could try to perform the export and i'll do a pull request if you want.

Thanks,

Regards,

Add support for JF-17

It's that time again! Please add support for the JF-17 and cut a new release. Thanks <3

KeyError: 'speedU'

Remember #47 when speed was causing keyerrors because the condition contained speedU? Well now we've got the opposite problem :)

It appears that sometimes the condition is speed and sometimes it's speedU.

Example mission - Nellis_defence.zip

Missing Task 'FireAtPoint'

There appears to be no way to add a FireAtPoint task, and when loading a mission file that has this defined, it throws an error when loading.

Traceback (most recent call last): File "C:/Users/U/PycharmProjects/dcs_dnd_campaign/test.py", line 4, in <module> successLoad = m.load_file('C:\\Users\\U\\Saved Games\\DCS\\Missions\\dcs_dnd_campaign\\dcs_dnd_campaign_turn_01R_After_Sortie_1.miz') File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\mission.py", line 342, in load_file self.coalition[col_name].load_from_dict(self, imp_mission["coalition"][col_name]) File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\coalition.py", line 50, in load_from_dict Coalition._import_moving_point(mission, vg, vgroup) File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\coalition.py", line 24, in _import_moving_point point.load_from_dict(imp_point, mission.translation) File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\point.py", line 132, in load_from_dict self.tasks.append(task._create_from_dict(d["task"]["params"]["tasks"][t])) File "C:\Users\U\PycharmProjects\dcs_dnd_campaign\venv\lib\site-packages\dcs\task.py", line 26, in _create_from_dict t = tasks_map[_id].create_from_dict(d) KeyError: 'FireAtPoint'

Is the test script 'war.py' a WIP?

So far all the test scripts (destroy_oil_transport.py, dogfight_wwii,py, random_mission.py) work with no problems, but war.py is giving some errors:

Traceback (most recent call last):
  File "C:\Users\randl\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\dcs\scripts\war.py", line 300, in <module>
    sys.exit(main())
  File "C:\Users\randl\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\dcs\scripts\war.py", line 222, in main
    m.load_file("C:\\Users\\peint\\Saved Games\\DCS\\Missions\\dcscs_setup\\warehouse.miz")
  File "C:\Users\randl\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dcs\mission.py", line 234, in load_file
    with zipfile.ZipFile(filename, 'r') as miz:
  File "C:\Users\randl\AppData\Local\Programs\Python\Python36-32\lib\zipfile.py", line 1082, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\peint\\Saved Games\\DCS\\Missions\\dcscs_setup\\warehouse.miz'

I ask if it is a work in progress because it seems to be looking for a file on your computer, and by that I mean it isn't following a %PATH% type directory, but rather a fixed directory as seen in the username 'peint'

Beside this, wanted to ask if to your knowledge, is there an active group of members using this? I was surprised to see that the post in the ED forums had no replies. It seems to me that this project has great potential and I never see anything about it? There some reason for this or do you know that there are indeed people using this?

I'm trying to learn more about it to make my own missions and would be nice if there was people on ED discussing this.. I'm working on making practice BVR missions for the F-15C, and possibly the Su-27/Su-33 if all goes well, that will randomize the starting location of the player and AI, and thinking it would be nice to be able to randomize the number of AI and their aircraft based on initial parameters (doesn't seem like this is implemented yet; things like arguments or variable skill level to change the output of the scripts without having to re-write lines of code) or more likely, re-writing specific lines of code.

Is this possible in the current framework or would I need to insert snippets or custom code into the starting location part of the code that randomizes the starting x and y, and possibly even the z or altitude as I'm sure it is refereed to in the code.. I read in your first issue on github that you are busy so I didn't want bombard you with specific questions or even ask anything that wasn't bug related for the fact that you are busy and also because I am somewhat out of my league and don't feel in place to ask certain questions.

Get this error when trying to pass turn

INFO:root:DCS Libration None
INFO:root:Using C:\Users\eelmo\Saved Games\DCS.openbeta as userdata folder
INFO:root:Generating Convoy Strike (regular)
ERROR:root:Didn't find ground position (Point(-239298.02076082907, 881856.2498073743))!
INFO:root:airgen: <class 'dcs.helicopters.Ka_50'> for 2 at unit <dcs.unitgroup.StaticGroup object at 0x00B65B90>
INFO:root:Loaded overridden payload for <class 'dcs.helicopters.Ka_50'> - 12x9A4172, 40xS-8 for task <class 'dcs.task.CAS'>
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:generated object identifier comms|32|6|1 with mission id 13
INFO:root:generated object identifier farp|32|7|1 with mission id 14
INFO:root:generated object identifier farp|32|7|2 with mission id 15
INFO:root:generated object identifier farp|32|7|3 with mission id 16
INFO:root:generated object identifier farp|32|7|4 with mission id 17
INFO:root:generated object identifier farp|32|7|5 with mission id 18
INFO:root:generated object identifier farp|32|7|6 with mission id 19
INFO:root:generated object identifier farp|32|7|7 with mission id 20
INFO:root:generated object identifier farp|32|7|8 with mission id 21
INFO:root:generated object identifier farp|32|7|9 with mission id 22
INFO:root:generated object identifier power|32|8|1 with mission id 23
INFO:root:generated object identifier power|32|8|2 with mission id 24
INFO:root:generated object identifier power|32|8|3 with mission id 25
INFO:root:generated object identifier power|32|8|4 with mission id 26
INFO:root:generated object identifier power|32|8|5 with mission id 27
INFO:root:generated object identifier farp|32|9|1 with mission id 28
INFO:root:generated object identifier farp|32|9|2 with mission id 29
INFO:root:generated object identifier farp|32|9|3 with mission id 30
INFO:root:generated object identifier farp|32|9|4 with mission id 31
INFO:root:generated object identifier farp|32|9|5 with mission id 32
INFO:root:generated object identifier farp|32|9|6 with mission id 33
INFO:root:generated object identifier farp|32|9|7 with mission id 34
INFO:root:generated object identifier farp|32|9|8 with mission id 35
INFO:root:generated object identifier farp|32|9|9 with mission id 36
INFO:root:generated object identifier warehouse|32|10|1 with mission id 37
INFO:root:generated object identifier warehouse|32|10|2 with mission id 38
INFO:root:generated object identifier warehouse|32|10|3 with mission id 39
INFO:root:generated object identifier warehouse|32|10|4 with mission id 40
INFO:root:generated defense object identifier aa|32|11|1 with mission id 41
INFO:root:time - 2018-05-25 15:00:00, slot - (9, 18), night skipped - False
INFO:root:generated weather 3
INFO:root:Generating Convoy Strike (quick)
ERROR:root:Didn't find ground position (Point(-239298.02076082907, 881856.2498073743))!
INFO:root:airgen: <class 'dcs.helicopters.Ka_50'> for 2 at unit <dcs.unitgroup.StaticGroup object at 0x1222DCB0>
INFO:root:Loaded overridden payload for <class 'dcs.helicopters.Ka_50'> - 12x9A4172, 40xS-8 for task <class 'dcs.task.CAS'>
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Unarmed.Transport_Ural_375'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:armorgen: <class 'dcs.vehicles.Armor.APC_BTR_80'> for 0
INFO:root:generated object identifier comms|32|6|1 with mission id 13
INFO:root:generated object identifier farp|32|7|1 with mission id 14
INFO:root:generated object identifier farp|32|7|2 with mission id 15
INFO:root:generated object identifier farp|32|7|3 with mission id 16
INFO:root:generated object identifier farp|32|7|4 with mission id 17
INFO:root:generated object identifier farp|32|7|5 with mission id 18
INFO:root:generated object identifier farp|32|7|6 with mission id 19
INFO:root:generated object identifier farp|32|7|7 with mission id 20
INFO:root:generated object identifier farp|32|7|8 with mission id 21
INFO:root:generated object identifier farp|32|7|9 with mission id 22
INFO:root:generated object identifier power|32|8|1 with mission id 23
INFO:root:generated object identifier power|32|8|2 with mission id 24
INFO:root:generated object identifier power|32|8|3 with mission id 25
INFO:root:generated object identifier power|32|8|4 with mission id 26
INFO:root:generated object identifier power|32|8|5 with mission id 27
INFO:root:generated object identifier farp|32|9|1 with mission id 28
INFO:root:generated object identifier farp|32|9|2 with mission id 29
INFO:root:generated object identifier farp|32|9|3 with mission id 30
INFO:root:generated object identifier farp|32|9|4 with mission id 31
INFO:root:generated object identifier farp|32|9|5 with mission id 32
INFO:root:generated object identifier farp|32|9|6 with mission id 33
INFO:root:generated object identifier farp|32|9|7 with mission id 34
INFO:root:generated object identifier farp|32|9|8 with mission id 35
INFO:root:generated object identifier farp|32|9|9 with mission id 36
INFO:root:generated object identifier warehouse|32|10|1 with mission id 37
INFO:root:generated object identifier warehouse|32|10|2 with mission id 38
INFO:root:generated object identifier warehouse|32|10|3 with mission id 39
INFO:root:generated object identifier warehouse|32|10|4 with mission id 40
INFO:root:generated defense object identifier aa|32|11|1 with mission id 41
INFO:root:debriefing: found dead unit unit|0|2|Ural-375| Unit #1 (3, <class 'dcs.vehicles.Unarmed.Transport_Ural_375'>)
INFO:root:debriefing: found dead unit unit|0|3|Ural-375| Unit #1 (4, <class 'dcs.vehicles.Unarmed.Transport_Ural_375'>)
INFO:root:debriefing: found dead unit unit|0|4|Ural-375| Unit #1 (5, <class 'dcs.vehicles.Unarmed.Transport_Ural_375'>)
INFO:root:debriefing: found dead unit unit|0|5|Ural-375| Unit #1 (6, <class 'dcs.vehicles.Unarmed.Transport_Ural_375'>)
INFO:root:debriefing: found dead unit unit|0|6|Ural-375| Unit #1 (7, <class 'dcs.vehicles.Unarmed.Transport_Ural_375'>)
INFO:root:debriefing: found dead unit unit|0|7|BTR-80| Unit #1 (8, <class 'dcs.vehicles.Armor.APC_BTR_80'>)
INFO:root:debriefing: found dead unit unit|0|8|BTR-80| Unit #1 (9, <class 'dcs.vehicles.Armor.APC_BTR_80'>)
INFO:root:debriefing: found dead unit unit|0|9|BTR-80| Unit #1 (10, <class 'dcs.vehicles.Armor.APC_BTR_80'>)
INFO:root:debriefing: unsatistied ids: []
INFO:root:Finishing event Convoy Strike
INFO:root:base <theater.base.Base object at 0x14724530> commit losses {}
INFO:root:base <theater.base.Base object at 0x14724510> commit losses {<class 'dcs.vehicles.Unarmed.Transport_Ural_375'>: 5, <class 'dcs.vehicles.Armor.APC_BTR_80'>: 3}
INFO:root:Pass turn
INFO:root:Commision Beslan: {<class 'dcs.vehicles.Armor.MBT_T_55'>: 3}
INFO:root:Commision Beslan: {<class 'dcs.planes.AJS37'>: 1}
INFO:root:Commision Nalchik: {<class 'dcs.planes.Su_25'>: 1}
INFO:root:Commision Mozdok: {<class 'dcs.planes.L_39ZA'>: 1}
INFO:root:Commision Kutaisi: {<class 'dcs.planes.Su_25T'>: 1}
INFO:root:Commision Kutaisi: {<class 'dcs.planes.M_2000C'>: 2}
INFO:root:Commision Senaki: {<class 'dcs.planes.Su_25T'>: 1}
INFO:root:Commision Kobuleti: {<class 'dcs.planes.L_39ZA'>: 1}
INFO:root:Commision Gelendzhik: {<class 'dcs.planes.Su_25T'>: 1}
INFO:root:<theater.base.Base object at 0x12243AF0> for <class 'dcs.task.CAP'> (0): {<class 'dcs.planes.M_2000C'>: 2}
INFO:root:Generating Air Intercept (regular)
INFO:root:airgen: <class 'dcs.planes.An_26B'> for 0 at 3300 at 550
INFO:root:airgen: <class 'dcs.planes.M_2000C'> for 0 at 3600 at 550
INFO:root:Loaded overridden payload for <class 'dcs.planes.M_2000C'> - Combat Air Patrol for task <class 'dcs.task.CAP'>
INFO:root:airgen: <class 'dcs.planes.F_14B'> for 2 at <class 'dcs.terrain.caucasus.Soganlug'>
INFO:root:Loaded overridden payload for <class 'dcs.planes.F_14B'> - AIM-54A-MK474, AIM-7M2, AIM-9M2, XT2 for task <class 'dcs.task.CAP'>
INFO:root:airgen: <class 'dcs.planes.FA_18C_hornet'> for 2 at <class 'dcs.terrain.caucasus.Soganlug'>
INFO:root:Loaded overridden payload for <class 'dcs.planes.FA_18C_hornet'> - AIM-1204,AIM-92,AIM-72,Fuel for task <class 'dcs.task.CAP'>
INFO:root:generated dead object identifier warehouse|25|33|1 with mission id 8
INFO:root:generated object identifier warehouse|25|33|2 with mission id 9
INFO:root:generated dead object identifier warehouse|25|33|3 with mission id 10
INFO:root:generated object identifier warehouse|25|33|4 with mission id 11
INFO:root:generated dead object identifier fob|25|34|1 with mission id 12
INFO:root:generated object identifier fob|25|34|2 with mission id 13
INFO:root:generated object identifier fob|25|34|3 with mission id 14
INFO:root:generated object identifier fob|25|34|4 with mission id 15
INFO:root:generated object identifier fob|25|34|5 with mission id 16
INFO:root:generated object identifier fob|25|34|6 with mission id 17
INFO:root:generated dead object identifier farp|25|35|1 with mission id 18
INFO:root:generated object identifier farp|25|35|2 with mission id 19
INFO:root:generated dead object identifier farp|25|35|3 with mission id 20
INFO:root:generated dead object identifier farp|25|35|4 with mission id 21
INFO:root:generated dead object identifier farp|25|35|5 with mission id 22
INFO:root:generated dead object identifier farp|25|35|6 with mission id 23
INFO:root:generated object identifier farp|25|35|7 with mission id 24
INFO:root:generated object identifier farp|25|35|8 with mission id 25
INFO:root:generated object identifier farp|25|35|9 with mission id 26
INFO:root:generated dead object identifier fob|25|36|1 with mission id 27
INFO:root:generated object identifier fob|25|36|2 with mission id 28
INFO:root:generated object identifier fob|25|36|3 with mission id 29
INFO:root:generated object identifier fob|25|36|4 with mission id 30
INFO:root:generated object identifier fob|25|36|5 with mission id 31
INFO:root:generated object identifier fob|25|36|6 with mission id 32
INFO:root:generated defense object identifier aa|25|37|1 with mission id 33
INFO:root:time - 2018-05-25 19:00:00, slot - (18, 20), night skipped - False
INFO:root:generated weather 4
INFO:root:Generating Air Intercept (quick)
INFO:root:airgen: <class 'dcs.planes.An_26B'> for 0 at 3300 at 550
INFO:root:airgen: <class 'dcs.planes.M_2000C'> for 0 at 3600 at 550
INFO:root:Loaded overridden payload for <class 'dcs.planes.M_2000C'> - Combat Air Patrol for task <class 'dcs.task.CAP'>
INFO:root:airgen: <class 'dcs.planes.F_14B'> for 2 at 3900 at 550
INFO:root:Loaded overridden payload for <class 'dcs.planes.F_14B'> - AIM-54A-MK47
4, AIM-7M2, AIM-9M2, XT2 for task <class 'dcs.task.CAP'>
INFO:root:airgen: <class 'dcs.planes.FA_18C_hornet'> for 2 at 4200 at 550
INFO:root:Loaded overridden payload for <class 'dcs.planes.FA_18C_hornet'> - AIM-120
4,AIM-92,AIM-72,Fuel for task <class 'dcs.task.CAP'>
INFO:root:generated dead object identifier warehouse|25|33|1 with mission id 8
INFO:root:generated object identifier warehouse|25|33|2 with mission id 9
INFO:root:generated dead object identifier warehouse|25|33|3 with mission id 10
INFO:root:generated object identifier warehouse|25|33|4 with mission id 11
INFO:root:generated dead object identifier fob|25|34|1 with mission id 12
INFO:root:generated object identifier fob|25|34|2 with mission id 13
INFO:root:generated object identifier fob|25|34|3 with mission id 14
INFO:root:generated object identifier fob|25|34|4 with mission id 15
INFO:root:generated object identifier fob|25|34|5 with mission id 16
INFO:root:generated object identifier fob|25|34|6 with mission id 17
INFO:root:generated dead object identifier farp|25|35|1 with mission id 18
INFO:root:generated object identifier farp|25|35|2 with mission id 19
INFO:root:generated dead object identifier farp|25|35|3 with mission id 20
INFO:root:generated dead object identifier farp|25|35|4 with mission id 21
INFO:root:generated dead object identifier farp|25|35|5 with mission id 22
INFO:root:generated dead object identifier farp|25|35|6 with mission id 23
INFO:root:generated object identifier farp|25|35|7 with mission id 24
INFO:root:generated object identifier farp|25|35|8 with mission id 25
INFO:root:generated object identifier farp|25|35|9 with mission id 26
INFO:root:generated dead object identifier fob|25|36|1 with mission id 27
INFO:root:generated object identifier fob|25|36|2 with mission id 28
INFO:root:generated object identifier fob|25|36|3 with mission id 29
INFO:root:generated object identifier fob|25|36|4 with mission id 30
INFO:root:generated object identifier fob|25|36|5 with mission id 31
INFO:root:generated object identifier fob|25|36|6 with mission id 32
INFO:root:generated defense object identifier aa|25|37|1 with mission id 33
INFO:root:debriefing: found dead unit unit|0|23|An-26B| Pilot #1 (1, <class 'dcs.planes.An_26B'>)
INFO:root:debriefing: found dead unit unit|0|24|M-2000C| Pilot #1 (2, <class 'dcs.planes.M_2000C'>)
INFO:root:debriefing: found dead unit unit|0|24|M-2000C| Pilot #2 (3, <class 'dcs.planes.M_2000C'>)
INFO:root:debriefing: found dead static warehouse|25|33|1 (9)
INFO:root:debriefing: found dead static warehouse|25|33|3 (11)
INFO:root:debriefing: found dead static fob|25|34|1 (13)
INFO:root:debriefing: found dead static farp|25|35|1 (19)
INFO:root:debriefing: found dead static farp|25|35|3 (21)
INFO:root:debriefing: found dead static farp|25|35|4 (22)
INFO:root:debriefing: found dead static farp|25|35|5 (23)
INFO:root:debriefing: found dead static farp|25|35|6 (24)
INFO:root:debriefing: found dead static fob|25|36|1 (28)
INFO:root:debriefing: unsatistied ids: []
INFO:root:Finishing event Air Intercept
INFO:root:base <theater.base.Base object at 0x14724530> commit losses {}
INFO:root:base <theater.base.Base object at 0x12243AF0> commit losses {<class 'dcs.planes.An_26B'>: 1, <class 'dcs.planes.M_2000C'>: 2}
INFO:root:Pass turn
INFO:root:Commision Nalchik: {<class 'dcs.planes.Su_25T'>: 1}
INFO:root:Commision Mozdok: {<class 'dcs.planes.Su_25'>: 1}
INFO:root:Commision Kutaisi: {<class 'dcs.planes.MiG_23MLD'>: 2}
INFO:root:Commision Kobuleti: {<class 'dcs.planes.Su_25'>: 1}
INFO:root:Commision Gelendzhik: {<class 'dcs.planes.L_39ZA'>: 1}
INFO:root:Pass turn
ERROR:root:<class 'ValueError'>
Traceback (most recent call last):
File "tkinter_init_.py", line 1702, in call
File "ui\mainmenu.py", line 36, in pass_turn
File "ui\mainmenu.py", line 29, in display
File "ui\overviewcanvas.py", line 590, in update
File "ui\overviewcanvas.py", line 252, in draw
File "ui\overviewcanvas.py", line 312, in draw_map
File "ui\overviewcanvas.py", line 331, in draw_bases
ValueError: negative radius
INFO:root:Pass turn
ERROR:root:<class 'ValueError'>
Traceback (most recent call last):
File "tkinter_init_.py", line 1702, in call
File "ui\mainmenu.py", line 36, in pass_turn
File "ui\mainmenu.py", line 29, in display
File "ui\overviewcanvas.py", line 590, in update
File "ui\overviewcanvas.py", line 252, in draw
File "ui\overviewcanvas.py", line 312, in draw_map
File "ui\overviewcanvas.py", line 331, in draw_bases
ValueError: negative radius

Create new release

Looks like some of the bugs I'm encountering were fixed in newer commits. Do you mind making another new release?

Any way to convert x, y coordinates to MGRS with pydcs?

Thanks for the great project!
For I couldnt find better way to ask something about pydcs, I write here:

I want to convert dcs x,y coordinate to MGRS (or LL, LMS etc) but could not find class/method
DCS script engine has the function but I want convert to MGRS along with pydcs

Any way to do it or even workaround?
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.