Thursday 9 July 2015

How to Convert a C1 SPR File to a C3/DS C16 File

How to convert a C1 SPR file to a C3/DS C16 file, using The One Stop Sprite Workshop and Jagent.

Get The One Stop Sprite Workshop and Jagent.

Choose a SPR file to work with. If it is an official Creatures 1 sprite, then Gameware’s general copyright exception applies, but with other sprites, it’s a good idea to get the permission of the original COBbler.

Open the SPR file with The One Stop Sprite Workshop. If you navigate to the folder that your sprite is in, but you can’t see it, make sure that you check that the ‘Files of type:’ dropdown is showing ‘Creatures 1 Sprite Files (*.spr)’.

You should see a small preview with a black background. Go to File > Save As and choose ‘Creatures 2 Sprite Files 16 bit format (*.s16)’, and save it with a sensible name. Close The One Stop Sprite Workshop.

Open this S16 file with Edos, and you should see the agent itself with a blackish border, without a background. Go to Save and save it with a sensible name, AND the .c16 extension. (For example, saving a lemon sprite as lemon.c16). In addition, you have to use Edos’s dropdown option to choose ‘Files of Type’ ‘Compressed Sprite File (*.c16)’.

Saturday 4 July 2015

Moving Items Into Your World With TMVT

A short tutorial on how to move new agents into your world by checking their location first with TMVT.

To find a good position for something to appear in the world, use the key command Ctrl-Shift-X. (Docking Station or Docked worlds only, but it will still be valid with C3 standalone.) This will give you two numbers that appear next to your hand in the world. Hover the fingertip over the place you want your agent to appear, and write down the two numbers. These are your coordinates.

mvto will make the top left point of a target agent appear exactly at the coordinates you chose.

mvsf will try to make an item appear in the general vicinity of the coordinates, at a slightly different spot that it considers 'safe'.

So what if you want to use mvto, but you want to make sure that the game won't crash if the spot isn't suitable?

You use a doif block with tmvt.

tmvt is a command that tests if the target can move to the given location and still lie validly within the room system. tmvt returns 1 if it can, 0 if it can't.

*If the test move works
doif tmvt X Y eq 1
*actually move the object to where I want to
mvto X Y
*If the test move doesn't work
else
*move the item safely to the same location
mvsf X Y
*End the doif block
endi


You can see that you can extend this code to try to place your object in multiple locations, if need be.

I like to first try to move my objects into a C3 location, and then if that isn't valid, move it to a valid DS position - thus incorporating a rough C3/DS check into the positioning of the agent. 'If the player isn't running C3, or a C3-docked world, then they must be running Docking Station!'

There are many, many other ways of running that C3/DS check and positioning the agent appropriately, but this is the one I use.

This can also be used in the push script for vendors to make sure that the vended item is made in a valid place in the world.