Topic: Creating a data package

As I'm about to submit the package file code, I think it might be best to explain how to use it. After all, I need testers to tell me that it's working, right?

So, unfortunately, at time of writing, there's no automagic way of doing this, although I'm planning on adding a publish button which will do just that, still, you might want to create automated build scripts to deploy or some such nonsense. But you're going to have to use the npk command line executable. There's a gui version, but it required wxwidgets, which I didn't have installed. Sorry. I've added the executables to the 3rdparty/npk/bin/{win32/linux} folder in svn (assuming Anael has submitted it there) and I will upload it somewhere and link it at the bottom of the post, if you don't fancy checking out the whole svn repository.

So, fire up your favourite command line and head to wherever your project is. It's also easiest if you add npk somewhere in your PATH where your OS can find it. Then repeat after me.

Doing Linux example first, I'll write a Windows one later
First add npk to the path

Nistur@DRAKE ~/maratis/3rdparty/npk/bin/linux $ ls
npk

Nistur@DRAKE ~/maratis/3rdparty/npk/bin/linux $ export PATH=`pwd`:$PATH

Then in your project directory, first create the package file

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ ls
Credits.txt  YoFrankie.mproj  levels  maps  meshs  scripts

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ npk YoFrankie.npk -create

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ ls
Credits.txt  YoFrankie.mproj  YoFrankie.npk  levels  maps  meshs  scripts

Then, let's add some files. For now only images, scripts and sounds will work from the package

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ npk YoFrankie.npk -add maps/char_ram_col.jpg@maps/char_ram_col.jpg

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ npk YoFrankie.npk -list
Package      : YoFrankie.npk
Version      : 27
Total entity : 1
Timestamp    : 2012-01-14 21:50:24
-------------------------------------------------------------------------------
       size    original flag    date      time   name
-------------------------------------------------------------------------------
    539,749     539,749      2012-01-14 21:21:38 maps/char_ram_col.jpg
-------------------------------------------------------------------------------

Note: you need to add the files with the same entity name, including the full path, otherwise Maratis might not find it.

You can always just add all the files together:

Nistur@DRAKE ~/maratis/trunk/dev/Examples/YoFrankie $ for dir in scripts maps ; do for file in $dir/* ; do npk YoFrankie.npk -add $file@$file; done; done

Hope that helps at least somebody

DOWNLOADS:
Windows
Linux

Re: Creating a data package

Hello! I want translate thise tutorial to Russian
it is need me to post it in http://make-games.ru/.
I  do it absolutely free but i need your allows to do it.

p.s. If there is Russian speak people, i will be glad to take their help in evaluation of translation.

Re: Creating a data package

Hi,
I have no problem with you translating this. I would suggest that it's a little out of date though, as we've now added the packaging functionality into Maratis Editor and the above usually isn't necessary

Re: Creating a data package

First, congratulation for the new package option available on the new maratis update, it works great wink

I have one question : how can we settle the screen resolution ?

Re: Creating a data package

The screen resolution and the full screen is not done in the package, it's a command line information, for example you can run the game from a .bat file, the system is :

for windows : MaratisPlayer.exe "projectName" width height fullscreen
for unix : ./MaratisPlayer "projectName" width height fullscreen

exemple for embeded project 1024x768 with fullscreen : MaratisPlayer.exe "" 1024 768 1