Thread Tools Display Modes
08-25-06, 07:36 PM   #1
thorny530
A Murloc Raider
Join Date: Apr 2006
Posts: 7
Need help, My first mod

Ok Im trying to build a simple mod.

Im so lost. First of all WoW doesnt even recognize that the mod is there (I turned on out of date mods) So I cant even trouble shoot.

This is What I want it to do:

First you type in a channel name, and hit join (box "c". From then on, it displays any chat in the channel in box "a". I also want it to be able to send a message box "b". here is a rough design of what I want it to look like.


Here is the XML I came up with, I dont know this too well, I have red tutorials, and studied others coding.

Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
	<Script file="ChatChannel.lua"/>
		<Frame name="ChatChannel_Frame" frameStrata="HIGH" toplevel="true" enableMouse="true" movable="true" parent="UIParent" hidden="true">
			<Size>
				<AbsDimension x="240" y="120"/>
			</Size>

			<Anchors>
				<Anchor point="TOP"/>
			</Anchors>

			<Backdrop name="$parentBackdrop" bgFile="Interface\TutorialFrame\TutorialFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
				<EdgeSize>
					<AbsValue val="16"/>
				</EdgeSize>
				<TileSize>
					<AbsValue val="32"/>
				</TileSize>
				<BackgroundInsets>
					<AbsInset left="5" right="5" top="5" bottom="5"/>
				</BackgroundInsets>
			</Backdrop>
			<Layers>
				<Layer level="Background">
					<FontString name="$parentChatTxt" inherits="GameFontNormal" text="ChatChannel_ChatTxt">
						<Size>
							<AbsDimension x="230" y="50"/> 
						</Size>
						<Anchors>
							<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
								<Offset>
									<AbsDimension x="5" y="-5"/> 
								</Offset>
							</Anchor>
						</Anchors>
					</FontString>
				</Layer>
			</Layers>
			<Scripts>
				<OnLoad>
					ChatChannel_Frame_OnLoad();
					this:RegisterEvent("VARIABLES_LOADED");
				</OnLoad>
				<OnDragStart>
					ChatChannel_Frame_OnDragStart();
				</OnDragStart>
				<OnDragStop>
					ChatChannel_Frame_OnDragStop();
				</OnDragStop>
				<OnEvent>
					ChatChannel_Frame_OnEvent(event);
				</OnEvent>
				<OnUpdate>
					ChatChannel_Frame_OnUpdate(arg1);
				</OnUpdate>
			</Scripts>
			<Frames>
				<EditBox name="$parentChannelBox" letters="80">
					<Size>
						<AbsDimension x="100" y="32"></AbsDimension>
					</Size>
					<Anchors>
						<Anchor point="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="5" y="5"></AbsDimension>
							</Offset>
						</Anchor>
					</Anchors>
					<Layers>
						<Layer level="BACKGROUND">
							<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Left">
								<Size>
									<AbsDimension x="75" y="32"></AbsDimension>
								</Size>
								<Anchors>
									<Anchor point="LEFT">
										<Offset>
											<AbsDimension x="-10" y="0"></AbsDimension>
										</Offset>
									</Anchor>
								</Anchors>
								<TexCoords left="0" right="0.2" top="0" bottom="1.0"></TexCoords>
							</Texture>
							<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Right">
								<Size>
									<AbsDimension x="75" y="32"></AbsDimension>
								</Size>
								<Anchors>
									<Anchor point="RIGHT">
										<Offset>
											<AbsDimension x="10" y="0"></AbsDimension>
										</Offset>
									</Anchor>
								</Anchors>
								<TexCoords left="0.7" right="1.0" top="0" bottom="1.0"></TexCoords>
							</Texture>
						</Layer>
					</Layers>
					<Scripts>
						<OnLoad></OnLoad>
					</Scripts>
					<FontString inherits="ChatFontNormal"></FontString>
				</EditBox>
			<Button name="$parentJoinButton" inherits="OptionsButtonTemplate" text="Join">
				<Anchors>
					<Anchor point="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="110" y="5"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ChatChannel_JoinChannel();
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentCloseButton" inherits="OptionsButtonTemplate" text="Join">
				<Anchors>
					<Anchor point="BOTTOMRIGHT">
						<Offset>
							<AbsDimension x="-5" y="5"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						ChatChannel_Frame:Hide();
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentSendButton" inherits="OptionsButtonTemplate" text="Send">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="160" y="-60"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick></OnClick>
				</Scripts>
			</Button>
			<EditBox name="$parentNewMessageBox" letters="255">
				<Size>
					<AbsDimension x="150" y="32"></AbsDimension>
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="5" y="-60"></AbsDimension>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Left">
							<Size>
								<AbsDimension x="75" y="32"></AbsDimension>
							</Size>
							<Anchors>
								<Anchor point="LEFT">
									<Offset>
										<AbsDimension x="-10" y="0"></AbsDimension>
									</Offset>
								</Anchor>
							</Anchors>
							<TexCoords left="0" right="0.2" top="0" bottom="1.0"></TexCoords>
						</Texture>
						<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Right">
							<Size>
								<AbsDimension x="75" y="32"></AbsDimension>
							</Size>
							<Anchors>
								<Anchor point="RIGHT">
									<Offset>
										<AbsDimension x="10" y="0"></AbsDimension>
									</Offset>
								</Anchor>
							</Anchors>
							<TexCoords left="0.7" right="1.0" top="0" bottom="1.0"></TexCoords>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad></OnLoad>
				</Scripts>
				<FontString inherits="ChatFontNormal"></FontString>
			</EditBox>
		</Frames>
	</Frame>
	<GameTooltip name="ChatChannel_FrameTooltip" hidden="true" inherits="GameTooltipTemplate" parent="UIParent" />
</Ui>
Here is what I Came Up with for the LUA (I got Stuck):

Code:
SelectedID=3;

ChatChannel_VERSION = "0.01";

if(GetLocale()=="deDE") then
ChatChannel_TEXT_LOADED = "geladen";
ChatChannel_TEXT_COMMAND = "Aufrufkommando";
else
ChatChannel_TEXT_LOADED = "loaded";
ChatChannel_TEXT_COMMAND = "Command";
end

function ChatChannel_initialize()
SlashCmdList["ChatChannel"] = ChatChannel_ShowOrHideDlg;
SLASH_ChatChannel1 = "/ChatChannel";

if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(string.format("Chafin's Chat Channel Monitor",ChatChannel_VERSION, ChatChannel_TEXT_LOADED,ChatChannel_TEXT_COMMAND,"/ChatChannel"));
end

end

function ChatChannel_ShowOrHideDlg()
if(ChatChannel_Frame:IsVisible()) then
		ChatChannel_Frame:Hide();
else
ChatChannel_Frame:Show();
end
end

function ChatChannel_Frame_OnLoad()
ChatChannel_Frame.TimeSinceLastUpdate=0;
this:RegisterForDrag("LeftButton");
end

function ChatChannel_Frame_OnDragStart()
ChatChannel_Frame:StartMoving();
end

function ChatChannel_Frame_OnDragStop()
ChatChannel_Frame:StopMovingOrSizing();
end

function ChatChannel_Frame_OnEvent(event)
if(event == "VARIABLES_LOADED") then
ChatChannel_initialize();
end
end


function ChatChannel_Frame_OnUpdate(arg1)
ChatChannel_Frame.TimeSinceLastUpdate=ChatChannel_Frame.TimeSinceLastUpdate + arg1;
if(ChatChannel_Frame.TimeSinceLastUpdate > 1) then
ChatChannel_GetChatTxt();
ChatChannel_Frame.TimeSinceLastUpdate=0;
end
end

function ChatChannel_GetChatTxt()

end
function ChantChannel_JoinChannel()
MyChannel = ChatChannel_FrameChannelBox.Value
JoinChannelByName(MyChannel)
end
and the TOC file
Code:
## Interface: 4216
## Title: A Chat Channel Monitor
## Notes: A mod that displays all Chat Messages from a specified Channel
Sorry for the long Post. Im totally lost.
  Reply With Quote
09-26-06, 10:57 AM   #2
Aule
A Fallenroot Satyr
 
Aule's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 20
One at a time...

Hey!

I'll address your problems one-at-a-time rather than all at once.

TABLE OF CONTENTS (".toc" file)

The reason WoW isn't reading your AddOn is that your TOC file is incomplete. It should look something like this:

Code:
## Interface: 11200
## Title: Chat Channel Monitor
## Version: 0.1a
## Notes: "A mod that displays all chat messages from a specified Channel."
## SavedVariables: 
ChatChannelMod.xml
Line 1: This is the interface number for version 1.12.

Line 2: This is the string that will appear in your AddOns list in-game.

Line 3: Version. Optional, but you should really keep track of different versions of your mod. Every time you post a new version for people to download, just bump up your version (doesn't matter how....come up with your own conventions and stick to them. The version number is great for your users to tell if they have the latest version, and great for you so you can tell what state your addon was in when someone reports a problem).

Line 4: This is the string that will be displayed when the user hovers his mouse over your AddOn in the AddOns list.

Line 5: This is where you will (eventually) specify variables that should be stored between game sessions.

Line 6: This is wherre you specify the XML file that defines your interface. I took a guess at what you've named your mod. What's important is that if you're calling it "ChatChannelMod", then at the very least you should have a folder in the WoW AddOns directory called "ChatChannelMod" which contains three files: "ChatChannelMod.toc", "ChatChannelMod.xml", and "ChatChannelMod.lua". This is just another convention that you don't HAVE to follow. It's a good idea to stick to it though, and if you don't have a reason to break from it, then don't!

Last edited by Aule : 09-26-06 at 02:04 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Need help, My first mod


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