PDA

View Full Version : to save data into SavedVariablesPerCharacter


Googus
06-06-2007, 11:28 AM
I have a datafield i want to save the name of that frame who calls the function?

I have tired to find out on wowwiki how its should be, but for what i see i just get more confused

Tunga
06-06-2007, 01:37 PM
There's pretty good instructions here:
http://www.wowwiki.com/HOWTO:_Save_Variables_Between_Game_Sessions
Did you see that?

Googus
06-06-2007, 02:55 PM
Great, just another thing, why dont it work:

LG_bookside = { "Bookside" }
local initLG_bookside = LG_bookside;

LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);

the saved lua:

Bookside = "LGprojectForm_Drainei_001"

Duugu
06-06-2007, 05:19 PM
Can't even guess what you're talking about. Could you please be more precisely?

Googus
06-06-2007, 06:02 PM
i have saved the name of my last open frame, i want it to be the one who popup next time i go online with that character.

i have a main frame called goto.xml i want it to do OnLoad to hide LGprojectForm_Menu and show the frame i use last time

Duugu
06-06-2007, 06:14 PM
local initLG_bookside = getglobal(LG_bookside); ?

Googus
06-06-2007, 07:37 PM
that dont work :(

Duugu
06-06-2007, 07:55 PM
Then please post your full code and spedify "dont work". :)

Googus
06-06-2007, 11:01 PM
ok

<Ui xmlns="http://www.blizzard.com/wow/ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--Autogenerated by wowuides, Version=1.0.300.0, Culture=neutral, PublicKeyToken=null-->
<Frame name="LGprojectForm_Menu" movable="true">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508883-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="333" y="155" />
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="UIParent">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11" />
</BackgroundInsets>
<TileSize>
<AbsValue val="32" />
</TileSize>
<EdgeSize>
<AbsValue val="32" />
</EdgeSize>
</Backdrop>
<Layers>
<Layer>
<Texture name="$parentTitleBorder" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="160" y="32" />
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="5" />
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.2" right="0.8" top="0" bottom="0.6" />
</Texture>
<FontString name="$parentTitleString" font="Fonts\FRIZQT__.TTF" text="LG Project">
<Size>
<AbsDimension x="140" y="0" />
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-4" />
</Offset>
</Anchor>
</Anchors>
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentButtonDrainei" text="Drainei">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="78" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="21" y="-98" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>LGprojectForm_Menu:Hide(1);
LGprojectForm_Drainei_001:Show(1);
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
<Frame name="$SubtitleWelcome">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="291" y="16" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="21" y="-80" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="|cff00f4f4Please select a guide, all race guides are for 1-12." justifyV="TOP">
<Anchors>
<Anchor point="TOPLEFT" />
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<FontHeight>
<AbsValue val="11" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="$Welcome">
<!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4978-d66d-444e-bb2d-1ad102c87fed" />-->
<Size>
<AbsDimension x="291" y="45" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="21" y="-31" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="$parentLabel" setAllPoints="true" font="Fonts\FRIZQT__.TTF" text="Hallo and welcome to the LG project created by Lennert Googus aka. Jilo. Member of Team Easy On on the Alliance side of the european realm Turalyon" justifyV="TOP" justifyH="LEFT">
<FontHeight>
<AbsValue val="11" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
</Frame>
<Button name="$parentComponent2" text="Human">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="78" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="234" y="-98" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
<Button name="$parentComponent3" text="Night Elf">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="78" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="21" y="-120" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
<Button name="$parentComponent1" text="Drawf / Gnome">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="123" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="105" y="-98" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
<Button name="$parentComponent4" text="Leveling Guide">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="123" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="105" y="-120" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
<Button name="$parentComponent5" text="Reputation">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="78" y="18" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="234" y="-120" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont inherits="GameFontNormal" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</NormalFont>
<HighlightFont inherits="GameFontHighlight" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="1" b="1" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</HighlightFont>
<DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="0.4980392" g="0.4980392" b="0.4980392" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</DisabledFont>
</Button>
</Frames>
<Scripts>
<OnLoad>local initLG_bookside = getglobal(LG_bookside);

LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);
</OnLoad>
<OnDragStart>this:StartMoving()
</OnDragStart>
<OnDragStop>this:StopMovingOrSizing()
</OnDragStop>
</Scripts>
</Frame>
</Ui>

[string "LGprojectForm_Menu:OnLoad"]:4:attempt to index local 'initLG_bookside' (a nil value)

Duugu
06-06-2007, 11:07 PM
Couldn't find

LG_bookside = { "Bookside" }
local initLG_bookside = LG_bookside;

in this code.

Googus
08-06-2007, 12:32 AM
[string "LGprojectForm_Menu:OnLoad"]:5:attempt to call mothod 'show' (a nil value)

after i changed

<OnLoad>local initLG_bookside = getglobal(LG_bookside);

LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);
</OnLoad>

to <OnLoad>LG_bookside = { "Bookside" }
local initLG_bookside = LG_bookside;

LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);
</OnLoad>

Tunga
08-06-2007, 02:16 AM
For future reference, using code tags makes stuff easier to read :smiley: :
LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);
</OnLoad>
<OnLoad>LG_bookside = { "Bookside" }
local initLG_bookside = LG_bookside;

LGprojectForm_Menu:Hide(1);
initLG_bookside:Show(1);
</OnLoad>