ID:179130
 
I have a rules.html file that I just added pictures to (in .jpg format), but none of the pictures show up in the dreamseeker browser! I tried inserting a .png image as well, and that didn't work either. Is there something else I need to do, or does dreamseeker's browser just not support pictures at all?
Before using the browse() proc, use the browse_rsc() proc. say if one of your pics was bleh.jpg, you would do
browse_rsc('bleh.jpg')
browse('rules.html')


just do browse_rsc for all your pictures.. or you could try making a list.. like

var/list/pics = list()
pics += '1.jpg'
pics += '2.jpg'
browse_rsc(pics)
browse('rules.html')

Not sure if that would work, just a theory..

hope i helped

-Rcet
In response to Rcet (#1)
Rcet wrote:
var/list/pics = list()
pics += '1.jpg'
pics += '2.jpg'
browse_rsc(pics)
browse('rules.html')

Not sure if that would work, just a theory..

I'm almost certain that won't work. However, keeping pics in a list might not be such a bad idea; you could just as easily loop through them and call browse_rsc() for each one. Bear in mind that you have to use the << operator for both browse() and browse_rsc() for it to appear to a user, too.

Lummox JR
In response to Lummox JR (#2)
Lummox JR wrote:
Rcet wrote:
var/list/pics = list()
> pics += '1.jpg'
> pics += '2.jpg'
> browse_rsc(pics)
> browse('rules.html')

Not sure if that would work, just a theory..

I'm almost certain that won't work. However, keeping pics in a list might not be such a bad idea; you could just as easily loop through them and call browse_rsc() for each one. Bear in mind that you have to use the << operator for both browse() and browse_rsc() for it to appear to a user, too.

Lummox JR

do i need to output the browse_rsc() commands to each user individually? If so, do I need to do it EVERY time they ask for the rules pop-up, or just once per user?

Thanks!
In response to Dramstud (#3)
dramstud wrote:
do i need to output the browse_rsc() commands to each user individually? If so, do I need to do it EVERY time they ask for the rules pop-up, or just once per user?

Once a file is in the cache, it's in; so unless you plan to change it, you needn't send it again. You should also be able to output to a list of users, just like with ordinary text. (The one "gotcha" here is that you either need to keep track of which files each user was sent with browse_rsc(), or just use it every time. If you send files to every player in the world, for example, you'll still need to send them to any new player who logs on.

Of course one attractive alternative is to call browse_rsc() within mob/Login() or client/New() and get all such files out of the way--or at least the common ones.

Lummox JR
In response to Lummox JR (#4)


Lummox JR wrote:
dramstud wrote:
do i need to output the browse_rsc() commands to each user individually? If so, do I need to do it EVERY time they ask for the rules pop-up, or just once per user?

Once a file is in the cache, it's in; so unless you plan to change it, you needn't send it again. You should also be able to output to a list of users, just like with ordinary text. (The one "gotcha" here is that you either need to keep track of which files each user was sent with browse_rsc(), or just use it every time. If you send files to every player in the world, for example, you'll still need to send them to any new player who logs on.

Of course one attractive alternative is to call browse_rsc() within mob/Login() or client/New() and get all such files out of the way--or at least the common ones.

Lummox JR

this seems to work pretty well. when the host logs in, in addition to getting host verbs the rules_pics list will be created with all the .jpg files i need, then for every user's login() i loop on rules_pics and usr << browse_rsc


One more related question:
Since these .jpg files are only referenced inside a proc which is called at runtime (build_rules_pics), will they be automatically included in the game rsc file (i'm not using file(), just rules_pics += 'name'), or do I need to specifically include them in the zip when I package the files?

Thanks!
In response to Dramstud (#5)
dramstud wrote:
Lummox JR wrote:
dramstud wrote:
do i need to output the browse_rsc() commands to each user individually? If so, do I need to do it EVERY time they ask for the rules pop-up, or just once per user?

Once a file is in the cache, it's in; so unless you plan to change it, you needn't send it again. You should also be able to output to a list of users, just like with ordinary text. (The one "gotcha" here is that you either need to keep track of which files each user was sent with browse_rsc(), or just use it every time. If you send files to every player in the world, for example, you'll still need to send them to any new player who logs on.

Of course one attractive alternative is to call browse_rsc() within mob/Login() or client/New() and get all such files out of the way--or at least the common ones.

Lummox JR

this seems to work pretty well. when the host logs in, in addition to getting host verbs the rules_pics list will be created with all the .jpg files i need, then for every user's login() i loop on rules_pics and usr << browse_rsc


One more related question:
Since these .jpg files are only referenced inside a proc which is called at runtime (build_rules_pics), will they be automatically included in the game rsc file (i'm not using file(), just rules_pics += 'name'), or do I need to specifically include them in the zip when I package the files?

Thanks!


nevermind... it just occured to me I could check this by commenting out a bunch of the pic lines and seeing if the game rsc file size changed.
In response to Dramstud (#5)
dramstud wrote:
One more related question:
Since these .jpg files are only referenced inside a proc which is called at runtime (build_rules_pics), will they be automatically included in the game rsc file (i'm not using file(), just rules_pics += 'name'), or do I need to specifically include them in the zip when I package the files?

I believe any file specified in single quotes in your source is included automatically in the packaging. You can, however, open the .zip file in WinZip to check.

Lummox JR
In response to Lummox JR (#7)
Lummox JR wrote:
dramstud wrote:
One more related question:
Since these .jpg files are only referenced inside a proc which is called at runtime (build_rules_pics), will they be automatically included in the game rsc file (i'm not using file(), just rules_pics += 'name'), or do I need to specifically include them in the zip when I package the files?

I believe any file specified in single quotes in your source is included automatically in the packaging. You can, however, open the .zip file in WinZip to check.

Lummox JR

hmm... The .jpg files (each about 1-2K) are NOT in the .zip file, but they are in the game .rsc file. Will people be able to generate new copies of the .zip from the downloaded rsc for their browser cache?
In response to Dramstud (#8)
hmm... The .jpg files (each about 1-2K) are NOT in the .zip file, but they are in the game .rsc file. Will people be able to generate new copies of the .zip from the downloaded rsc for their browser cache?

Anything in the .rsc stays in the .rsc. browse_rsc(), as its name suggests, takes files from the .rsc, not from the dir where the project is located. Just distributing the .rsc will do.