My guides want more icons for turfs and mobs and such, and they don't want to have to wait for me to incorporate their icons into the code before they can use it.
I need to find a way to allow them to upload things and begin using them immediately, but I'm not sure how to handle this.
I know that prompt() will allow a player to upload an icon or file -- but this seems to get stored in the cache. I need these files to get stored in the file system, so they don't get wiped out if the cache is replaced, and so that the files can live on and be edited as necessary.
I'm also thinking about how to allow guides to create new kinds of mobs on the fly...for example, one just created a zone which is supposed to be filled with snakes, but we don't have snakes yet so he used dogs. I'd like to have a set of generic mobs like "/mob/animal", such that the guide could say he's creating an animal and it should have this icon. I would store all the info for this new kind of animal. I think there are two things I could use for that:
- ability to upload an icon that gets stored as a file on the server
- ability to list the known icons so the guide can select from them
Are either of these things possible?
I'm in the "no more new features for now" camp for Dantom, so if these aren't possible is there a way to do this that I haven't thought of?
ID:138657
Apr 2 2000, 3:17 pm
|
|
#2 Apr 2 2000, 5:13 pm
|
|
- ability to upload an icon that gets stored as a file on the server 1) It could be worth looking at the "DUNG Chat!" source, since custom icons for portals seem to endure between server upgrades... don't know for sure, though. 2) I thought the following code might be worth a try. Well, it doesn't produce an error, but it also doesn't produce a file! usr << "Creating fileTest.dmi!" "fileTest.dmi" << 'player.dmi' usr << "It should exist now." 3) I wonder if you could use file2text and text2file in conjunction with each other... my suspicion, however, is that when the source file is binary info, the final output would be a mangled, unusable version of the original. | |
On 4/2/00 6:13 pm Guy T. wrote:
2) I thought the following code might be worth a try. Well, it doesn't produce an error, but it also doesn't produce a file! You are close. The correct notation should be: file("fileTest.dmi") << 'player.dmi' However, I just tested this and it doesn't work right now. The text-equivalent: file("fileTest.txt") << "some text" does work, so I suspect a glitch when converting cache files. At any rate, there are other ways to copy a cache file. You can use a savefile to write the data, or you can use a regular file via fcopy(): fcopy('player.dmi',"fileTest.dmi") Hope that helps! | |
On 4/2/00 5:24 pm Deadron wrote:
I believe it was mentioned that images would work in the browser, but I'm having no luck so far, at least in my attempts to use an img HTML tag...not with .dmi, .bmp, or .gif. I get a "broken image" icon in the browser. Yes. Right now, you can't use the img() tag to do inline links, because the target images have to be in the client cache dir, which is where the web page is "run". I suppose it might be possible to rig some scheme up whereby these images get downloaded to the cache dir before you load your page, but it might be tricky (specifically, since the default cache names are randomly generated). I'll think about it a bit. Eventually we will figure out a way to automatically upload included images. On the other hand, single images can be displayed in the browser. Just do: usr << browse('image.jpg') // cache file usr << browse(file("image.jpg")) // file on the server Make sense? | |
#5 Apr 2 2000, 7:01 pm
|
|
On 4/2/00 4:17 pm Deadron wrote:
I think there are two things I could use for that: Sure! You can do this a number of ways. First, you'll want a basic function to upload icons: var/iconList[0] mob/verb/upload_icon(I as icon) iconList += I Now you have a list of icons that you can index and display to the player (in the stat panels or whatever). You can save these icons to individual files using fcopy() (see response to Guy T. below). But it might just be easier to save them in a directory structure in a savefile. Remember, savefiles can store any kind of data, including icons. In your world.New() you can just load the existing list, and periodicially (or whenever new icons are added) you can save it. Does this help? | |
Does this help? Yup! Sounds like exactly what I needed. Thanks! | |
Eventually we will figure out a way to automatically upload included images. However, if I understand the brand-new release notes correctly, you should now be able to write DM code to browse a given Web page. And on the Internet, BYOND seems to browse pages fine--images and all. Might be worth a look. | |
Anything to know about this?