Maintenance for the week of January 13:
• PC/Mac: No maintenance – January 13

CRAFTING_TYPE_ENCHANTING Problem

Hav0ch
Hav0ch
Soul Shriven
I'm writing an add-on that uses the "CRAFTING_TYPE_" constants to determine which type of crafting is taking place and then displays any crafting writ associated with that type of crafting so that I don't have to repeatedly open and close the crafting station to see which items I need to craft for that type of writ.

I have the following for constants:
CRAFTING_TYPE_ALCHEMY
CRAFTING_TYPE_BLACKSMITHING
CRAFTING_TYPE_CLOTHIER
CRAFTING_TYPE_ENCHANTING
CRAFTING_TYPE_PROVISIONING
CRAFTING_TYPE_WOODWORKING

The constants for all crafting types except enchanting works. Has anyone else experienced this issue?

Note: I can get my add-on to work by testing for GetCraftingInteractionType() == 3, but not when testing for the constant as listed above for enchanting.
  • stefan.gustavsonb16_ESO
    stefan.gustavsonb16_ESO
    ✭✭✭✭✭
    Try printing the value of that constant to see whether it's actually defined properly. It sounds as if it isn't.
  • Hav0ch
    Hav0ch
    Soul Shriven
    I'm thinking it is incorrectly spelled in the definition. Is there a way that I can print out the constant names?

    I already have the numerical values for each type.
  • Fyrakin
    Fyrakin
    ✭✭✭
    I think what stefan was saying was actually test if the name has a defined value.
    try /strip d(CRAFTING_TYPE_ENCHANTING)
    NA Megaserver (810) - Fyrakin, Loremaster Fyrakin, Cartographer Fyrakin, Taskmaster Tobin, Zergas, Texa, Furnacius, Hextex
    EU Megaserver (167) - Fyrakin
    MiniMap author
  • Hav0ch
    Hav0ch
    Soul Shriven
    @Fyrakin ... thanks for the feedback ...

    I'm assuming that your suggestion was to be typed from the ESO command line? If so, where does the output go?

    I get no results in the chat window when typing that command ... no debug message ... no error message ... etc.

    For any of the above listed constants.

    Do I need to turn on some kind of debug mode?

  • Fyrakin
    Fyrakin
    ✭✭✭
    In a chat line typed text command /script d("Hello world") will print text in a chat tab. The command I suggested earlier was mistyped it should be /script d(CRAFTING_TYPE_ENCHANTING) and it would type the value. If its set it will return the value it is set to if there is no value - result will be nil.
    NA Megaserver (810) - Fyrakin, Loremaster Fyrakin, Cartographer Fyrakin, Taskmaster Tobin, Zergas, Texa, Furnacius, Hextex
    EU Megaserver (167) - Fyrakin
    MiniMap author
  • Hav0ch
    Hav0ch
    Soul Shriven
    I checked using your corrected command line this morning. The variable is defined and does respond with "3" as it should.

    Last night, I started having problems with other crafting stations. Now, it appears that there's just something flaky going on. Maybe latency? Who knows? If I log out and back on, the problem clears up and the quest is displayed properly when I open the crafting station.

    Maybe I expect too much.

    Thanks to both of you for your assistance. I'll just call this unresolved for now and if I ever figure out what is causing the problem, I'll add a reply.
  • Garkin
    Garkin
    ✭✭✭
    If checking interaction type for enchating doesn't work for you, use different way.
    ALCHEMY_SCENE:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_SHOWING then
            --display quest for alchemy
        elseif newState == SCENE_HIDING then
            --hide quest
        end
    end)
    
    ENCHANTING_SCENE:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_SHOWING then
            --display quest for enchanting
        elseif newState == SCENE_HIDING then
            --hide quest
        end
    end)
    
    PROVISIONER_SCENE:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_SHOWING then
            --display quest for provisioning
        elseif newState == SCENE_HIDING then
            --hide quest
        end
    end)
    
    --Smithing scene is shared for blacksmithing, clothing and woodworking, so you will need to actually check crafting interaction type, but it should work here.
    SMITHING_SCENE:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_SHOWING then
            local craftingType = GetCraftingInteractionType()
            if craftingType == CRAFTING_TYPE_BLACKSMITHING then
                --display quest for blacksmithing
            elseif craftingType == CRAFTING_TYPE_CLOTHIER then
                --display quest for clothing
            elseif craftingType == CRAFTING_TYPE_WOODWORKING then
                --display quest for woodworking
            end
        elseif newState == SCENE_HIDING then
            --hide quest
        end
    end)
    
    Edited by Garkin on April 13, 2015 8:12PM
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
  • Hav0ch
    Hav0ch
    Soul Shriven
    Uhm ... yeah :)

    Seriously ... where do you go to get the kind of information that would allow you to come up with that?
  • Garkin
    Garkin
    ✭✭✭
    Hav0ch wrote: »
    Uhm ... yeah :)

    Seriously ... where do you go to get the kind of information that would allow you to come up with that?

    In EsoUI source code.

    http://esodata.uesp.net/current/index.html
    http://www.uesp.net/wiki/File:EsoExtractData.zip
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
  • Hav0ch
    Hav0ch
    Soul Shriven
    @Garkin ... that is exactly the kind of information that I needed. Downloaded and ran the extraction and looking forward to digging into the files when I'm awake tomorrow.
  • Phinix1
    Phinix1
    ✭✭✭✭✭
    ✭✭✭✭✭
    Hav0ch wrote: »
    Uhm ... yeah :)

    Seriously ... where do you go to get the kind of information that would allow you to come up with that?

    Garkin is a LUA Jedi. What isn't available for reference he can access through the Force Matrix. :p
Sign In or Register to comment.