1. Vilsol

    Vilsol Wood Hoarder Plugin Developer

    This is a simple guide on how you can setup your workspace, so you could lookup all APIs and use proper code-completion in the Visual Studio IDE.
    1. Download Visual Studio 2015 Express Here: https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409
    2. Install it with the default options
    3. Once you have loaded up the IDE, go in File -> New -> Project, select Templates -> Visual C#, select "Class Library", enter your plugin name, for example, "TestPlugin", and press OK
    4. Then on the right side, open "Solution Explorer", expand the References section, select all but "Analyzers", then rightclick and remove.
    5. Rightclick on References, press add, press Browse and go to your rust server directory, for example, "E:\Rust\rustds\RustDedicated_Data\Managed", and select all of the .dll files except for "mscorlib.dll", "System.Core.dll" and "System.Data.dll".
    Done, you can now enjoy proper syntax highlighting and code-completion, now get cracking.
     
    Last edited: Sep 29, 2015
    NOP and SwipoStyle like this.
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Or you could clone the Oxide repo, and plop your .cs plugin into the plugins folder under the game extension you wish to develop for. ;)
     
  3. Norn

    Norn Master Researcher Plugin Developer

    And with notepad++?
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    If you wanted to, but that won't give you nearly the same benefits. I use it for basic edits sometimes.
     
  5. Koolio

    Koolio Naked Wanderer

    I tried this method first.. however I got no working intellisense/code complete suggestions.

    Vilsol method worked fine and I get working intellisense which really helps
     
  6. dofof37

    dofof37 Wood Hoarder

    i cant import references and couldnt find anything in references to delete
     
    Last edited: Nov 2, 2015
  7. Eis3nheim

    Eis3nheim Naked Wanderer

    for those who use mac, try visual studio code.
     
  8. Kappasaurus

    Kappasaurus Master Researcher Plugin Developer

    There isn't a System.Core.dll anymore from what I can tell.
    I'm also getting this
    Code (Text):
    Error    CS0012    The type 'MonoBehaviour' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.    RespawnMessages    c:\users\dellpc\documents\visual studio 2015\Projects\RespawnMessages\RespawnMessages\Class1.cs  
    I'm assuming it is because there is a .dll missing, but I installed them all with the exclusion of the ones you pointed out.
     
    Last edited: Jul 5, 2016
  9. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    That's from UnityEngine.dll.
     
  10. KaiausderKiste

    KaiausderKiste Naked Wanderer

    Is there somewhere an official guide for this?

    Iike one that is updated to a somewhat recent state and that contains all the current fetures. The api documentation doesn't even provide information on mysql support. But that would not be a big deal if there was a guide on how to set up the references.
     
  11. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    There are some examples of the extensions under the Extensions link at the top. If you'd like an example project, see GitHub - lukespragg/oxide-plugins: Various plugins I've made for the Oxide modding API..
     
  12. KaiausderKiste

    KaiausderKiste Naked Wanderer

    Doesn't that miss at least the csproj stuff and the librarys?

    The last time i worked with c# was about 1 year ago and i only did it for about 1 year.
     
  13. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    No, they're all in my example project, I use it daily. It's just setup for more than just Rust, I have it for every game.
     
  14. KaiausderKiste

    KaiausderKiste Naked Wanderer

    Where should they be located? I still can't find them and visual studio also doesn't.
     
  15. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    My example has a solution file, which you simply open. You'd still need to change the references to valid paths, mine are set to where my dependencies are. If you aren't familiar with Visual Studio, I'd recommend looking at some tutorials for how to add references with it, there should be quite a few general ones for it.
     
  16. KaiausderKiste

    KaiausderKiste Naked Wanderer

    Sio i assume there is a copyright problem to this?

    Right now im searching for the files in my server directory but i would have aprreciated a package containing them...
     
  17. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Most of the DLLs you need generally come in each Oxide build, but you can add additional ones from your server's install if needed. One setup does not fit all, so I'd recommend getting familiar with Visual Studio and your server installation.
     
  18. xass

    xass Naked Wanderer

    Any idea how i get it working properly with auto suggestions and so on?
     
  19. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Visual Studio Code does not have IntelliSense that I am aware of, only the full Visual Studio would.
     
  20. xass

    xass Naked Wanderer

    It does.