Would a someone with experience with writing an OBSE plugin

Post » Wed Sep 01, 2010 3:09 pm

I'm using the EnhancedMusicandControl plugin. There are a few things I want to add / change, but HawleyFox is not developing it any longer. He put the source code up and has said anyone can continue it's developement. It's something I'd like to look into, but I have a few stumbling blocks.

To wit:
First and foremost, while I have some background in programming language, my knowledge is ancient history. Think of Fortran and Basic. Not Visual Basic, the original DOS version. (What? You don't know what DOS stands for? Damn, I'm old and you're young...) and you'll know what I mean by ancient.

So I'm going to have to try an learn whatever language it's written in (I think It's C++). Is there a free version available?
How does one create a dll? Is there something available for free?
And last, is there a good C++ Wki?

Thanks!
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Wed Sep 01, 2010 9:13 pm

The original DOS version? Original DOS version? That's no original, that's some johnny-come-lately new-fangled BASIC! Er... I think it is anyway.

Anyway, I've never looked at EnhancedMusicandControl, but likely it's based upon the example OBSE plugin.

Generally you start by downloading Microsofts Visual C++ Express Edition. Or Visual Studios Express Edition (the same thing, but potentially with more languages than C++). The "Express Editions" are free, and mostly the same as the versions that cost money unless you want to compile 64 bit code (which you don't) or you want to use some really annoying features (which I hope you don't).
There are alternatives like gcc/MinGW, but you probably don't use those because all of the OBSE & OBSE plugins stuff has Microsoft project files... in theory it is possible to write OBSE plugins using gcc/MinGW, but it might be more work to figure out the build process.

Anyway, then you should probably load his project file using MSVC. Try double-clicking on the .sln or .vcproj file. Try to confirm that it's building correctly and everything. IIRC the example OBSE plugin may like to do things like copy the resulting dll directly in to your OBSE plugin folder if it can find it, using some sort of environment variable to figure out where Oblivion is. I don't have that environment variable set up, so I always copy the dll over manually from the Release (or Debug) directory to the obse plugins directory.

Typically over on the left of your screen once it's loaded up will solution explorer tab, which will show you what files are included, and you can double-click on a .h or .cpp file to open them up to edit it. They're likely in C++ - OBSE and Oblivion are in C++, and while it's technically possible to write a plugin in other languages (Elys wrote some in some variant of pascal IIRC) it's probably easiest to match languages with them.

Teaching C++ is beyond the scope of this post... say that it's broadly similar to BASIC, but many functions are associated with data structures, and C++ has more complex syntactic sugars available. And it lets you deal with pointers, which most BASIC variants (including QB, which is what I think you were refering to) don't support much. And... well... I could go on, but it wouldn't help much.
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Wed Sep 01, 2010 6:48 pm

Do you know any object oriented (O-O) languages at all? C++ is O-O and when I've worked with old school programmers :), some of them have a really hard time making the switch. I don't know how much of the O-O structures OBSE uses anyway, but you will need to do a bit of a read-up on O-O to find your way around. Here's a http://en.wikipedia.org/wiki/C%2B%2B page that gives an intro. I think you'll find other stuff in there. Even better -http://en.wikibooks.org/wiki/C%2B%2B_Programming
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Wed Sep 01, 2010 1:37 pm

I'm using the EnhancedMusicandControl plugin. There are a few things I want to add / change, but HawleyFox is not developing it any longer. He put the source code up and has said anyone can continue it's developement. It's something I'd like to look into, but I have a few stumbling blocks.

To wit:
First and foremost, while I have some background in programming language, my knowledge is ancient history. Think of Fortran and Basic. Not Visual Basic, the original DOS version. (What? You don't know what DOS stands for? Damn, I'm old and you're young...) and you'll know what I mean by ancient.

So I'm going to have to try an learn whatever language it's written in (I think It's C++). Is there a free version available?
How does one create a dll? Is there something available for free?
And last, is there a good C++ Wki?

Thanks!

If all you want to do is make small changes in your own private copy of the music plugin, you can probably just grab a copy of http://www.microsoft.com/express/Downloads/#2010-Visual-CPP and get started. You might want to contact HawleyFox and ask if there are any system settings or outside dependencies that you need, but at the end of the day if it compiles then you're probably doing everything right.

If you're going to be making more than superficial changes, you should be aware that obse plugins are not the best way to learn C++. They tend involve a lot of arcane and/or compiler-specific tricks that can be confusing. It might be better to get familiar with object oriented programming and C++ in another context (the web is full of http://www.cplusplus.com/doc/tutorial/), and then come back to this once you feel comfortable. I'd also recommend making a small plugin of your own, using the obse example as a template, so you can get a feel for what is involved.

To answer your question about making dlls, most compilers (including MSVC++) allow code to be compiled into a dll instead of an exe. It's just a different format for storing the final machine code. The plugin project should have that (and a bunch of other options) already configured, so you won't need to worry about it.
User avatar
..xX Vin Xx..
 
Posts: 3531
Joined: Sun Jun 18, 2006 6:33 pm

Post » Wed Sep 01, 2010 7:43 pm

  • http://www.microsoft.com/downloads/en/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
  • http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en
  • http://msdn.microsoft.com/en-us/library/ms235626%28VS.80%29.aspx (Note that these instructions are somewhat out-dated - IIRC, Step 3 is unnecessary as the line already matches what they suggest. Otherwise this works fine)
  • Open EMC by double-clicking the .sln file (or, apparently, the .vcproj file?)
  • Program
  • Compile by right-clicking on the Project in the Solution Explorer pane on the right, and selecting Build. Or press F7.
  • If you have a Environment Variable called Oblivion_Path set up pointing to your install directory, the .DLL will be automatically copied to the correct folder (assuming HawkleyFox didn't disable that, which he might have if he didn't have the variable set up). If not, the Build will claim failure (since it couldn't do the copy bit) - you need to either set up the variable (and restart your computer, at least in my experience), or else disable this by right-clicking the project, choosing Properties, going to Custom Build Events, Post-Build Events, and clearing the command.


I think that's everything.
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Wed Sep 01, 2010 9:32 am

O-O languages...
To quote a famous toon "What? Me worry?"
Well the only way to find out is to dive in.
Thanks for the links and thanks again for the help.
User avatar
Antonio Gigliotta
 
Posts: 3439
Joined: Fri Jul 06, 2007 1:39 pm

Post » Wed Sep 01, 2010 1:45 pm

If you're having trouble, send me a pm and I might be able to help. I'm an "old school" programmer that made the switch to o-o 20 yrs ago :) I've also worked with other programmers and helped them make the transition.

But I'm younger than you are - by a few years :D
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am


Return to IV - Oblivion