ID:138274
 
I discovered it's quite possible to create runtime-generated pictures in the browser... all it takes is a few GIFs, and a routine that scans the map and draws it out as graphical. An example would be like SpaceTug's textmap, but with pictures instead of monospace characters.

But then I ran into a problem. Sure, having "scans" of a ship in the browse window is great. But how would I have a ship that could be visible in the map window?

Initially, I was thinking about having ships in Warrior hand-drawn (and self-drawn) only. The reason for which being that it is impossible to convert up to 16000 pixels of a huge, multi-tile, user-created spaceship to a single pixel per tile's worth. I thought to myself, "Maybe there would be a way to create bitmaps of things dynamically". I found a thing called cgi-draw for UNIX severs.

It looks promising, but I can't test it out on my stupid little Windows box. Not only that, but I'm completely unsure as to how I could provide data to the program, either C-compiled or as CGI.

What I was wondering was how, or if, it would be possible to send data from BYOND (I'm figuring a textmap would work), and then it would generate a .bmp that I could then manipulate and create a full-fledged ship, that could be rotated and formed into a .dmi.

This is obviously a VERY difficult prospect, however, without it, it is highly unlikely that I'll have any way of pictorially representing player-created vessels on the map. The browse window method of using GIFs in unison to create a map works for targetting and other ship-based stuff, but it fails miserably when it comes to letting players visually see combat between starships; laser beams and torpedoes can't fly through the browse window unless I decide to cough up some $250 for Flash...

Flash does seem like a viable option. But I haven't learned it, and I'd still have to find a way to stick images of ships from BYOND and turn them into bitmap images for Flash.

Yikes. Any thoughts?
Yikes. Any thoughts?

If I remember right, the new support for "big icons" derived from BMP's allows you to generate them dynamically in the game, not just on the map editor. You just assign the bmp like so:

mob/spaceship_component
icon = 'customShip.bmp'

...and then you can loop through all the icons in the ship, setting icon_state to be whatever segment of the ship you're currently looking at. I think "(0, 0)" is the lower left corner. I haven't played with the dynamic big-icon creation yet, but it sounds like just what you need. You'd just have the player specify the dimensions of the bmp, and you could calculate the ship size accordingly. (Also, the player/artists would need to know that the transparent color is 192, 192, 192.)

Of course, you'd also have to dust off the ol' multi-tile mob code!
In response to Guy T.
...and then you can loop through all the icons in the ship, setting icon_state to be whatever segment of the ship you're currently looking at. I think "(0, 0)" is the lower left corner. I haven't played with the dynamic big-icon creation yet, but it sounds like just what you need. You'd just have the player specify the dimensions of the bmp, and you could calculate the ship size accordingly. (Also, the player/artists would need to know that the transparent color is 192, 192, 192.)

I thought it was 152,152,152... anyways, that's nice, but what I mean is I need to find a way to get .bmps from .dmps. Players draw tiles onto the map and then it converts it to a textmap and, I'm predicting, exports it to an external program of my own devising.

I'm reading up on the .bmp file format so I'll be able to write C++ programs that generate them. Hey, it's about time I use that. =)

So IMHO, this is possible after a day or so of research plus about 4 or 5 to get Visual C++ to try to understand C++.


Of course, you'd also have to dust off the ol' multi-tile mob code!

Holy shoot! I was just looking at multi-tile mobs earlier this morning without having even read this post.

Well... great minds think alike, no doubt. =)