|
Author |
Thread Statistics | Show CCP posts - 1 post(s) |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 01:15:00 -
[1] - Quote
Sable Blitzmann wrote:NearNihil wrote:Speaking of HTML exports, is it possible to include charges (like ammo, scripts, probes et al) when I import the fits in-game? Fits saved in-game have them, Pyfa exported ones don't, and for the sake of convenience and laziness it'd be nice to have. This was actually insanely easy to implement: https://github.com/DarkFenX/Pyfa/commit/e873f1b88e36f7199686797a2f7dffa1567a5651Note: This is not implementing the previously requested feature of a cargo bay. This simply takes the charges already loaded into the fitted modules and sums them, dumping them in a way that the EVE client can see.
OH PLEASE. Neither pyfa or EFT can do this currently and it would make my life 10000x easier. You wouldn't believe the number of "FC what ammo should I have on this ship" questions I get... (not that I mind at first but it does get annoying over time). Some of the ships in my fleet doctrines I can't fit myself and for some reason there's no way to modify those fits in-game (that I know of) post-import.
When will this change be live? |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 03:18:00 -
[2] - Quote
Sable Blitzmann wrote:Are you talking about adding general charges in cargo to the fit? Work on that stalled a while back, and I'm working on a few other things for Pyfa. Hopefully I can continue with it soon, but no promises. However, the latest commit will include LOADED charges on the modules in the fit's DNA export (which is used by the HTML export). When you open the fit in EVE from the HTML export, the client will interpret these as charges belonging to that fit and list them in the appropriate section. However, as Pyfa doesn't yet have proper support for cargo bay, we must use the currently loaded charges in the modules, and so we are limited by the amount of charges the export can show. For example, you cannot include 4 different missile types when you only have 2 missile launchers. I hope this makes sense. As for getting the export changes, try http://blitzmann.it.cx/pyfa-nightly/ (latest) or wait until official release (or apply commit yourself -- it's only a few lines of code)
I'm talking about {created fit in pyfa with LOADED ammo/charge/script} - > export to desktop -> place file in proper folder for EVE to see -> import fit into EVE -> have saved fit show "rocket launcher II" + "scourge rage rockets" in-game.
The cargo hold thing isn't such a big deal to me, though it would be a nice way to remind people to bring nanite :D
EDIT: and thanks for the nighly link, I'll check it out! Will installing it nuke my loaded fits? |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 03:48:00 -
[3] - Quote
Looking through your code I don't see how those changes modify the XML file that eventually gets imported by EVE... I must be missing something here. |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 05:01:00 -
[4] - Quote
I'm looking through it now. Sorry for the confusing language earlier
I've only had python in undergrad but this seems like an easy fix
This method only needs a simple modification to conditionally include the "slot="cargo"" and qty="xxx" attributes in the elements at the end of the file.
I can play around with it if you like, do you have anything like "fit.cargo" I that can fetch a list of cargo elements?
This method here:
# sample while loop 'cause it's how I'd do it # fit.cargo=[('Nanite Repair Paste',50)] ## store cargo as list of tuples somewhere else in your code timer=len(fit.cargo) i=0 while i < timer : ThisTime = fit.cargo[i] numC = ThisTime[1] itemN = ThisTime[0] hardware = doc.createElement("hardware") hardware . setAttribute("qty", numC) hardware . setAttribute("slot", "cargo") hardware . setAttribute("type", itemN) fitting . appendChild(hardware) i = i+1
So yeah, if you could create a "fit.cargo" list of tuples then that code *should* be able to import it and append it to your XMl output in a format EVE will understand.
|
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 05:25:00 -
[5] - Quote
Sable Blitzmann wrote:Fittings in Pyfa do not currently have a cargo attribute -- this is going back to the cargo feature that I would like to implement but just haven't had time to work on. I just commited this feature to my local branch. https://github.com/blitzmann/Pyfa/commit/943ddd3da1a715184a8d39d88c731054c62dec8dThe modules themselves have the charge information that we need, so as we loop through the modules, we collect that info and store in a dict. Then we simply loop that dict and add them to the XML file. You almost got it in your example. =) Feel free to continue to poke around and patch stuff! I'm on my laptop without an EVE installation, so I cannot verify that it imports into EVE correctly. Once I can verify it, I'll push this commit upstream
Awesome! I've never worked in a dev environment (first internship this summer!) and thats the only code of yours I've looked at lol.
On your test XML as long as you have tags similar to this at the end it IS importable into Eve:
//hardware type="Nanite Repair Paste" slot="cargo" qty="50"/////hardware//
//hardware type="Scourge Rage Rocket" slot="cargo" qty="500"/////hardware//
I may or may not have exported fits from EVE to figure out how they organized it, then copy/pasted it in Pyfa exports to
// == "<" or ">" because GRR CCP forum filters lol. |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 05:42:00 -
[6] - Quote
On first try copy/psating your changes into the eos/fit.py didn't generate an XML output that had the cargo tags in it. No error messages or anything... just exported an XML without the tags.
Perhaps I made a mistake somewhere. |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 05:56:00 -
[7] - Quote
Got the new file, here's an XML export:
http://pastebin.com/EspDtiMG
Weird... (I replaced my file with the one you uploaded)
Another pastebin with a new crow fit, just rocket launcher IIs, and scourge rage rockets on it and the new file fit.py in program files/pyfa/eos
http://pastebin.com/FbQ2yHqc
Screen shot of the fit pre-export: http://imgur.com/nzc5B43 |
Lord X3n0s Aeon
Brave Newbies Inc. Brave Collective
23
|
Posted - 2014.04.23 06:10:00 -
[8] - Quote
Also, imgur of the new file in-place:
http://imgur.com/aXbI0bc
I'm scratching my head at this one...
EDIT: DAMMIT I was putting the file in the wrong place :) My bad! One sec I'll test it now |
|
|
|