Saturday, November 9, 2024

Swift Modding

 The Swift has been designed with modding and addons in mind, so there are quite a few systems available to modders.


Physics Shapes

If you want an object in your addon to use either a Convex Hull or Prim physics shape, you will need to set the description of said object to either "CONVEX" or "PRIM". If you don't, EDIT MODE will set it to none.

Addon Touch System

No need to add a script into everything that you want to be touch-able. You can do it all with 1 script inside of your mod and use the built in addon-touch system. This was originally done by Beckhan.ra of GEMC, and it's a genius system so we've added it to the Swift.

To use - Simply add ADDON_# into the description of your object. You can add further values after the # if you want to use them in the script. When this object is clicked it will send the #addon_touch link message.

Example: Object desc: ADDON_#locker1#0

In script:

if( _func == "#addon_touch" ) {
            list parts = llParseString2List(_msg, ["#"], []);
            
            integer link_num    = _num;
            key     toucher     = llList2Key(parts, 0);
            integer link_face   = llList2Integer(parts, 1);
            string  link_name   = llGetLinkName(link_num);

           // Accessing the custom values after ADDON_# 
           string door_name = llList2String(parts, 2);
           integer door_open = llList2Integer(parts, 3);         


Addon Menu

If you want to have a menu for your addon, you can make use of the "Back Addon.." function from the Customise Menu. To do this listen for the "#addon_menu" link message. See the link messages section for more on this.

Simple Doors

If you have a door where the mesh is offset to include a hinge (As in, you only need to set the rotation to make it open / close) then all you need to do is change the name and description for it to become a door (Once linked to the Swift).

Name: Must include "SimpleDoor" in the link name

Description: A list separated by #'s - [(Vector) Axis, (Integer) Amount to rotate, (Integer) Sound set to use, (Integer) State]

 Example: <1,0,0>#-56#1#0 - This will rotate -56 degrees on the x axis when clicked, and use sound set 1. This door is currently closed.

Sound sets available:

0 - Small door

1 - Large door

2 - Basic

3 - Locker style door


Simple Seats

There are a few key-words you can use to easily make something a seat.

Passenger - Will make the object a seat

PassengerTex - Will be a seat, and get re-textured with the regular van seats

PassengerAny - Will be a seat and ignore group / owner lock and allow anyone to sit (Example usage is in the police cell, so a prisoner can sit but the van is still locked to group)

The description will need some information. Each item is separated by a #. An example is:

<0.05,-0.8,-0.3>#<0.5,-0.5,0.5,0.5>#DoorL#none#sit#00000000-0000-0000-0000-000000000000

<Seat Offset>#<Seat Rotation>#Door to open when seated#Get-in animation#Sit animation#Key of currently sitting avatar (Set to 00000000-0000-0000-0000-000000000000)

If you don't want a door to open, or an animation to play, simply write none.

 

Changing Siren Sounds

The siren sounds are held within the lightbar itself. They must be named numerically, starting from 0. They will play in order, and then loop around (If using horn to change).

Example: Your first siren is called "0", the next is called "1".

Right click the lightbar, make sure "Edit Linked" is ticked, delete the existing sounds, then drag in your siren sounds.


GTFO - Get The Freight Out

The Swift is GTFO enabled out of the box. You don't need to add any scripts. You can add CARGO!0/1/2/3/etc to make objects appear and disapear when you load or unload cargo.

Example: First object has CARGO!1 in description, the next object has CARGO!2 in description.

 

Link Messages

All of the link message "commands" are sent in the key field. Please note the left column which tells you if the command can be sent by you, or if its only receivable.

Sendable? Command Number String Description
Yes #check_oil
N/A
N/A
Will print oil level in % in local chat
Yes #check_def N/A N/A Will print DEF (Diesel Exhaust Fluid) level in % in local chat
Yes #check_damage N/A N/A Will print engine status in % in local chat
Yes #set_locked 0 = Unlocked, 1 = Locked, 2 = Toggle N/A Will lock / unlock or toggle the lock on the vehicle
No #locked 0 = Unlocked, 1 = Locked N/A Status of vehicle lock
Yes #auto_shutoff N/A N/A Will toggle auto-shutoff when the driver exits the vehicle
Yes #get_access N/A N/A Will send out #access with current access level
No #access 0 = Everyone, 1 = Group, 2 = Owner N/A Current access level of the vehicle
Yes #access_deny N/A Key of user Will post message in chat saying llGetDisplayName((key)_msg) doesn't have permission to use the vehicle
Yes #edit_mode N/A N/A Will make the vehicle perform edit mode functions
Yes #get_menu_details N/A Key of user who wants menu Will send out #menu_details which contains the access level, distance driven, and current fuel
No #menu_details Current access level CSV[Total distance travelled, Fuel level in %] Returned following a call of #get_menu_details
Yes #do_key N/A N/A Will turn the key 1 notch
Yes #do_ignition N/A N/A If the key is in, will turn the key an extra notch to turn the engine on
Yes #suspension N/A N/A Will toggle working suspension
Yes #change_camera The camera setting wanted - Or -1 to cycle through them N/A Sets the camera angle, or cycles through them
Yes #swap_measurements N/A N/A Swaps between MPH and KPH on the dashboard
No #use_mph 0 = Use KPH, 1 = Use MPH N/A Sent when the measurements are changed
Yes #turn_speed -1 = Slower, 0 = Default, 1 = Faster N/A Adjusts the turning speed, or resets it to default
Yes #horn 0 = Off, 1 = On N/A Turns the horn on or off
No #offroad 0 = End, 1 = Start N/A Sends when the vehicle goes onto or off LL terrain
Yes #ac_fan N/A N/A Toggles the AC / Heater!
Yes #reverse_beep N/A N/A Toggles the reverse beep
Yes #reverse_uuid N/A UUID of sound Changes reverse sound to specified UUID
No #gear_change 0 = Park, 1 = Reverse, 2 = Neutral, 3 = Drive N/A Sends when the gear is changed
No #ignition State of the key, 0 = Off, 1 = Battery, 2 = Engine N/A Sent when the key is changes
No #brake 0 = Released, 1 = Pressed N/A Sent when the brake is pressed or released
No #accelerator 0 = Released, 1 = Pressed N/A Sent when the accelerator is pressed or released
No #highbeams 0 = Off, 1 = On N/A Sent when the state of the highbeam headlights is changed
Yes #do_headlights N/A N/A Same as clicking the headlight dial
Yes #set_headlights 0 = Off, 1 = Running Lights, 2 = Fully on N/A Sets the headlights to a specific setting
Yes #do_highbeams N/A N/A Toggles highbeam headlights
Yes #set_highbeams 0 = Off, 1 = On, 2 = Toggle N/A Sets the highbeam headlights to a specific setting
Yes #do_intlights N/A N/A Toggles the interior lights
Yes #indicators 0 = Off, 1 = Left, 2 = Right, 3 = Hazards (Both) N/A Sets the indicators to a specific setting
No #indicator_state 0 = Off, 1 = Left, 2 = Right, 3 = Hazards (Both) N/A Sent when the indicators are updated
Yes #indicator_left N/A N/A Sets the indicators left
Yes #indicator_right N/A N/A Sets the indicators right
Yes #do_simpledoor 0 = Close, 1 = Open, 2 = Toggle Link name of the door Looks for a simple door of name _msg and will set it to state _num
Yes #animation N/A CSV[Avatar key, Animation name] Will play an animation on selected avatar
No #door_state 0 = Closed, 1 = Open Object name of the door Sent when one of the main doors is opened / closed
No #gtfo_loadunload 0 = Unload, 1 = Load N/A Sent when GTFO cargo is loaded or unloaded
No #parking_brake 0 = Released, 1 = Applied N/A Sent when parking brake is applied / released
Yes #aux1/2/3/4/etc N/A N/A Aux button pressed
No #addon_touch Link number touched List#[Key of toucher#Face touched#Anything in the description after ADDON_#] Sent when a link using the addon touch system is touched
Yes passenger_stand N/A Key of avatar Will force seated avatar to stand
Yes #door 0 = Close, 1 = Open Link name of door Force one of the main doors to open / close - Also see #do_simpledoor for a non-main door
Yes #addon_menu N/A Key of avatar Sent to access the rear addon menu - You can use this if you make an addon to open your own menu