CodenameG
New Member
- Joined
- Jan 15, 2010
- Messages
- 38,364
- Reaction score
- 231
How to Write a Custom Class, a Guide for Beginners.
Last Updated 10-7-10
What is this?
This is a Guide for people looking to get into CC Creation and Honorbuddy Development, this guide will cover basic things like, Creating a project, Adding Refrences to Visual Studio, The HonorBuddy Api, and Do's and Dont's.
Prerequisites
Visual Studio 2010 - Express Edition or Full, Express Edition is Free all you have to do is Register it with Microsoft, and it can be downloaded here
The Custom Class Template (Blank.cs) - Found attached to this post.
Honorbuddy - Latest version - Can be found in the "Releases" section of the fourm.
Good Knowledge of WoW and its Mechanics as well as Class Design
Creating a Project
Assuming you have the above, and you now have visual studio installed, you can now begin creating your project.
Step 1 - Open Visual Studio
you can do this by running the shortcut or though the start menu, (do i really have to explain this?)
Once you have visual studio open, you should have a screen that looks like this.
Go to File, New, and then click on Project
from here we should have a screen that looks like this.
on the left side, if windows isnt selected, click on it, then on the right side, click on Class Library, from here we need to enter a name for our project in this case its Warrior, but names like, DbWarlock, Mephiles, Amplify, Kaboomkin. is whats going to define your class later on, so pick a good name from the start.
Welcome to Visual Studio
At this point you can now start working with your project.
Whats in the Red is your Workspace, This is where you will work with your code.
the Blue is your Solution Explorer, it will be used to switch between files in your project,
if you dont see the Solution Explorer, you can turn it on by going to View, then click on solution explorer
now we are going to get rid of the default "project file" it created for us
This can be done by clicking on Class1.cs, and pressing delete or Right clicking on it, and then clicking delete.
Now lets Add in our Template.
We want to right click the project name, (in this case Warrior) then click on Add and then Existing Item. then browse for the template. Blank.cs
As you can see the file has been added to our current project.
Now Lets rename Blank.cs
To Rename Click on Blank.cs Twice or Right Click and Click on rename, (its importaint to pick a name thats good, Sugestions are, the Project name, or the Classname, in this case "Warrior", now that that is done click on the file you just renamed again.
Youll see the code inside the file poped up on the left hand side, we can now make changes.
now as you can see there are lots of different colors here theres Reds and Greens and Oranges.
Now Lets Start with the Greens.
Greens Are comments - Comments are only for the user, and are not read by honorbuddy or visual studio, they are there for you to make notes.
To Make a new comment, go to an empty line and add// before what you want to comment on.
for example,
//This is a new Comment
Now lets deal with Reds, Reds are commands that the IDE or the Integrated development environment Aka: Visual Studio dosnt understand, if any code is underlined in red, that means it will not compile, and will NOT run in Honorbuddy. Reds Most of them, will usually be caused by Syantax issues, or in this case not having the proper references.
Adding the Honorbuddy Refrences To Visual Studio
Right click on the Project and then click on "Add Reference..."
Now Click on the Browse Tab and Explore to your Honorbuddy Directory, once there Click on your Honorbuddy.EXE, and Tripper.Tools.dll you can do it one at a time or Hold Down Ctrl, and Click on Each One to Select them Both at the same time. and then click OK. Repeat this against instead this time under the .NET tab, select PresentationCore and click OK.
Now if you notice on the left hand side, all the Red Text is now gone, that means we have Successfully added the Honorbuddy Api to visual studio, visual studio can now understand that code.
Last Step
Now the last thing we need to do is change the NameSpace, the CC Name, and the Class we are Coding for.
now lets deal with these one by one.
Namespace - helps the project know what code go with what, if we where making a CC with multiple files. they would all need to have the same, Namespace, in order for them to know they where all together. almost like having Bins on a Desk, the Desk is your Namespace, and the Bins are your files. for today's propose we wont go farther.
Change your Namespace to your Project name, in this Case it would be "Warrior" (without the quotes) so we are going to change it from Layout to Warrior.
CC Name - This tells Honorbuddy What to refer to your CC as, for example "Chose Shadow v0.1 as your combat class!" comes up in the log when honorbuddy starts.
Change your CC Name, to your Project name, and then add a version Number, for example V1.0 Please note, this has to be in between the two "" or Visual Studio wont understand it.
Class - The Class, Tells Honorbuddy what "Class" this code is going to work for, and this is the first Api we will be messing with.
Click on the end of WoWClass.Mage
and Backspace out Mage till you get to the end of Class ill you have WoWClass Left, now add a Period . you should see a drop down come up, this is called "Auto Complete" visual studio Went though the Honorbuddy Api, and Pulled out all the Choices for you. now you can ether Type in the Class as it is there, or double click on the option you want.
so if i where doing a shaman, i would click on "Shaman", or type "Shaman" also if you start typing and the list gets down to one or two options, for example i start typing "Sha" if i press Space it will auto complete that code for me.
Congratulations you now have your project completely setup, and ready to start adding code.
Last Updated 10-7-10
What is this?
This is a Guide for people looking to get into CC Creation and Honorbuddy Development, this guide will cover basic things like, Creating a project, Adding Refrences to Visual Studio, The HonorBuddy Api, and Do's and Dont's.
Prerequisites
Visual Studio 2010 - Express Edition or Full, Express Edition is Free all you have to do is Register it with Microsoft, and it can be downloaded here
The Custom Class Template (Blank.cs) - Found attached to this post.
Honorbuddy - Latest version - Can be found in the "Releases" section of the fourm.
Good Knowledge of WoW and its Mechanics as well as Class Design
Creating a Project
Assuming you have the above, and you now have visual studio installed, you can now begin creating your project.
Step 1 - Open Visual Studio
you can do this by running the shortcut or though the start menu, (do i really have to explain this?)

Once you have visual studio open, you should have a screen that looks like this.

Go to File, New, and then click on Project

from here we should have a screen that looks like this.
on the left side, if windows isnt selected, click on it, then on the right side, click on Class Library, from here we need to enter a name for our project in this case its Warrior, but names like, DbWarlock, Mephiles, Amplify, Kaboomkin. is whats going to define your class later on, so pick a good name from the start.

Welcome to Visual Studio
At this point you can now start working with your project.
Whats in the Red is your Workspace, This is where you will work with your code.
the Blue is your Solution Explorer, it will be used to switch between files in your project,
if you dont see the Solution Explorer, you can turn it on by going to View, then click on solution explorer

now we are going to get rid of the default "project file" it created for us
This can be done by clicking on Class1.cs, and pressing delete or Right clicking on it, and then clicking delete.

Now lets Add in our Template.
We want to right click the project name, (in this case Warrior) then click on Add and then Existing Item. then browse for the template. Blank.cs

As you can see the file has been added to our current project.

Now Lets rename Blank.cs
To Rename Click on Blank.cs Twice or Right Click and Click on rename, (its importaint to pick a name thats good, Sugestions are, the Project name, or the Classname, in this case "Warrior", now that that is done click on the file you just renamed again.
Youll see the code inside the file poped up on the left hand side, we can now make changes.
now as you can see there are lots of different colors here theres Reds and Greens and Oranges.
Now Lets Start with the Greens.
Greens Are comments - Comments are only for the user, and are not read by honorbuddy or visual studio, they are there for you to make notes.
To Make a new comment, go to an empty line and add// before what you want to comment on.
for example,
//This is a new Comment
Now lets deal with Reds, Reds are commands that the IDE or the Integrated development environment Aka: Visual Studio dosnt understand, if any code is underlined in red, that means it will not compile, and will NOT run in Honorbuddy. Reds Most of them, will usually be caused by Syantax issues, or in this case not having the proper references.

Adding the Honorbuddy Refrences To Visual Studio
Right click on the Project and then click on "Add Reference..."

Now Click on the Browse Tab and Explore to your Honorbuddy Directory, once there Click on your Honorbuddy.EXE, and Tripper.Tools.dll you can do it one at a time or Hold Down Ctrl, and Click on Each One to Select them Both at the same time. and then click OK. Repeat this against instead this time under the .NET tab, select PresentationCore and click OK.

Now if you notice on the left hand side, all the Red Text is now gone, that means we have Successfully added the Honorbuddy Api to visual studio, visual studio can now understand that code.

Last Step
Now the last thing we need to do is change the NameSpace, the CC Name, and the Class we are Coding for.
now lets deal with these one by one.

Namespace - helps the project know what code go with what, if we where making a CC with multiple files. they would all need to have the same, Namespace, in order for them to know they where all together. almost like having Bins on a Desk, the Desk is your Namespace, and the Bins are your files. for today's propose we wont go farther.
Change your Namespace to your Project name, in this Case it would be "Warrior" (without the quotes) so we are going to change it from Layout to Warrior.
CC Name - This tells Honorbuddy What to refer to your CC as, for example "Chose Shadow v0.1 as your combat class!" comes up in the log when honorbuddy starts.
Change your CC Name, to your Project name, and then add a version Number, for example V1.0 Please note, this has to be in between the two "" or Visual Studio wont understand it.
Class - The Class, Tells Honorbuddy what "Class" this code is going to work for, and this is the first Api we will be messing with.
Click on the end of WoWClass.Mage
and Backspace out Mage till you get to the end of Class ill you have WoWClass Left, now add a Period . you should see a drop down come up, this is called "Auto Complete" visual studio Went though the Honorbuddy Api, and Pulled out all the Choices for you. now you can ether Type in the Class as it is there, or double click on the option you want.
so if i where doing a shaman, i would click on "Shaman", or type "Shaman" also if you start typing and the list gets down to one or two options, for example i start typing "Sha" if i press Space it will auto complete that code for me.

Congratulations you now have your project completely setup, and ready to start adding code.
Attachments
Last edited by a moderator: