|
||
|
|||||||
| Ultima SDK Support for the Ultima SDK. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Hi, well... I have searched these forums thoroughly, and have checked out anything regarding MyRunUO. I have been unable to find any posts with any ideas on how to generate a hued paperdoll in PHP.
Any sites I have found in PHP who have a paperdoll generator, have been reluctant to release their code for it. ![]() The closest I got to creating a paperdoll generator in PHP was writing code to read the hues.mul and get the 32bit RGB colors. I took a shot at reading the gumps, but had no success, it was a bit too complicated - seeing as how they had variable length, I just couldn't seem to get the correct properties from the IDX and get it from the MUL. This whole problem is because my webserver is Linux-based, and therefore I cannot use ASP - let alone ASP.NET - pages on it. As I cannot use ASP, I cannot use the ultima.dll, since PHP cannot load it. So I am here to ask if anyone has a paperdoll generator for PHP, and would like to release the code for it. I would greatly appreciate it, thanks for your time. |
|
|
|
|
|
|
#3 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
|
|
|
|
|
|
|
#4 (permalink) |
|
If it were in C/C++, it'd have to be a linux executable which I could pass parameters to, and it would create the images I require.
As of now, I'm just linking off-site to riven.ru's paperdoll gump generator. But the problem with this is that they only have their own hues, not mine. So the site generates hundreds of black gumps, as they do not have the same hues. It has also come to my attention that you can load DLLs in Java. Anyone have insight to this? |
|
|
|
|
|
|
#5 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
So I am confused. |
|
|
|
|
|
|
#7 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
Even then, he would have to write a program to use the dll. The issue isnt having available libraires to read the gumps on linux, there are. What isn't clear, is he expecting to have to write a wrapper program to translate it tosome image format, or is he expecting to do that in php ? It sitll isn't clear he he plans on manipulating the mul files from php. |
|
|
|
|
|
|
#9 (permalink) | |
|
Forum Expert
|
Quote:
__________________
----------------------- If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post. I am refering to specific individuals. You know who you are. |
|
|
|
|
|
|
#10 (permalink) | |
|
I R TEH POSTING!!1!eleven
Join Date: Jan 2004
Posts: 1,617
|
The only system-dependent stuff it uses is in ProcessStream, and it's not even all that much.
__________________
Get your C# documentation today! Quote:
abralka@doramail.com |
|
|
|
|
|
|
#11 (permalink) |
|
Forum Novice
Join Date: Feb 2003
Posts: 171
|
Do what OSI does.. A paperdoll background image and html layers for all item layers. You can download all images of all items from OSI's my.uo.com pages...
(Or maybe just create a script which connects to OSI's website, downloads an image and cache it to your website. So u can use it from your webspace in future if needed again..) |
|
|
|
|
|
#12 (permalink) |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Ultima.dll doesn't use DirectX. Also Krrios released the source for Ultima.dll so you could ultimately recode the parts on your Linux machine. As far as Ultima.dll on Mono, Ultima uses the _lread function which is a native windows API and therefore incompatible with Mono. I remeber that Ultima.dll uses _lread for the tile matrix, and if it uses it for gumps/hues as well you're out of luck. It might be worth a try though.
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
#13 (permalink) | ||
|
I R TEH POSTING!!1!eleven
Join Date: Jan 2004
Posts: 1,617
|
Quote:
__________________
Get your C# documentation today! Quote:
abralka@doramail.com |
||
|
|
|
|
|
#14 (permalink) | |
|
Forum Expert
|
Quote:
Code:
namespace Ultima
{
public class TileMatrixPatch
{
private int m_LandBlocks, m_StaticBlocks;
[System.Runtime.InteropServices.DllImport( "Kernel32" )]
private unsafe static extern int _lread( IntPtr hFile, void *lpBuffer, int wBytes );
There are actually quite a few windows specific API calls being made in ultima.dll. Most of them are for dealing with the client however, and could probably easily be stripped form the source code. Art and Gump Code doesn't seem to contain anythign windows specific, so that stuff should eb fine in MONO.
__________________
----------------------- If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post. I am refering to specific individuals. You know who you are. |
|
|
|
|
|
|
#15 (permalink) |
|
Forum Newbie
Join Date: Jul 2004
Posts: 59
|
Why must one cling to the Ultima.DLL even when it adds unnecessary complications? Punt's library has a similiar interface and would be much better in this situation. All you need is his valley library and a library such as libjpeg/libpng (there are many more) to convert the parsed mul data to an image format. E.g. http://www.libpng.org You could then execute the binary from the php code to create the image (communicating by passing arguments to the executable). The native binary would be much more efficient/stable than what you can piece together with the DLL and the overhead of Mono. Even if you do decide to use the Ultima.DLL I think this is the only way you can approach it.
If this doesn't suit your needs, you could even create a php wrapper for the extraction of gump data with his library and use the php image functions to create/output the image, as php already has interfaces for the necessary image libraries - http://ie.php.net/gd . This technique would be more efficient in my opinion and I doubt you could do this with the DLL without adding yet another layer of code on top of mono to interface with the module components of php. http://www.zend.com/apidoc/zend.creating.php documents how to make a module in php. All this is well and good if you are trying to avoid messing with the mul files yourself, but both techniques require more than is needed than to actually just learn how to parse the gump mul file in the first place with php, which would be the best option. So just dig up the mul documentation, look at a few source examples from different libraries and get coding it in php ![]() Of course the easiest option as I see it for your situation is just to load the parsed image data into a large database and extract as necessary as many times as you like. This would remove the overhead of converting mul format to image format (since its only done once and then stored.) The database size would probably be comparable to the mul size anyway, so you aren't actually using up any more space. With php's database and image extensions, it should be a doddle then to load an image and apply a hue. They are my suggestions. Sorry for being so verbose, I do tend to get carried away. Anyway, good luck if you plan to give it a go and let us know what you come up with. |
|
|
|
|
|
#16 (permalink) | |
|
Forum Expert
|
Quote:
__________________
----------------------- If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post. I am refering to specific individuals. You know who you are. |
|
|
|
|
|
|
#17 (permalink) | |
|
Forum Newbie
Join Date: Jul 2004
Posts: 59
|
Quote:
![]() |
|
|
|
|
|
|
#18 (permalink) | ||
|
I R TEH POSTING!!1!eleven
Join Date: Jan 2004
Posts: 1,617
|
Quote:
__________________
Get your C# documentation today! Quote:
abralka@doramail.com |
||
|
|
|
|
|
#19 (permalink) | |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Quote:
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
|
#20 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
Ok, perhaps I should have said windows. But art returns things in a Bitmap class, and this isn't C++. That is windows is it not? (showing my ignorance of windows here). I suppose it could have been converted, but my read of mono as them avoiding any windows display stuff. |
|
|
|
|
|
|
#21 (permalink) | |
|
Forum Expert
|
Quote:
__________________
----------------------- If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post. I am refering to specific individuals. You know who you are. |
|
|
|
|
|
|
#22 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
Ok, now I am totally confused. The original problem stated, was accessing the data from php, on a linux server. So NET in this case, is really a foriegn entity, thus I am now very confused on unnecessarly complications, performance, etc, as this seems to just add to it on linux. But what I am still no clear on, is the basic desire to build the images from the mul files in php? Access them from a database (I saw that posted, so then not sure what the dll has to do with anything), or interface to a C/C++ cgi that uses some library (ultima, etc) to return a png (or whatever format) image? |
|
|
|
|
|
|
#23 (permalink) |
|
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
|
Ultima.dll has all the functions needed to manipulate the objects stored in mul files, converting them to objects that can be easily manipulated (such as bitmaps). Now he would like to use it on a Linux machine, probably because he's familiar with .NET. Someone suggested using a database to store the images, I personally think it's a waste of database space as you can efficiently access the mul files (either using Ultima.dll on a Windows system or on Linux with Mono - except the cases stated before). In ASP.NET this would be very easy to do, he probably wants to do something similar using PHP because it's Linux...
__________________
Oxygen should be regarded as a drug. |
|
|
|
|
|
#24 (permalink) |
|
Forum Expert
|
I'm not sure how well the database solution would work. The orriginal request also stated that the images need to have hues aplied to them. I guess that could be done on the fly also, but if you are going to go through the trouble of that, why not just read the mul file?
__________________
----------------------- If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post. I am refering to specific individuals. You know who you are. |
|
|
|
|
|
#25 (permalink) | |
|
Forum Newbie
Join Date: Nov 2002
Posts: 89
|
Quote:
Ok, so can someone tell me, what is the Bitmap class a part of ? Is it not part of the windows api for display? I didn't peruse most of the ultima source, as it wasn't of much use for me. Is Bitmap one of the class that are part of the dll, and not part of the windows display system? I have read the mono objectives pretty closely, they seem to have commited to gtk+ for their display system. So can one tell me where they believe mono has picked that up? As for database, it is large. http://games.gimbo.org/~punt/sform.php is an example of the art work being in a database (the actua png images are stored as blobs). After that, it is all php. But that seems pretty wasteful, I would agree. Hueing to me would be about a wash, but I suppose that depends on if doing in C or php. The other option, which would work, is just do the entire thing in php. |
|
|
|
|