ID:154274
 
I'm just wondering if there is way to reference HTML and PICS from your local hard drive instead of off the net with BYOND???

Like -> usr << browse("C:\\mybyond\index.html")

Because I pay for hosting on the site I'm at now and its eating up my monthly allocated Bandwidth. Also I'd like to make it so some pics and maybe html are only accessable from within the game, opposed to on the web where they can be shared.

LJR
Yes there is, but dont put the path as a drive, instead, include it with the project, and do this:
usr << browse(file('htmlfile.html'))


As for the pics, use browse_rsc() first. If the pic 'mypic.bmp' is in htmlfile.html, then do this:
usr << browse_rsc("mypic.bmp")
usr << browse(file('htmlfile.html'))


Hope i helped..

-Rcet
In response to Rcet
Sweet!!! Yes it does.. This will help cut down on my Bandwidth problem!!!!

LJR
In response to Rcet
Damn..
I take it *.gif or *.jpg won't work???
I got the html working but no pics will show they are all in jpg format. Why should this matter???

LJR
In response to LordJR
gifs and jpgs work fine, if they are included in the rsc file properly. Could you post the code you are using?
In response to Shadowdarke
should I just define these in the DME?
I'm just using the browse() proc.

LJR
In response to LordJR
LordJR wrote:
should I just define these in the DME?
I'm just using the browse() proc.

LJR

No, no, you need to browse_rsc() files needed, then browse() the HTML page that needs them.

I.e.:

usr << browse_rsc('background.jpg')
usr << browse("<body background=background.jpg>")
In response to Spuzzum
yeah thats what I meant.. Is there a way to just reference to a BMP or something? Instead of bring it up as a HTML page? This question is for the Local drive once again.

LJR
In response to LordJR
LordJR wrote:
yeah thats what I meant.. Is there a way to just reference to a BMP or something? Instead of bring it up as a HTML page? This question is for the Local drive once again.

Could you be a little more specific? I'm not sure I understand.

[edit] I still don't understand. =)
In response to Spuzzum

usr << browse_rsc('background.jpg')
usr << browse("<body background=background.jpg>")

Ah.. maybe never mind?? You just reference to the pic as a body background... Hmmm interesting...

LJR