Author Topic: Op2graphics  (Read 2934 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4751
Op2graphics
« on: April 21, 2005, 07:58:40 PM »
Here is a graphics viewer written in VB. It has nowhere near the capabilities of Cynex's art viewer but it does demonstrate how to load both the tile set graphics and the images from OP2_ART.BMP/PRT. You can't save/extract/replace or anything really. Just view the graphics. But if you're a coder, you might be able to make use of the code for whatever it is you're doing, or write your own based on it. Keep in mind that Cynex's art viewer has a DLL with exported functions so you might want to ask him about using his library to do stuff as well.


Anyways, I've included the complete source, and a compiled exe so you won't need VB to run it. Anyone who is curious is welcome to take a look. There may be a few oddities since I don't understand all of the data, plus there were certain things I didn't really finish, (or just used some really simple code to load data instead of being fully general). Anyways, I'm largely happy with it in it's current form, so here it is.


 
« Last Edit: July 18, 2008, 01:14:37 PM by Hooman »

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 263
Re: Op2graphics
« Reply #1 on: November 29, 2015, 10:26:12 AM »
Per Hooman request I will try my hand at updating this post.

So I downloaded this package, as I am running a new system without VB6 or any of its dependencies (I'm running VS2015 but it does not, for what I am sure are obvious reasons come with any of those files) so off to the internet to find them.

NOTE: I am running Windows 7 64 bit install.

Run the Graphics Viewer and it looks for three things

 - op2_art.bmp This is in the OP2 Game Folder
 - op2_art.prt This is in the maps.vol file in the OP2 Game folder, so if you are putting the Graphics viewer in a seperate folder you will have to extract this.
 - mscomct2.ocx This is the Microsoft Common Tools VB6 Dependency file that makes you work at getting the Graphics viewer up and running.

Where to get it : http://www.ocxdump.com/download-ocx-files_new.php/ocxfiles/M/MSCOMCT2.OCX/6.00.88046/download.html ( 2015-11-29 )

Here's how to register : https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=register+mscomct2.ocx+  ( 2015-11-29 )

The Updated VB6 files from Microsoft : https://www.microsoft.com/en-us/download/details.aspx?id=10019 ( 2015-11-29 )

Anyways, on to the placement and registering.

Take your new mscomct2.ocx file (its ten years old or more but new to you so just go with it) and if running a 64 bit Windows 7 install place it in "c:\windows\sysWOW64", if running 32bit than "c:\windows\system32"

Next comes registering the dependency in the windows registry system, you get to do this manually buts its fairly straight forward.

Go to Start, and in the search bar type in cmd but do not press enter. Instead, once its typed in go up to the cmd program it found, right click on it and then left click on Run As Administrator. If you were  to hit enter or just run normally this won't work.

Once the dos window comes up type in "regsvr32 c:\windows\sysWOW64\mscomct2.ocx." and hit enter. If using a 32 bit windows type "regsvr32 mscomct2.ocx."

Boom done.

Cue Applause.
« Last Edit: November 29, 2015, 12:05:16 PM by dave_erald »
-David R.V.

-GMT400 fan
-OPU Influencer

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 263
Re: Op2graphics
« Reply #2 on: December 21, 2015, 12:24:51 AM »
If anyone is looking for the missing dependency files and wants a easy place to find them, they can be located in the mapper runtime files download off the OPU Home page.

Outpost 2 Mapper runtime files Download Page
-David R.V.

-GMT400 fan
-OPU Influencer

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2183
    • LairWorks Entertainment
Re: Op2graphics
« Reply #3 on: January 20, 2016, 07:19:17 AM »
I kinda skimmed this post several weeks ago but didn't realize there was source. Not that I always need source code to get something going but I've been having some trouble getting frames and such extracted from the game so I may use this as a reference guide a build a new graphics viewer/extractor/whatever with a modern language -- maybe VB.Net (definitely an improvement over the older versions of VB) or perhaps some command line tools or something. I dunno.

Thoughts? Would anybody be interested in such a tool/utility?

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4751
Re: Op2graphics
« Reply #4 on: January 20, 2016, 08:25:15 AM »
Yes. I would like to see some reusable library code in a modern language.

The use of an antiquated version of VB is a bit unfortunate. I'm not sure if VB.net is the choice I'd make. The project is small enough to do a complete rewrite in any language, so it doesn't really need to be ported to a newer version of the same language. Actually, I'm not really sure what the point of using VB.net is, considering C# also compiles to the same intermediate code. There are way more users of C#, so there's more community development of the language, and more chance of other people using or contributing to the code.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2183
    • LairWorks Entertainment
Re: Op2graphics
« Reply #5 on: January 20, 2016, 08:32:18 AM »
Well, VB.Net does derive from VB but as I remember it's way, way better. I use it strictly to rapidly develop GUI applications. I rarely build native GUI app's so lately I haven't really used it.

I haven't looked at C# much... I know it's a useful language (or so says many people) but I've never used it... I imagine making the jump from C++ to C# shouldn't be difficult especially having used VB.Net for years.

I could also just do a C++ version -- I skimmed through the code real quick and it doesn't look particularly complicated. There are a couple of hacky parts but meh, look at OutpostHD's code... not exactly a shining example of perfect construction.

Anyway... I may take it up. I have a week off starting next week so I'll have plenty of time to laze around and do whatever I want.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4751
Re: Op2graphics
« Reply #6 on: January 20, 2016, 11:14:16 AM »
A small project might be a good way to learn a new language. Or if you just want to get something done, then by all means stick with something you know. I think I used VB precisely because it had a user interface. A simple user interface.

I sometimes find myself looking for an excuse to use D.

Or you can skip the whole language/compiler question and just program it straight in machine code.  ;)
E8 CA2A0000 85C0 75 0A ...

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2183
    • LairWorks Entertainment
Re: Op2graphics
« Reply #7 on: January 20, 2016, 10:27:57 PM »
I think I'll skip the machine code... I understand how it works but my brain is overloaded with too much processing of... well... everything. I'll stick to higher level languages.

I fired up Visual Studio and tried my hand at a simple Windows Forms C# app... holy crap. It's wildly different. I mean it's not but it is. In VB forms applications are dead ass simple to build. C# requires me to learn an actual API to do anything useful -- behind the scenes code is fine.

So I'll probably start with a modern VB version of it and then port the underlying loading/handling code to C++ (because I know it). Might take a day to do it and see what comes of it.