Thread Tools Display Modes
05-09-10, 11:47 PM   #1
Tarrion
A Kobold Labourer
Join Date: May 2010
Posts: 1
Script Files

So, I did a bit of browsing through th forums already. I hope I didn't miss it but I'll ask anyhow.

Ive used Addon Studio for a while, loved it, up until I started using this program. I had a few major problems with it, mostly because it was out of date and slow.

My problem is with the Script files. Or rather, connecting them to the XML files. Addon Studio did this for you, or at least created the <Script file="" /> line for you and you could use an XML editor to change it if need be.. Perhaps I am missing it, but I cannot seem to find out how this problem creates that line and anytime I create it myself, it is deleted upon saving the XML file. It's only a minor hassle of having to replace it every time to you save.. but it would still be nice to not have to.

Tarrion
  Reply With Quote
05-18-10, 09:51 PM   #2
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
Post

You cannot add script files directly to regenerated XML, but you can add the script file directly to the project.

Go to the Project Explorer pane, your project name will be the first item. Make sure that the Show Project View button is selected on the toolbar at the top of the pane. Right click on this and select Add Existing File... Look for your script file in the file manager, select it and click Open.

Your script file should now be added to the file list in the Project Explorer. If you wish to reference the functions in the script file in your xml design file, then you must ensure that it is loaded first by right clicking on the script file and selecting Load Earlier. Do this until the script file is ahead of the XML file in the list.
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote
01-19-11, 10:38 PM   #3
NWMac
A Kobold Labourer
Join Date: Jan 2011
Posts: 1
Same Issue with Scripts and Loading Earlier Did Not Resolve

Originally Posted by Nulkris View Post
You cannot add script files directly to regenerated XML, but you can add the script file directly to the project.

Go to the Project Explorer pane, your project name will be the first item. Make sure that the Show Project View button is selected on the toolbar at the top of the pane. Right click on this and select Add Existing File... Look for your script file in the file manager, select it and click Open.

Your script file should now be added to the file list in the Project Explorer. If you wish to reference the functions in the script file in your xml design file, then you must ensure that it is loaded first by right clicking on the script file and selecting Load Earlier. Do this until the script file is ahead of the XML file in the list.
Hi Nulkris,

I have had the same issue. I have moved the .lua script file to the top of the list (earliest load) yet my functions are not availible for use. Below that I have a XML frame with a few buttons which call functions in the .lua file. i.e. I have an On_Click() function with a just one line for :Hide(); linked to a button; but it does not seem to be called.

The button is towards the end of the XML file below and the relevant lines are in purple. I have double (and triple checked) the names, yet can not seem to see success. If I place a function call to hide IND_FRAME_Main directly in the On_Click property it works fine. There is also another XML file, IND_FRAME_Toggle.xml. I can include that if it helps. Any other ideas on what I may have botched? Thank you in advance for any guidance.

Also, I had similar issues with the tutorial file. OnEvent() script didn't appear to be firing and didn't update the label. My assumption is there has baan a change on Blizz's end or that my configuration is somehow wrong.

Best Regards,
NWMac


file: IND_FRAME_Main.lua
Code:
--	Industrialist - An AddOn crafting for World of Warcraft.
--	Version: .01a
--	Copyright (C) 2011 NWMac

function IND_BUT_Exit_On_Click()
  IND_FRAME_Main:Hide();
end

function IND_FRAME_Toggle_On_Click()
  if(IND_FRAME_Toggle:IsShown() == true)
    IND_FRAME_Main:Hide();
   else IND_FRAME_Main:Hide();
  end
end
file: IND_FRAME_Main.xml
Code:
<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="IND_FRAME_Main" movable="true">
    <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508883-59c2-4f83-ae10-27aaad48391b" />-->
    <Size>
      <AbsDimension x="400" y="400" />
    </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="Industrialist">
          <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="$parentButton1" text="Force Close">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="100" y="26" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="274" y="-271" />
            </Offset>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>IND_FRAME_Main:Hide();
</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 style="GameFontNormal" />
        <HighlightFont style="GameFontHighlight" />
        <DisabledFont style="GameFontDisable" />
      </Button>
      <Frame name="INDStatusText">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="50" y="35" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="148" y="-334" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="?">
              <Anchors>
                <Anchor point="TOPLEFT" />
                <Anchor point="BOTTOMRIGHT" />
              </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>
      </Frame>
      <Frame name="$parentLabel2">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="48" y="60" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="160" y="-110" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="12">
              <Anchors>
                <Anchor point="TOPLEFT" />
                <Anchor point="BOTTOMRIGHT" />
              </Anchors>
              <FontHeight>
                <AbsValue val="18" />
              </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="$parentLabel1">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="98" y="62" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="40" y="-109" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="OnExit Test">
              <Anchors>
                <Anchor point="TOPLEFT" />
                <Anchor point="BOTTOMRIGHT" />
              </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>
      </Frame>
      <Frame name="$parentComponent1">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="102" y="11" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="26" y="-358" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="Version: unknown" justifyH="LEFT">
              <Anchors>
                <Anchor point="TOPLEFT" />
                <Anchor point="BOTTOMRIGHT" />
              </Anchors>
              <FontHeight>
                <AbsValue val="9" />
              </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="$parentComponent2">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="235" y="23" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="26" y="-40" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="Inscription" justifyH="LEFT">
              <Anchors>
                <Anchor point="TOPLEFT" />
                <Anchor point="BOTTOMRIGHT" />
              </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>
      </Frame>
      <Button name="IND_BUT_Exit" text="Exit">        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="106" y="24" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="274" y="-345" />
            </Offset>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>IND_BUT_Exit_On_Click();</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 style="GameFontNormal" />
        <HighlightFont style="GameFontHighlight" />
        <DisabledFont style="GameFontDisable" />
      </Button>
    </Frames>
  </Frame>
</Ui>

Last edited by NWMac : 01-20-11 at 10:26 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Script Files


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off