Released [ADDON] List Remaining CPU, Power, Weight while crafting

Discussion in 'Addons' started by SpathiFwiffo, Dec 8, 2012.

  1. #1
    Dec. 18, 2012: Updated to version 1.9: fixed issue with beta1515. This addon is now almost obsolete (temporarily, while the constraints have been disabled in the main game).

    The one use left for this addon is to know which things will work with your battleframe using the "/bfc select [loadout slot]" option.

    Battleframe Constraints mod:

    This addon will display your current battle frame CPU/Power/Weight capacity when the molecular printer is activated. It will also, optionally, show the full equipment loadout and capacity usage for those items. With"/bfc" commands, specific loadout items can also be selected allowing the addon to list out the blueprints that are valid against your battle frame's unlocked tech tree.

    To install simply put the BattleConstraints directory under the Firefall/system/gui/components/MainUI/Addons directory, or install using the Melder tool.

    USAGE:

    1. Install

    2. Activate
    To activate, make sure it is installed and enabled in the Options->Interfaces menu.

    3. Use the molecular printer

    4. Change weapons to clear the text box of the current messages.

    5. Optional advanced commands that can be used "/bfc commands":

    Some basic controls to show and hide the addon window:
    /bfc help
    /bfc show: Display the loadout data now (for when not at a printer)
    /bfc hide: Hide the window (same effect as switching weapons)
    /bfc hide loadout: temporarily hide the loadout frame

    See what blueprints are valid against your current battleframe (so you don't accidentally print the wrong brand of Jumpjets):
    /bfc select [loadout item id | loadout name (ammo, servos, etc) | help]: display available blueprints that can replace the selected item. only unlocked, valid prints are displayed.
    Mainly for future expansion, control the 'selected' list even further:
    /bfc filter [string]: filter the selected blueprints allowing only the given string.
    multiword filters need quotes, multiple filters allowed but they will add more things.

    example: Say I am in my Firecat and I want to only view my "Bombs Away"
    '/bfc filter bomb' will show me all the bombs away I've unlocked that can be crafted.
    '/bfc filter "kisuton bomb"' will only show me the kisuton bombs away.

    /bfc reset: undo the /bfc command settings, returning to default.

    How to use the numbers:
    In-game the Garage and Molecular Printer treat printable items a bit differently. The numbers in the printer are of by *100. So, for example: When you are comparing the specs for a possible Printed Ammo vs the installed Ammo the printer will show it to you as something like:

    -1.03 kW (power),
    -5.04 kg (weight),
    +0.04 mL (cpu).

    This translates to using an extra 103 Power, using an extra 504 Weight, and gaining you 4 CPU points.

    Planned functionality:
    I'd really like to be able to pre-calculate the printer's output, saving lots of time choosing and comparing materials that just won't work. Sadly, there is no interface to get material qualities/quantities for addon developers, yet (addon code is still not really supported).
    The "/bfc select" functionality is a setup for that.

    Screenshot. With just Capacity Remaining displayed (updated version 1.3):
    CapacityOnly_v1_3.jpg


    Screenshot with Loadout included (updated version 1.3):
    WithLoadout_v1_3.jpg

    Options menu (v1.3):
    OptionsScreen.jpg

    Output from "/bfc select abilities" (version 1.7):
    LoadoutWithSelection_1_7.jpg


    Code:
    Version History
     
    Version 1.9
    - fixed odd compatibility issue with beta 1515
     
    Version 1.8
    - /bfc hide loadout -- just hide the loadout portion (temporarily)
                          to reduce screenspace used.
    - /bfc filter [string] - filter the 'select' blueprints fixed select text.
                            list only filtered items.  can have more than one added.
    - fixed the need to double-close the window to get rid of the background.
     
    Version 1.7
      made loadout display a bit less ugly.
      got rid of some test output that was never supposed to go live.
     
    Version 1.6
      /bfc avalable -> /bfc select
      /bfc select allows for named loadout positions (such as "ammo", "jumpjets").
        don't actually need the full name ("jump" would work for jumpjets... does
        abbreviated matches).
      /bfc select still works by number, as well.
      /bfc hide added
     
    Version 1.5
    new features:
      /bfc commands
      /bfc help
      /bfc show: Display the loadout data now (for when not at a printer)
      /bfc display: same as 'show'
      /bfc available [loadout item id]: display available blueprints that can replace the chosen item
      /bfc reset: undo the 'available' setting
     
    added a new sub-frame to hold the new information, with its own on/off option.
     
    Version 1.4
    Quick fix:  empty window was being opened even with debugging disabled.  Not anymore.
     
    Version 1.3
    Made things look better.
    -  Put up a background that should auto-resize to cover the main bits of text and make it more readable.
    -  Put the 3 sets of text into separate frames.  This way they can be colored differently.
     
     
    Version 1.2
     
    fixes:
    - removed deprecated message call, so might not break with future releases of firefall.
    - update information when battleframe modules changed in Garage.
     
    Issues:
    - Weapon switching is still how you clear the actively displayed messages.
     
     
    VERSION 1.1:
    Fixes for version 1.1:
    - made default frame placement better
    - changed text color to pop more.
    - Cleanup HTTP calls, should not collide as much (no more errors)
    - fixed option toggles, should not need to set them on/off every time you log in.
     
    Issues:
    - still using a deprecated Interface API. need to fix that soon, maybe in a few minutes.
     
     
    VERSION 1.0:
    Known Issues:
    version 1.0 -- works, but isn't pretty.
    - Default Window placement is poor
    - Text coloring is bad
    - User may see "Garage Lookup Failure" message, due to HTTP request collission, this doesn't seem to affect the calculated values, however.
    - option menu uses a deprecated method
    - option toggles default to true and need to be hit several times to deactivate
    - options seem to reset each time you restart the game... figured they should save, but not right now.
     
    workaround:
    - just switch weapons to make the messages clear up until the next trigger displays them again (should be rare, changing battleframes, and using printers).
    hope to clean these issues up soon, but hey, it works and it is easy to de-activate the display frame from inside the game (Options->Interfaces->Battleframe Components->Deactivate component [bottom button]).
     
     
    Originally posted as a Work In Progress in this thread:[URL]http://www.firefallthegame.com/community/threads/addon-wip-for-viewing-battleframe-capacity-when-nanoprinting-not-finding-all-the-data-i-need.69116/[/URL]
     
    
    Thanks to Lemon King for some pointers and to Godofdrakes for the well documented Battleframe Info mod.

    Enjoy.

    [melder_info]version=1.9;compatible=0.5.1515;dlurl=battleframeconstraints_1-9-zip.23241[/melder_info]

    Attached Files:

    • Like x 7
  2. #2
    Just wanted to say congrats on this :) Good on you for taking the idea and running with it. I'll test it out later tonight!
    • Like x 2
  3. #3
    Thanks for the support AussieMark!

    Noticed something else when using the printer, which seems like a Firefall issue ... when printing the numbers listed for items are off by x100 for all categories.

    For example. It will list weight as 1.45kg, but in the Garage (and item, and thus in my addon) it lists as 145kg. So, when you see +0.25mL it means you gain 25 CPU points, and -0.10mL would be using an extra 10 CPU points.

    Probably an issue in the garage with them not dividing by 100, and showing the raw numbers.
  4. #4
    Hey just downloaded melder beta the latest version and your addon.

    So I ran a few tests for you because I couldn't get it working through meld, only manually.

    In the MELD INI file I found you had DEST=gui/components/MainUI/Addons/ and others had: DEST=gui/components/MainUI/Addons (without the / at the end) not sure if this is it because I changed that and still cannot get it working.

    Will have to compare it again later as its 3 am here :p
  5. zyzeast Storm Rider

    #5
    Wish they'd just add this to the default game UI, it's pretty frustrating running back and forth from the printer to the garage to see your limits.
    • Like x 2
  6. #6
    Version 1.1 added to first post along with updated screenshots. Lots of improvements.

    fixed most of the issues. Still using weapon-change as a text clearing solution. seems to work fine and can't find an event based solution, still.

    Wish i could figure out how to set the background color, or change text color on the fly.
    I may update it to make the Loadout and Debug messages show up in different colors, but looks much better now.
    • Like x 1
  7. #7
    Correct, the Printer seemed to have been updated recently while the garage has not.
    They're both handled by different teams, which would be why the numbers are off a bit.
    • Like x 1
  8. Chanticrow Mobile Fortress

    #8
    Great job. Good on you for sticking with it. I look forward to seeing this addon progress. We've really needed this functionality.
    • Like x 2
  9. #9
    Thanks guys.

    Let me know if anyone knows how to modify text colors or background color in-line in SetText (or maybe there are methods other than SetText(String)). I tried using some ANSI escaping and tried using |cFFFFFFF type escaping, but no luck; Also, didn't manage to set the frame background colors in the <Frame> setup, tried a few different style="" options, but nothing I tried worked.
    • Like x 1
  10. #10
    Text:SetTextColor("RRGGBB" or "AARRGGBB")
    • Like x 2
  11. Arkii Apothecary

    #11
    Looks like I got ninja-ed :p

    It can't be done inline, however ":SetTextColor("#00FFCC");" will do the trick. If it's to have different lines to be different colours well, then your going to have to make them be different <text> items.

    To get a a backgrouck use some thing like this as a child of the Frame.
    Code:
    <StillArt name="plate" dimensions="dock:fill" style="texture:colors; region:white; tint:#000000; alpha:0.5"/>
    
    Hope that helps ^^
    • Like x 3
  12. Kyria Commander

    #12
    My lappy is currently at the doctor's, but when I get it back and can play Firefall again this is first on my to-do list!
    Looking forward to trying it out, SpathiFwiffo! :)
  13. #13
    Was hoping to do the color changes in line. Tried to make separate frame elements, but since the Loadout size is variable, it ended up clobbering some of the other text. I'm sure I can figure out how to align it separately, though, with a bit of trail and error, since I know the main text is of a fixed size.
    • Like x 1
  14. #14
    Just found a cool reflection thing in LUA.

    Code:
     
        for k, v in (getmetatable(object).__index) do
            print(k)
        end
    
    that will dump all the functions available on that object.
    Useful considering how undocumented all this is.
    • Like x 2
  15. #15
    Useful addon will be checking it out here later today. Thanks!
  16. #16
    Updating to 1.3 ... using that reflection debug, i was able to figure out how to size my Main and sub-frames on the fly, so the text clobbering is gone, and I'm also able to resize the shaded background to fit, as well (thanks ArkyChan, that StillArt element did the trick).
    • Like x 1
  17. #17
    Slightly different method from what I use, but it works. :D
    • Like x 1
  18. Hanachi Stellar Ponies

    #18
    >
    The easiest method I know of is this: (Aside from dumping them directly from the exe.)
    Code:
    for k,v in pairs(Player) do
        log(k,v)
    end
    • Like x 2
  19. #19
    Tried doing it with just pairs(Frame) and got some kind of error. So, kept looking for solutions and found the one I ended up using. Guess it depends on the object.
  20. Hanachi Stellar Ponies

    #20
    >
    Well I can guarantee for you that the method I listed above works perfectly, as I use it to see funcs sometimes.