We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    446

    Saving the item that was placed in the quickslots.

    Hey guys,

    I feel stupid for asking, but I'm really quite stumped on this one... basically in the plugin I'm working on I'm trying to save the disease/fear/wound/poison pot that they placed in the quick slot.

    My problem is this I can't seem to save the data :GetShortcut() fills the file with nothing, so does GetData().
    The only thing that returns something is GetType() returns 2 no matter what pot is in it... so doesn't really help me, and then I'm hoping SetShortcut() will work if the file ever saves any real data.

    Just wondering am I doing it completely wrong? The API documentation leaves much to be desired as I was trying to figure this out.

    Any help would be awesome
    Goneric

    My quickslots are assigned sizes, and all that under the quickslots array using [1-4] to choose their index.
    My code for saving is run when users exit the /plugin potSetup command.
    Code:
    local quickslotsData = {};
    quickslotsData.disease = quickslots[1]:GetShortcut();
    quickslotsData.fear = quickslots[2]:GetShortcut();
    quickslotsData.poison = quickslots[3]:GetShortcut();
    quickslotsData.wound = quickslots[4]:GetShortcut();
    			
    			
    Turbine.PluginData.Save(Turbine.DataScope.Character,  "NameQuickslots",quickslotsData);
    And my code for loading is
    Code:
     quickslots.Data = Turbine.PluginData.Load( Turbine.DataScope.Character,  "NameQuickslots");
    quickslots[1]:SetShortcut(quickslots.Data.disease);
    quickslots[2]:SetShortcut(quickslots.Data.fear);
    quickslots[3]:SetShortcut(quickslots.Data.poison);
    quickslots[4]:SetShortcut(quickslots.Data.wound);
    [charsig=http://lotrosigs.level3.turbine.com/0920d00000010afaf/01008/signature.png]Goneric[/charsig]

  2. #2
    Join Date
    Jul 2008
    Posts
    446

    Re: Saving the item that was placed in the quickslots.

    An update for anyone that will help me farther,

    I switched the saving code, and now it saves a hex code of some kind like "0x030D00013676764E,0x7001CC18 " and I changed my
    SetShortcut() to SetShortcut(Item, quickslots.Data.diseaseData) I found an override SetShortcut method in the API documents anyway... it still isn't loading that data into the quick slots :-/

    My new saving code,
    Code:
    local quickslotsData = {};
    local disease = quickslots[1]:GetShortcut();
    local fear = quickslots[2]:GetShortcut();
    local poison = quickslots[3]:GetShortcut();
    local wound = quickslots[4]:GetShortcut();
    			
    quickslotsData.diseaseData = disease:GetData();
    quickslotsData.fearData = fear:GetData();
    quickslotsData.poisonData = poison:GetData()
    quickslotsData.woundData = wound:GetData();
    [charsig=http://lotrosigs.level3.turbine.com/0920d00000010afaf/01008/signature.png]Goneric[/charsig]

  3. #3
    Join Date
    Jul 2008
    Posts
    446

    Re: Saving the item that was placed in the quickslots.

    I'm just posting to say I've figured it out took me a day lol. All I needed was to create a temporary variable to hold the shortcut value so I could set it to the quickslots.

    For other people that will search the forums like I tried and wondering what I did,
    Code:
    local shortcut = Turbine.UI.Lotro.Shortcut(quickslots.Data.diseaseType, quickslots.Data.diseaseData);
    quickslots[1]:SetShortcut(shortcut);
    Anyway thats how I solved it I have no idea if its the correct way or w/e all I care is it works lol
    [charsig=http://lotrosigs.level3.turbine.com/0920d00000010afaf/01008/signature.png]Goneric[/charsig]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload