Living Mesh Jib Sails Kit

Kayaker Magic, February 2015

Details of the Living Sails Kit:

When you buy a sail kit, it arrives in a folder in your inventory named after the sail type. In that folder you will find the sail objects, the sample mast, and a copy of this document for reference. The jib fat pack comes with seven different jibs cut to different angles between the luft and the foot. To test the sail: rez a sail and mast, link them together and send chat commands to see the sail work.

Jib Sails:

These triangular sails hang back from forestays angling forward in front of other sails. They have no boom, but are controlled by sheets attached to the free corner. (You cannot see the sheets, they are just numbers in the simulation). The jib mesh is designed to rotate around the edge of the sail. If your forestay is a prim like a cylinder, you can copy the position and rotation of the forestay. Paste that into the position and rotation of the jib and it will lock exactly into the right place. Once the orientation is right, use the build tools to change the size of the jib to fit. You should use stretch in “Stretch both sides” mode when changing the X or Y size of the jib. Stretching the jib distorts the angles, so I made them at 6 different angles and sell them in a "fat pack".

There are two ways to bring this sail to life: Link it into a ship based on my Ocean Engineer Sailing Ship Kit, or add it to your own ship and use the included test mast script somewhere in your build. Just size the sail to fit, link it into your build and stand back! It may suddenly turn with the wind! The menu in my sailboat script has options to reef and furl the sail. The wind watcher mast script has chat commands to control the sails. The script in the mast is full perm, so a third way to bring this sail to life is to see what the messages are that the mast sends to the sail, and modify your sailing script to send the same messages.

Sail Parameter Files:

Inside each sail there can an NC named .sailparams that the sail script checks every time it is rezzed or the inventory changes. A sample NC comes with the jibs in case you want to change sound, mesh or health textures. You can specify which materials (faces) of your own mesh sails are controlled by the jib script. Place that NC in inventory and edit it in place. Here are the parameters you can set for jib sails:
sailinflate=;	//sound the sail makes when inflating
sailpull=;	//while inflated and pulling in the wind
sailflutter=;	//while flapping loose in the wind
lfurled=0;	//a list of face numbers, which faces must be on for the furled sail
lreefl=0,3;	//what faces must be on when the reefed sail is on the left
lreefr=0.4;	//face number for reefed sail on right (example numbers are from my Kitely sail)
lfulll=1;	//face numbers for full sail on left
lfullr=2;	//face numbers for full sail on right
lnotex=0,5; 	//what faces to not texture
sailtext=name;		//the names of textures to record for sail health changes
The sound lines could be the UUID of each sound file, or the name of the sound file if it is in the sail inventory. When a sail opens, gybes or tacks, the sail makes a “whoomph!” sound, this is the inflate sound. Once inflated it makes a steady sound while pulling. When loose and hanging down wind it makes a fluttering sound.

The sail is a single mesh prim with many “materials” or “faces” that are invisible or visible depending on the mode of the sail. The list values above specify which faces are involved in each mode. You shouldn't need to mess with these unless you want to make your own sails. When a mesh is uploaded on a different grid, these numbers can change.

You can have several sailtext lines in the NC. Each line specifies a different texture to use when asked to change texure or when the ship health (damage) changes. The first sailtext line specifies the healthy or zero-damage texture. Each successive line specifies a texture map showing successively more damage. The script chooses which to use based on how many you supply and the range of damage values the ship can take. The sailtext lines can reference the UUID of a texture, or the name of a texture in inventory. Jibs come with a set of 4 texture maps designed by Modee Parlez, but you can replace these with your own.

Changing Sail Texture Maps.

If not using damage texture maps as above, you can change the texture of the sails once with the build dialog. I include a full-perm version of an Ocean Engineering texture in the kit to use as a template. You can upload, change the sail texture and download it again. The texture map has a separate area for the left and right side of the sail, so you can put different detail on each side. I have UV layout maps for all these textures for making precision texture maps. If you would like copies of these, contact Kayaker Magic.

Permissions:

The sails in inventory may say NOMOD, but this is because of the script inside. The prims are MOD and you will be able to modify them to build the boat of your dreams. The sail is COPY so you will be able to make several different boats, and launch several copies of each. A TRANS version is available for building into boats that you can sell.

The prims in the sail kits are MOD so you can edit them and link them into the boat of your dreams. The scripts are NOMOD, so this makes the sails look no mod in inventory, but this does not stop you from modifying all the prims. The sails are COPY so you can link many of them into a boat and use them in many boats. The export version of the kit is also TRANS so you can build the sails into vehicles that you can sell to others. Once linked into a boat, the sails will acquire the permissions of the root prim. You should change the permissions there and remove TRANS for the next owner.

Using sails with your own sailboat builds:

The sail kit comes with a wind following script in the test mast that watches the wind and the speed of your boat and reports this data to all the sails. The script listens to chat commands for reefing and furling the sails. This script is shipped in a mast object, but you can copy the script into any prim in your build. There should be one and only one copy of this script in your build, so don't just make multiple copies of the mast object. The wind following script is full perm so you can read it and learn how to send wind, velocity and reefing messages from your own script.

Other types of sails available:

Ocean Engineering has several kinds of sails available: Jib Sails, Square Sails, Gaff Sails, Bermuda Sails, Racing sails and a Spinnaker. There is also a scripted flag prim that turns to hang in the direction of the apparent wind, so it can be used to help trim your sails. Just link these sail prims into the same build as the wind script and they will start communicating and turning into the wind. You can link as many sails as you want into the build, they each come to life the next time the boat moves. All of the sails will flap when facing too far away from the wind. They will make a wind-in-the sail noise when they are pulling. The more sails you link into your build, the louder the nose will be! The sails don't quite flap at the same time, so the nose when you tack can be impressive!

Chat Commands to the Test Mast Script:

The test mast does have a sample script to show how to listen to the wind, so you can include it in your build to send wind messages to the sails. This is not recommended because it also has chat commands that you may not want in a final boat. So the other use for this mast is to test sails before you link them into boats. Link a sail to the test mast and type these commands on open chat near the mast:

wtype [sim setter internal] Which wind to listen to
wdir [nsew] What direction the wind comes from (ex: N NW SSW)
wspd [float] Wind speed, always in meters
sheet [float] Sail sheet angle, 1 to 90
square [furl reef full] Raise and lower the square sails
faa [furl reef full] Raise and lower the for-and-aft (faa) sails
spinnaker [furl reef full] Raise and lower the spinnaker (reefed means loose sheets)
jib [furl reef full] Raise and lower the jib sails.
gybe Force the jibs to the other side (if the wind allows)
bdir [nsew] Boat direction (ex: S, SE, NNW) for apparent wind calculation
bspd [float] Boat speed, always in meters
rpm [-10 to 10] Boat throttle setting, negative is astern.
drpm [-1,0,1] Increase/decrease throttle setting.
units [meters miles knots] Changes the units of instruments
health [0 to 100] Set the health (damage) of the sails

Lag issues:

Each sail has a script in it. This may sound a bit script heavy, but it is the same script in each sail of the same type. The script in each sail is event driven without even any timers. The main script in the Ocean Engineering Sailing Ship Kit checks the wind on a timer, calculates the velocity once a second and shares that with all the sails. These functions are done in the sample mast script and you can move those functions into your own script if you like. For example, I sent those messages from a copy of the Bwind script and was able to use my sails on that physical boat script.

“Virtual Instruments that Really Work!”

This is a sail that helps you to bring your sailing ship to life. It adds jib sails to your existing boat. These sails react in a realistic way to the wind. You can link many of these sails into your build and they all come to life! The sails pull against the sheet setting and inflate when they can, but flap noisily when the wind is not at a good angle. The sail is made from a single-prim mesh with a natural curve. The mesh has the sail furled, reefed and oriented as different “materials”. A script inside rotates the jib with the wind and selects the correct face for all conditions. It is shipped with a texture that has stripes and an Ocean Engineering logo on it. The texture map for this is included full perm, so you can download it to your PC, edit the texture, upload it and change the jib to any look you want. The sail comes with a .sailparams notecard that allows you to set parameters such as the sound made when pulling or flapping.

Check out the video demo of the Jib sail.
To try out demo boats that use this sail, look for links to my stores in my blog.