Saving and loading help
Hiya,
For Kmabc 1.2 i am implementing saving and loading. But however, i am at a standstill:(. I am trying to save quickslot data to the plugindata but cannot get anywhere. the code so far is: Code:
local savedatax ={ Code:
Save.Click = function( sender , args ) thanks Queekusme PS. i get the file with the names in but no value to put into them. PPS. i know how to put plain text into the savedata file but not quickslot data so i request that people dont tell me this. |
the reason that is not working is because :GetShortcut() returns the class Turbine.UI.Lotro.Shortcut
which isn't the data you want this is what i do Code:
quickslot.ShortcutChanged = function(sender, args) |
I dont really understand this, what i want to do is save the data to the file so that it puts a hexcode there... how can i use this to make it do that?
|
Quote:
Do you use a bar plugin at all? If you do you should be able to extract the codes you need from its save data. Alternatively Quote:
|
So how do i put that in the context of my code is it something like
Code:
Code:
quickslot1:SetShortcut(Turbine.UI.Lotro.Shortcut(type value,data value)) -- type and data values called from the loadup process |
Quote:
Code:
local sc=Turbine.UI.Lotro.Shortcut(); |
Thanks for the help, i'll try this tomorrow, and i'll look into vindir....'s patch as encoding allways helps
thanks again Queekusme EDIT: thanks again for this but i never intended for there to be alias strings to be saved anyway, but thanks as this will prevent people complaining :) |
Quote:
If you write "a,b = x,y" a is set to the value of x and b is set the value of y. If you write "a =x,y" a is set to the value of x and y is discarded. In your case, 'quickslot1SavData' would be set to the value of 'type' and 'data' would be discarded. You could however, make your quickslotxSavData tables then set both type & data: Code:
quickslot1SavData = {} Code:
(...) |
So what you're saying is that i should save each piece seperately insted of in the same piece of information string.
i see where you are getting at, ok, i'll try this after my tea and homework tonight |
Quote:
If you write "quickslot1SavData = type,data", what the lua runtime does is "quickslot1SavData = type", and then it discards 'data'. See Lua Reference Manual Quote:
|
right, so i need to set each datastring of quickslot(n)savedatax to a table with data and type
(where n = quickslot's number) e.g. Code:
Code:
SRY 4 FORMATTING |
ok it's not working!
i can get the type value of 0.000000 but no data, i've tried items, skills and alias'... here's the code: Code:
|
You seem to be building your data for saving where you initialize the UI. At that point I imagine your quickslot is empty.
|
Quote:
|
Quote:
Code:
shortcut1 = quickslot1:GetShortcut(); |
so in savedatax, i'll try it now!
|
still not getting the data,
Code:
Save = Turbine.UI.Button(); thanks PS, when i change the line: shortcut1 = quickslot1:GetShortcut(); to shortcut1 = quickslotlyrical:GetShortcut(); it gets the value for the link, but not on any of the quickslots with items :( |
If your quickslot has changed, you must reacquire the shortcut. Move "shortcut1 = quickslot1:GetShortcut();" to when you save things.
There is no magic performed by the lua runtime, if you get components/data before shortcuts are set, you'll get empty shortcuts. Code:
Save = Turbine.UI.Button(); |
IT'S WORKING
For anyone else's reference: Code:
Save = Turbine.UI.Button(); -- Not used anymore but will keep in |
All times are GMT -5. The time now is 01:02 AM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI