May 25, 2013, 06:51:48 AM
Pre-Releases are now available at the PreRelease section.
If any issues occur please post exceptions or information as to how to reproduce in the correct section.

Author Topic: How to create a plugin?  (Read 329 times)

0 Members and 1 Guest are viewing this topic.

ThatBenderGuy

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to create a plugin?
« on: April 10, 2012, 05:31:45 PM »
I know C# and I have the source code but I can't find any decent tutorials on how to create a plugin. I know eventually I'll have to compile it to a library file (dll) but I have no idea where to get started >.< any ideas?

DeathCradle

  • Founder/Developer.
  • Sr. Member
  • ******
  • Posts: 446
  • Karma: +42/-1
    • View Profile
Re: How to create a plugin?
« Reply #1 on: April 10, 2012, 05:53:08 PM »
There is an example on the Git repo. It should show you how to register events and what inherited methods there are for you to use.
On our wiki there is another example link on the home page and I also have noticed a few youtube tutorials, however they were for the old API...if only someone did youtube tutorials for the new one... ::)

ThatBenderGuy

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to create a plugin?
« Reply #2 on: April 10, 2012, 06:25:57 PM »
There is an example on the Git repo. It should show you how to register events and what inherited methods there are for you to use.
On our wiki there is another example link on the home page and I also have noticed a few youtube tutorials, however they were for the old API...if only someone did youtube tutorials for the new one... ::)

Well when I eventually learn I could create some youtube tutorials xD btw is it normal for it to have many errors when I open it up in Microsoft Visual C#? I get this error
Quote from: Microsoft Visual C#
Warning   1   The referenced component 'Terraria_Server' could not be found.    

Quote from: Microsoft Visual C#
Error   2   The type or namespace name 'Terraria_Server' could not be found (are you missing a using directive or an assembly reference?)   C:\Users\Jake\Desktop\DeathCradle-Terraria-s-Dedicated-Server-Mod-8599168\TDSMPlugin\TDSMPlugin\TDSM_Plugin.cs   3   7   TDSMPlugin
« Last Edit: April 10, 2012, 06:28:03 PM by ThatBenderGuy »

D1G1T4L3CH0

  • TDSM Team Member
  • Hero Member
  • *****
  • Posts: 518
  • Karma: +22/-2
  • Tester / Moderator
    • View Profile
    • Personal Website
Re: How to create a plugin?
« Reply #3 on: April 10, 2012, 06:42:17 PM »
Those errors are because Terraria_Server.exe's reference in the project is incorrect. You need to change the reference to it in the project. Look here for more info.
Server Machine: Xubuntu 11.10 Xfce Mono 2.10.5
Thanks to all those who work on TDSM. It's a great alternative to the official one. And thanks to the plugin devs too for making it even better.

ThatBenderGuy

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to create a plugin?
« Reply #4 on: April 10, 2012, 08:41:53 PM »
Those errors are because Terraria_Server.exe's reference in the project is incorrect. You need to change the reference to it in the project. Look here for more info.

Ok I click "Add Reference" and choose "Terraria_Server.exe" and it didn't take away the errors.

EDIT:
Fixed it. All I had to do was delete the original reference then re import the terraria_server.exe and then the errors went away.

I looked at the example and I have absolutely no idea what's going on -_-

my main concerns are with
A) The "AddCommand" bit. How do I make it accept a number?
B) is the ".Calls" what performs the action?
C) What are all the Access levels? like AccessLevel.PLAYER?
« Last Edit: April 11, 2012, 12:50:40 AM by ThatBenderGuy »

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal