Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't load loadouts #8

Closed
shdwp opened this issue May 29, 2018 · 7 comments
Closed

Couldn't load loadouts #8

shdwp opened this issue May 29, 2018 · 7 comments

Comments

@shdwp
Copy link
Contributor

shdwp commented May 29, 2018

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?

@rp-
Copy link
Collaborator

rp- commented May 29, 2018

That might be a bug, do you have installed DCS in the default location?
C:\Program Files\Eagle Dynamics\DCS World

or on another drive or folder?

@rp-
Copy link
Collaborator

rp- commented May 29, 2018

or what unit type is it?

@shdwp
Copy link
Contributor Author

shdwp commented May 29, 2018

I have both SA at standard and steam in PFx86/Steam.

For the type I've tried A10C with CAS and F15C with FighterSweep.

I think I'll debug this later this evening after I come back home and provide a little more information (I've thought it's a simple wrong usage issue).

@shdwp
Copy link
Contributor Author

shdwp commented May 29, 2018

Wait, does it require dcs to be installed? I'm using a separate computer to generate the missions (without DCS), so that would explain it all. How does it account for non-standard path installations then?

@rp-
Copy link
Collaborator

rp- commented May 29, 2018

I don't think it is your fault, but it should have worked for the A10C.

The code for loading the unit payload is a bit static, if you look at unittype.py:58 these are the folders that are currently looked for unit payload definitions.

The code should get the DCS install folder from the registry or some other reliable way and it should also load all CoreMods/aircraft folders.

I just tested it with SU-25 and AH-64A and it worked.

apache = m.flight_group_from_airport(usa, "AirCav", dcs.helicopters.AH_64A, kobuleti, group_size=2)
apache.load_loadout("8xAGM-114, 38xHYDRA-70")
apache.add_runway_waypoint(kobuleti)

@rp-
Copy link
Collaborator

rp- commented May 29, 2018

Wait, does it require dcs to be installed? I'm using a separate computer to generate the missions (without DCS), so that would explain it all. How does it account for non-standard path installations then?

yes for payloads to work it needs a DCS install, or you copy all the payload definitions in a directory and add them to the load path in unittype.py.

@shdwp
Copy link
Contributor Author

shdwp commented May 29, 2018

Yeah, I've tested that on the machine with DCS installed and it works just fine. Thanks a bunch.

@shdwp shdwp closed this as completed May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants