BS2 USING ZIP

From FSG Wiki

Jump to: navigation, search

Since many of you seem to not understand how the .zip thing work in BS2, here is an explanation that could help you!


Contents

HOW IT WORKS

Lets start by explaining how BS2 stores downloaded files.

First, downloading something from the web, like in this example line:

INCLUDE http://www.freewebs.com/joemaximumbs2/MODS/BSOS/BSOS.bs2.zip!

will download the file called "BSOS.bs2.zip" and the file will be stored in your BS2 folder /webdls/www.freewebs.com/joemaximumbs2/MODS/BSOS/BSOS.bs2.zip Then if it is a .zip file every file and folder in it will be extracted from that dir.

The ".bs2.zip" part: This is the file that will be executed first in your mod. The file should be the same as the ".bs2" part. In this example the file that would be executed first would be "BSOS.bs2" (remove the .zip part). So if you extract the BSOS.bs2.zip file you will find a file called BSOS.bs2.

Using File In the .zip Now lets say you putted all your image and your .bs2 (called MyZip.bs2) file into a .zip called "MyZip.bs2.zip". This .zip contain many file, but one you access into your "MyZip.bs2" code. Lets call it "MyImage.bmp". In your MyZip.bs2 code, when you want to load the MyImage.bmp, just do like if the image where loaded from the net. As BS2 will have unzipped the .zip file, the file BS2 will be looking to download will already be there so he will just use it.

This mean, to continue the example, that if i upload the file "MyZip.bs2.zip" so you access it using the URL: http://www.freewebs.com/joemaximumbs2/MODS/MyZip.bs2.zip. So if you wanted to load any images that where zipped into your .zip file, simply use the same URL as the .zip file, except use the filename you want to use. So in this example the code to load the image that is in your zipped file would be simply:

GROUP MyGroup 100 FILE http://www.freewebs.com/joemaximumbs2/MODS/MyImage.bmp

HOW TO USE IT

- Create a main ".bs2" file that will load everything needed for your mod. - Create a directory and put the ".bs2" file in it, along with all other file that would need to be included in your mod. This can be a directory too, its good to sort big mods (like my OS). - Once your mod is completed, zipped every file in your mod folder into a ".zip" file. You have to name the zip file exactly like your main ".bs2" file. Even with the ".bs2" extension giving a ".bs2.zip" extension. - Then publish your mod using the:

INCLUDE http://www.MyURL.com/MyModishere/MyMod.bs2.zip!

Adding the "!" at the end assure always latest version of the zip file.

EXAMPLE

** All links in this example are fake, they are only example and will not work !

Here is an example that could help

  • Mod Folder Content:
    • Mod Folder Name :
    • Example.bs2
    • MyImage.bmp
    • myfont.ttf
    • /OBJECT/mybs2object.bs2 (this one is in a folder called OBJECT within the mod folder)
  • .ZIP file will contain the same as above and will be called Example.bs2.zip
  • The ZIP file is stored on a freewebs account (mine for this example) into a folder called MyZipMod.

Starting the mod

So the best way to start this example mod is (again) to use this:

INCLUDE http://www.freewebs.com/joemaximumbs2/MyZipMod/Example.bs2.zip!

This code should just be pasted into a BS2 sandbox. It could also be use in a .bat file to automatically start the mod.

  • This will make BS2 download the .zip file into the webdls folder, then extract it. Then execute the file Example.bs2.

Loading the or Image font file

In the Example.bs2 file, when you want to load the font, here is how you should write it:

LOAD FONT "http://www.freewebs.com/joemaximumbs2/MyZipMod/myfont.ttf"

Using the quote (") is in case you could have space in the URL. But just write it like if it would be on your server url. BS2 will just load the previously extracted version.

Same for the image:

ELEMENT none MyElement 255 100 100 0 1 0 1 0 Clear 100 FILE "http://www.freewebs.com/joemaximumbs2/MyZipMod/MyImage.bmp"

Loading the OBJECT file

This one is different because it was in its own folder it the .zip file, so it was extracted in its own folder where your .zip file was saved. But the basic to use it are exactly the same, just add the directory where you put it at then end. So here it would be:

INCLUDE "http://www.freewebs.com/joemaximumbs2/MyZipMod/OBJECT/mybs2object.bs2"

Simple as that, just add the "OBJECT" folder at the end of the url.

CONCLUSION

After many test this method is far most THE BEST METHOD of any to load a mod.

  • 1 File to download and because it is a zip file, it is most likely to be smaller than all files not zipped.
  • As the zip file is most likely to be small, it will be extracted very fast. Making the mod start fast.
  • Now 30 dos box windows pop up in front of you because the mod load 30 images from a website.
  • Easy to use ! (at least i hope after reading this you'll find it easy :P ! )
  • Can easily be use with the .BAT method !

EXTRA - THE BATCH FILE QUICK TEMPLATE

First you must create the .bat and to make this create a new text file then rename it to .bat. - If you cant see the ".txt" extension of the file you created then uncheck "mask know system extension" into the explorer (not IE) options) Then edit the bat file and add this code:

burningsand2 keys.bs2 functions.bs2 menu.bs2 draw.bs2 network.bs2 start.bs2 

Then at the end of this just add the URL of the mod to load. (On the same line) Then rename the bat file to the name of the mod to load.

Personal tools