Difference between pages "Global Vehicle HUD" and "Global Mod Link System"

(Difference between pages)
m (Siren Interface)
 
 
Line 1: Line 1:
The '''Global Vehicle HUD (GVHUD)''' is a free, open-use HUD provided by the NTBI Group. Anyone can implement GVHUD compatibility into their vehicle and the GVHUD is available for free.
+
The '''Global Mod Link System (GMLS)''' is a free, full-permission script system provided by the NTBI Group. Anyone can implement GMLS into their modifiable vehicle, and anyone can build mods that automatically position themselves when linked to a GMLS-compatible vehicle.
  
 
==Overview==
 
==Overview==
The GVHUD is a dynamically customizable HUD intended for use by vehicle manufacturers. Manufacturers can use the GVHUD to control different aspects of the vehicle without designing their own HUD.
+
GMLS is a set of full-permissions scripts. It is intended for use in modifiable vehicles to simplify the installation of prebuilt modifications. For example, the NTBI Factory Lightbar Package uses GMLS to automatically position lightbars when linked to compatible vehicles.
  
The NTBI Group does not maintain a list of compatible vehicles. GVHUD-compatible products should clearly label themselves as such. The NTBI Group does not provide any warranty or support for third-party GVHUD implementations.
+
Aftermarket modification manufacturers can set up GMLS by linking a copy of the modification to the desired vehicle and using the Calibration Tool to set up the Alignment Tool. Then, when an end-user links the modification to a compatible vehicle, the modification will reposition itself (and, if necessary, rescale itself) automatically. GMLS can also unlink certain prims from the vehicle for factory prim replacements.
  
<big>[https://marketplace.secondlife.com/p/Global-Vehicle-HUD-Latest-Version-for-GVHUD-Compatible-Vehicles/20803267 '''Click here''' for the latest version of the GVHUD.]</big>
+
GMLS comes with three scripts:
 +
 
 +
* '''NTBI GMLS Alignment Tool''' - Inserted into aftermarket modifications and edited by the modification manufacturer to program alignment positions and other options.
 +
* '''NTBI GMLS Calibration Tool''' - Used to calibrate alignment positions; outputs alignment data to be placed in the Alignment Tool.
 +
* '''NTBI GMLS Vehicle Sample Script''' - Inserted into vehicles and edited by the vehicle manufacturer to define vehicle information for use by modifications.
 +
 
 +
The NTBI Group does not maintain a list of compatible vehicles or modifications. GMLS-compatible products should clearly label themselves as such. The NTBI Group does not provide any warranty for third-party GMLS implementations.
 +
 
 +
<big>[https://marketplace.secondlife.com/p/GMLS-Development-Kit-Tools-for-Integrating-the-Global-Mod-Link-System/20803262 '''Click here''' for the GMLS developer kit.]</big>
  
 
==End-User Instructions==
 
==End-User Instructions==
Wear the GVHUD by right clicking it in your inventory and selecting "Wear" or "Add". You can also attach it to a different HUD slot (default Top), but you will likely need to reposition it manually.
+
Refer to your vehicle's owner's guide for instructions on how to install GMLS-compatible equipment.
  
You can position the GVHUD as desired in both hidden and shown mode. When hidden or shown, the GVHUD will reposition itself to the position it was last placed in while in that mode.
+
If the owner's guide does not provide instructions, the following is a general checklist for installing GMLS-compatible modifications:
  
The GVHUD layout includes three main sections - a set of per-vehicle customizable buttons, an LCD display with soft buttons, and HIDE and GSTR buttons, which hide the GVHUD and send a folder with gesture keybinds, respectively. The customizable buttons and LCD display layout is different for each vehicle; refer to your vehicle's owner's guide for details.
+
# Ensure that the vehicle is turned off, including any lighting or other components that may change any attributes while installing the modification.
 +
# Take a copy of your vehicle as-is. Modifications may cause damage or unlink prims accidentally. Save a copy now in case this happens!
 +
# Rez the modification near your vehicle.
 +
# Right click the modification and select "Edit".
 +
# With the Edit window open, hold your SHIFT key and left click the vehicle. This should select both objects at once. Make sure you select the vehicle last.
 +
# Press your CTRL + L keys, or click the "Link" button in the Edit window.
 +
# If prompted, confirm that you want to link the two objects together.
 +
# When linked, the modification should automatically position itself to the recommended position and resize if necessary.
 +
# If prompted, grant link permissions. This may unlink some prims. Make sure to delete them after.
 +
# If desired, you may usually move the equipment once linked.
  
==Vehicle Manufacturer Instructions==
+
If a modification does not use GMLS, is not compatible with your vehicle's GMLS system, or returns an error when linking using the above procedure, follow steps 1 through 6, then manually reposition the modification as needed.
Vehicle manufacturers must implement the following API on their own; no support is provided.
 
  
All communication with the GVHUD is done via channel <code>47504750</code>.
+
==Aftermarket Modification Manufacturer Instructions==
 +
Get the Alignment Tool and Calibration Tool from the [https://marketplace.secondlife.com/p/GMLS-Development-Kit-Tools-for-Integrating-the-Global-Mod-Link-System/20803262 GMLS developer kit.]
  
The following commands can be sent from the vehicle to the GVHUD using llRegionSayTo to the avatar's UUID, or the HUD UUID if preferred:
+
Before continuing, make sure your mod is finished. Do not continue until you are sure you do not need to make any changes to your object.
  
* '''SYN'''
+
# Make a two copies of your object. One will be used for calibration. The other will be distributed to your end-users.
** Format: <code>SYN</code>
+
# Place the "NTBI GMLS Alignment Tool" script in the distribution object (the one you will keep).
** Should be sent by the vehicle when the driver sits. Must only be sent to the driver's avatar UUID, otherwise crosstalk will occur. GVHUD will respond with '''CON'''.
+
# Place the "NTBI GMLS Calibration Tool" script in the calibration object (the one you will link, then delete).
* '''ACK'''
 
** Format: <code>ACK|[vehicle name]|[array of button ID numbers]|[array of button latch flags]|[array of button states]|[siren main prim UUID]|[siren reverb prim UUID]|[siren name]|[switch state]</code>
 
** Should be sent by the vehicle in response to '''CON'''. Vehicle should also send '''MNU''' immediately after, if desired.
 
** [vehicle name] is the name of the vehicle to display on the LCD, up to 22 characters.
 
** [array of button ID numbers] is a comma-separated list of button ID numbers from the table below. The array must be exactly 30 buttons, ordered from 8 left to right at the top (excluding buttons above the LCD), 8 left to right in the center, 8 left to right on the bottom, then 6 left to right above the LCD.
 
** [array of button latch flags] is a comma-separated list of button latch flags, either 0 for momentary or 1 for latched. The array must be exactly 30 buttons, organized the same as above.
 
** [array of button states] is a comma-separated list of button states, either 0 for off or 1 for on. The array must be exactly 30 buttons, organized the same as above.
 
** [siren main prim UUID] and [siren reverb prim UUID] are the prim UUIDs of the siren emitter prims. See below for details.
 
** [siren name] is the name of the currently installed siren. Possible sirens are: GT6500, GT20A, VR900, BF200, UG4000, SP700, GT4500, MP224, eM, PC9, MP224E, EURO1
 
** [switch state] is the state of the four-position switch, either 0, 1, 2, or 3.
 
* '''MNU'''
 
** Format: <code>MNU|[JSON menu data]</code>
 
** Should be sent by the vehicle immediately after '''ACK''' and can be sent whenever the vehicle wants to set up a new LCD soft button menu tree, if desired.
 
** [JSON menu data] is a JSON array of menu items, which are JSON objects. Each menu item has the following attributes:
 
*** "l": label to display for menu item, a string of up to 8 characters, wrapped onto 2 lines of 4 characters each. To skip a menu item on the display, use an empty label ("").
 
*** "sub" (optional): a JSON array of menu items. If specified, opens a new menu when this menu item is selected.
 
*** "act" (optional): an action to perform when this menu item is selected. Can be one of the following:
 
**** "back": Moves back to the previous menu, if a submenu.
 
**** "help": Opens GVHUD help URL.
 
** To close the menu, send a blank string ("") for [JSON menu data].
 
* '''TXT'''
 
** Format: <code>TXT|[row number]|[text]</code>
 
** Can be sent by the vehicle to render text on the LCD. The GVHUD must have sent '''RFR''' first to signal that the display is ready, otherwise commands will be dropped.
 
** [row number] is the row number, from 0 to 3, to render text on. If a menu is currently active, using row numbers 2 or 3 will close the menu.
 
** [text] is the text to render, up to 24 characters.
 
* '''MSG'''
 
** Format: <code>MSG|[text]</code>
 
** Can be sent by the vehicle to send a chat message to the HUD wearer.
 
* '''UPD'''
 
** Format: <code>UPD|[button index]|[button ID]|[state]</code>
 
** Can be sent by the vehicle to update a button state on the GVHUD. Note that no processing will be performed for this button, so '''BTN''' will not be sent.
 
** [button index] is the index of the button in the button arrays, 0 to 29. Alternatively, [button index] can be set to -1 to use [button ID] instead.
 
** [button ID] is the button ID from the table below. Can be used if the vehicle would prefer handling commands via the button ID instead of the button index, but is very slightly slower. If [button index] is not -1, [button ID] is ignored.
 
** [state] is 0 for off or 1 for on.
 
* '''SIS'''
 
** Format: <code>SIS|[siren name]</code>
 
** Can be sent by the vehicle to install a siren outside of '''ACK'''.
 
** [siren name] is the name of the newly installed siren; see '''ACK''' for a list of possible sirens.
 
* '''SSS'''
 
** Format: <code>SSS|[siren state]</code>
 
** Should be sent by the vehicle if another GVHUD sends '''SST''', or if the vehicle has activated a park kill feature.
 
** [siren state] should be the [siren state] string provided by '''SST'''. [siren state] can also be "off" (without quotes) if the vehicle has a park kill feature.
 
* '''SVU'''
 
** Format: <code>SWU|[switch state]</code>
 
** Should be sent by the vehicle if another GVHUD sends '''SWS'''.
 
** [switch state] should be the [switch state] integer provided by '''SWS'''.
 
* '''DIS'''
 
** Format: <code>DIS</code>
 
** Should be sent by the vehicle when the driver unsits.
 
  
The following commands will be sent by the GVHUD to the vehicle using llRegionSayTo to the prim UUID of the object that sent '''ACK''' unless otherwise specified:
+
For each vehicle you want your object to be compatible with:
  
* '''OPT'''
+
# Make a new copy of the calibration object. It should have the "NTBI GMLS Calibration Tool" script already in it.
** Format: <code>OPT|[menu label]</code>
+
# Rez the vehicle. Make sure it is the original size!
** Sent by the GVHUD when a menu item is selected. Sent on every selection, including when switching to a submenu.
+
# Position the calibration object on the vehicle, exactly where you want it to be once installed by the end-user.
** [menu label] is the label of the selected menu item.
+
# Link the calibration object to the vehicle.
* '''RFR'''
+
# Copy the script snippet line sent to local chat.
** Format: <code>RFR</code>
+
# Open the "NTBI GMLS Alignment Tool" script in the distribution object.
** Sent by the GVHUD when it is ready to accept '''TXT''' commands. Vehicle should start sending '''TXT''' commands once it receives '''RFR''' after '''CON'''.
+
# Paste the script snippet line between the two marked lines at the top of the script. NOTE: The first part of each line is the GMLS ID of the vehicle you have calibrated to. If you see a line with the same GMLS ID, you have already calibrated to that vehicle, and only the first instance of that vehicle will be used.
* '''BTN'''
+
# Save the "NTBI GMLS Alignment Tool" script.
** Format: <code>BTN|[button index]|[button ID]|[state]</code>
 
** Sent by the GVHUD when a button is pressed or released.
 
** [button index] is the index of the button in the button arrays, 0 to 29.
 
** [button ID] is the button ID from the table below.
 
** [state] is 0 for off or 1 for on.
 
* '''GST'''
 
** Format: <code>GST|[command]</code>
 
** Sent by the GVHUD when a gesture hotkey is used.
 
** [command] can be one of the commands described in Gesture Controls below.
 
* '''SRN'''
 
** Format: <code>SRN|[sound UUID]</code>
 
** Sent by the GVHUD ''directly to the siren emitter prim specified by '''ACK''' only'' to cause it to play a siren sound.
 
** [sound UUID] is a sound to play, or NULL_KEY to stop sounds.
 
* '''SST'''
 
** Format: <code>SST|[siren state]</code>
 
** Sent by the GVHUD when the siren mode changed. If multiple GVHUDs are attached, the vehicle should send '''SSS''' to the other GVHUD.
 
** [siren state] is the state of the siren.
 
* '''SWS'''
 
** Format: <code>SWS|[switch state]</code>
 
** Sent by the GVHUD when the switch is moved. If multiple GVHUDs are attached, the vehicle should send '''SWU''' to the other GVHUD.
 
* '''CON'''
 
** Format: <code>CON</code>
 
** Sent by the GVHUD when it is attached/reset, or in response to '''SYN'''.
 
  
===Siren Interface===
+
Once finished, delete any calibration objects and vehicles.
If a siren is used, two prims must be designated as siren sound emitter prims. Their UUIDs should be detected and sent in '''ACK'''.
 
  
To reduce latency, the GVHUD sends '''SRN''' commands directly to the prims designated by '''ACK'''. Each prim must listen for '''SRN''' independently of the script that handles other GVHUD communication, and should play siren sounds as sent by the GVHUD. A sample script is below, which should be placed in each of the prims designated as siren emitter prims:
+
If you want the root prim of the object to retain its physics type when linked to the vehicle, change root_no_physics to FALSE. (By default, the root prim of this object will be set to physics type "none" and the physics types of child prims will remain the same.)
  
default
+
If you want to have the GMLS script automatically unlink prims, list their names in the remove_prims list. If you do this, you can also change remove_move_dist to change the distance unlinked prims will move up, and you can change remove_recolor to FALSE if you do not want unlinked prims to be recolored bright red for visibility.
{
 
    state_entry()
 
    {
 
        llListen(47504750, "", "", "");
 
    }
 
    listen(integer channel, string name, key id, string message)
 
    {
 
        if (llGetSubString(message, 0, 3) == "SRN|" && id == hud_uuid)
 
        {
 
            string uuid = llGetSubString(message, 4, -1);
 
            if (uuid == NULL_KEY) llStopSound();
 
            else llLoopSound(uuid, 1.0);
 
        }
 
    }
 
}
 
  
Sound emitter scripts must verify that the object that sent the '''SRN''' command is the connected GVHUD. This script snippet does not define <code>hud_uuid</code>; it must be set when the script that controls GVHUD communication sends '''ACK''' so that the emitter knows the UUID of the connected GVHUD.
+
When finished, make sure you test your modification on each compatible vehicle to make sure it works correctly.
  
===Gesture Controls===
+
===API===
The gestures provided in the GVHUD send the following internal commands:
+
The Alignment Tool and vehicle script send the following link messages that can be used to trigger additional scripts in your modification:
  
* '''F2''': "ZF2", resizes GVHUD.
+
* <code>GMLS_REQUEST</code>
* '''F3''': "ZF3", toggles axle lock (button ID 28), if equipped, otherwise ignored.
+
** Sent by Alignment Tool once linked. Vehicle responds with <code>GMLS_ID</code> if compatible. You can also send this manually once the GMLS script is finished if you need any information from <code>GMLS_ID</code>.
* '''F4''': "ZF4", cycles through hands-free siren tones, if eqipped, otherwise ignored.
+
* <code>GMLS_ID</code>
* '''F5''': "ZF5", moves switch to position 0.
+
** '''Key''': [gmls_id]|[root scale]|[additional information]
* '''F6''': "ZF6", moves switch to position 1.
+
** Sent by vehicle in response to <code>GMLS_REQUEST</code>. Note that [root scale] is not the ''size'' of the root prim of the vehicle, but rather the ratio of the current size of the root to the original size of the root. For example, [root scale] on a vehicle that was upsized to twice its original size would be <2.0, 2.0, 2.0> regardless of its actual size.
* '''F7''': "ZF7", moves switch to position 2.
+
* <code>GMLS_SUCCESS</code>
* '''F8''': "ZF8", moves switch to position 3.
+
** Sent by Alignment Tool if the GMLS operation completed successfully and it is now safe to perform any configuration changes or whatever else on the newly linked-to vehicle.
* '''Ctrl + Left''': "ZCA", toggles turn L (button ID 24), if equipped, otherwise ignored.
+
* <code>GMLS_FAIL</code>
* '''Ctrl + Right''': "ZCD", toggles turn L (button ID 29), if equipped, otherwise ignored.
+
** Sent by Alignment Tool if the GMLS operation failed either because the object the modification was just linked to is not GMLS-compatible or the vehicle has a gmls_id that the modification was not calibrated for.
* '''Ctrl + Down''': "ZCS", toggles hazards (button ID 25), if equipped, otherwise ignored.
+
* <code>GMLS_CANCEL</code>
* '''H''': "ZZH", horn tap, sends <code>GST|HORN</code>.
+
** Sent by Alignment Tool if the GMLS operation was cancelled by the user.
* '''L''': "ZZL", toggles cycle headlights (button ID 26), if equipped, otherwise ignored.
 
* '''K''': "ZZK", high beams flash, sends <code>GST|BRIGHT</code>.
 
* '''I''': "ZZI", toggles key (button ID 7), if equipped, otherwise ignored.
 
* '''O''': "ZZO", get out, sends <code>GST|OUT</code>.
 
* '''Space''': "ZZ_", handbrake, sends <code>GST|BRAKE</code>.
 
* '''1''': "ZZ1", camera 1, sends <code>GST|CAM1</code>.
 
* '''2''': "ZZ2", camera 2, sends <code>GST|CAM2</code>.
 
* '''3''': "ZZ3", camera 3, sends <code>GST|CAM3</code>.
 
* '''4''': "ZZ4", camera 4, sends <code>GST|CAM4</code>.
 
* '''5''': "ZZ5", camera 5, sends <code>GST|CAM5</code>.
 
* '''6''': "ZZ6", camera 6, sends <code>GST|CAM6</code>.
 
  
===Button IDs===
+
==Vehicle Manufacturer Instructions==
The following is a list of available button IDs.
+
Get the Alignment Tool and Calibration Tool from the [https://marketplace.secondlife.com/p/GMLS-Development-Kit-Tools-for-Integrating-the-Global-Mod-Link-System/20803262 GMLS developer kit.]
  
This list can be expanded by the NTBI Group without a GVHUD update. If you have a button label you would like to be integrated into the GVHUD's available buttons, contact Nelson Jenkins.
+
Before continuing, make sure your vehicle's root prim will not be resized before it is distributed. Do not continue until the root prim is finalized.
  
{| class="wikitable"
+
# Place the "NTBI GMLS Vehicle Sample Script" script in the vehicle. If you prefer, you can also integrate this script into another script in the vehicle to save memory.
|-
+
# Edit the gmls_id string. You can use any string as long as it does not include the pipe ("|") character, but it should be limited to alphanumeric characters, underscores ("_"), and be up to 32 characters. The gmls_id must be unique for every vehicle that has a different layout of potential modification positions. For example, use different IDs for 2DR and 4DR variations of the same vehicle.
! ID || Description || ID || Description || ID || Description || ID || Description
+
# Edit the gmls_default_root_size vector to be the size of the root prim of the vehicle. On most viewers, you can get this value by opening the Edit window, going to the Object tab, and pushing the "C" button next to Size. WARNING: This is not optional. Failure to set this value will cause GMLS modifications to align improperly.
|-
+
# Save the "NTBI GMLS Vehicle Sample Script" script. If kept separate, you can [http://wiki.secondlife.com/wiki/LlSetMemoryLimit limit the memory used by the script] if you prefer.
| -10 || Siren Wail* || -11 || Siren Yelp* || -12 || Siren Priority* || -13 || Siren Manual*
 
|-
 
| -14 || Siren Horn* || -1 || Blank || || || ||
 
|-
 
| 0 || LIGHT BAR (Red) || 1 || STRB (Red) || 2 || TKDN FLASH (Red) || 3 || TAKE DOWN (Red)
 
|-
 
| 4 || FLOOD (Red) || 5 || CRZ (Red) || 6 || (Reserved) || 7 || Key (Green)
 
|-
 
| 8 || HIDE AWAY (Red) || 9 || WIG WAG (Red) || 10 || Arrow (Red) || 11 || Siren Wail*
 
|-
 
| 12 || Siren Yelp* || 13 || Siren Priority* || 14 || Siren Manual* || 15 || Siren Horn*
 
|-
 
| 16 || AUX 1 || 17 || AUX 2 || 18 || AUX 3 || 19 || CUT F (Red)
 
|-
 
| 20 || CUT R (Red) || 21 || (Reserved) || 22 || (Reserved) || 23 || (Reserved)
 
|-
 
| 24 || Turn Sig L || 25 || Cycle Headlights || 26 || Hazard Flashers || 27 || Horn
 
|-
 
| 28 || Axle Lock || 29 || Turn Sig R || || || ||
 
|}
 
  
<nowiki>*</nowiki> Use negative button IDs for GVHUD to handle the siren. The GVHUD will automatically pick the correct buttons to show, will only allow one on at a time, and will send siren commands directly to the prims specified in SSU. Use positive button IDs for sirens only if you want them to send BTN commands and not be connected together.
+
Perform this procedure for each vehicle variation. Once finished, it is a good idea to test the GMLS settings by creating a simple object and following the Aftermarket Modification Manufacturer Instructions.

Revision as of 16:15, 10 April 2021

The Global Mod Link System (GMLS) is a free, full-permission script system provided by the NTBI Group. Anyone can implement GMLS into their modifiable vehicle, and anyone can build mods that automatically position themselves when linked to a GMLS-compatible vehicle.

Overview

GMLS is a set of full-permissions scripts. It is intended for use in modifiable vehicles to simplify the installation of prebuilt modifications. For example, the NTBI Factory Lightbar Package uses GMLS to automatically position lightbars when linked to compatible vehicles.

Aftermarket modification manufacturers can set up GMLS by linking a copy of the modification to the desired vehicle and using the Calibration Tool to set up the Alignment Tool. Then, when an end-user links the modification to a compatible vehicle, the modification will reposition itself (and, if necessary, rescale itself) automatically. GMLS can also unlink certain prims from the vehicle for factory prim replacements.

GMLS comes with three scripts:

  • NTBI GMLS Alignment Tool - Inserted into aftermarket modifications and edited by the modification manufacturer to program alignment positions and other options.
  • NTBI GMLS Calibration Tool - Used to calibrate alignment positions; outputs alignment data to be placed in the Alignment Tool.
  • NTBI GMLS Vehicle Sample Script - Inserted into vehicles and edited by the vehicle manufacturer to define vehicle information for use by modifications.

The NTBI Group does not maintain a list of compatible vehicles or modifications. GMLS-compatible products should clearly label themselves as such. The NTBI Group does not provide any warranty for third-party GMLS implementations.

Click here for the GMLS developer kit.

End-User Instructions

Refer to your vehicle's owner's guide for instructions on how to install GMLS-compatible equipment.

If the owner's guide does not provide instructions, the following is a general checklist for installing GMLS-compatible modifications:

  1. Ensure that the vehicle is turned off, including any lighting or other components that may change any attributes while installing the modification.
  2. Take a copy of your vehicle as-is. Modifications may cause damage or unlink prims accidentally. Save a copy now in case this happens!
  3. Rez the modification near your vehicle.
  4. Right click the modification and select "Edit".
  5. With the Edit window open, hold your SHIFT key and left click the vehicle. This should select both objects at once. Make sure you select the vehicle last.
  6. Press your CTRL + L keys, or click the "Link" button in the Edit window.
  7. If prompted, confirm that you want to link the two objects together.
  8. When linked, the modification should automatically position itself to the recommended position and resize if necessary.
  9. If prompted, grant link permissions. This may unlink some prims. Make sure to delete them after.
  10. If desired, you may usually move the equipment once linked.

If a modification does not use GMLS, is not compatible with your vehicle's GMLS system, or returns an error when linking using the above procedure, follow steps 1 through 6, then manually reposition the modification as needed.

Aftermarket Modification Manufacturer Instructions

Get the Alignment Tool and Calibration Tool from the GMLS developer kit.

Before continuing, make sure your mod is finished. Do not continue until you are sure you do not need to make any changes to your object.

  1. Make a two copies of your object. One will be used for calibration. The other will be distributed to your end-users.
  2. Place the "NTBI GMLS Alignment Tool" script in the distribution object (the one you will keep).
  3. Place the "NTBI GMLS Calibration Tool" script in the calibration object (the one you will link, then delete).

For each vehicle you want your object to be compatible with:

  1. Make a new copy of the calibration object. It should have the "NTBI GMLS Calibration Tool" script already in it.
  2. Rez the vehicle. Make sure it is the original size!
  3. Position the calibration object on the vehicle, exactly where you want it to be once installed by the end-user.
  4. Link the calibration object to the vehicle.
  5. Copy the script snippet line sent to local chat.
  6. Open the "NTBI GMLS Alignment Tool" script in the distribution object.
  7. Paste the script snippet line between the two marked lines at the top of the script. NOTE: The first part of each line is the GMLS ID of the vehicle you have calibrated to. If you see a line with the same GMLS ID, you have already calibrated to that vehicle, and only the first instance of that vehicle will be used.
  8. Save the "NTBI GMLS Alignment Tool" script.

Once finished, delete any calibration objects and vehicles.

If you want the root prim of the object to retain its physics type when linked to the vehicle, change root_no_physics to FALSE. (By default, the root prim of this object will be set to physics type "none" and the physics types of child prims will remain the same.)

If you want to have the GMLS script automatically unlink prims, list their names in the remove_prims list. If you do this, you can also change remove_move_dist to change the distance unlinked prims will move up, and you can change remove_recolor to FALSE if you do not want unlinked prims to be recolored bright red for visibility.

When finished, make sure you test your modification on each compatible vehicle to make sure it works correctly.

API

The Alignment Tool and vehicle script send the following link messages that can be used to trigger additional scripts in your modification:

  • GMLS_REQUEST
    • Sent by Alignment Tool once linked. Vehicle responds with GMLS_ID if compatible. You can also send this manually once the GMLS script is finished if you need any information from GMLS_ID.
  • GMLS_ID
    • Key: [gmls_id]|[root scale]|[additional information]
    • Sent by vehicle in response to GMLS_REQUEST. Note that [root scale] is not the size of the root prim of the vehicle, but rather the ratio of the current size of the root to the original size of the root. For example, [root scale] on a vehicle that was upsized to twice its original size would be <2.0, 2.0, 2.0> regardless of its actual size.
  • GMLS_SUCCESS
    • Sent by Alignment Tool if the GMLS operation completed successfully and it is now safe to perform any configuration changes or whatever else on the newly linked-to vehicle.
  • GMLS_FAIL
    • Sent by Alignment Tool if the GMLS operation failed either because the object the modification was just linked to is not GMLS-compatible or the vehicle has a gmls_id that the modification was not calibrated for.
  • GMLS_CANCEL
    • Sent by Alignment Tool if the GMLS operation was cancelled by the user.

Vehicle Manufacturer Instructions

Get the Alignment Tool and Calibration Tool from the GMLS developer kit.

Before continuing, make sure your vehicle's root prim will not be resized before it is distributed. Do not continue until the root prim is finalized.

  1. Place the "NTBI GMLS Vehicle Sample Script" script in the vehicle. If you prefer, you can also integrate this script into another script in the vehicle to save memory.
  2. Edit the gmls_id string. You can use any string as long as it does not include the pipe ("|") character, but it should be limited to alphanumeric characters, underscores ("_"), and be up to 32 characters. The gmls_id must be unique for every vehicle that has a different layout of potential modification positions. For example, use different IDs for 2DR and 4DR variations of the same vehicle.
  3. Edit the gmls_default_root_size vector to be the size of the root prim of the vehicle. On most viewers, you can get this value by opening the Edit window, going to the Object tab, and pushing the "C" button next to Size. WARNING: This is not optional. Failure to set this value will cause GMLS modifications to align improperly.
  4. Save the "NTBI GMLS Vehicle Sample Script" script. If kept separate, you can limit the memory used by the script if you prefer.

Perform this procedure for each vehicle variation. Once finished, it is a good idea to test the GMLS settings by creating a simple object and following the Aftermarket Modification Manufacturer Instructions.