User:LaniGlobal
From OpenSimulator
Lani Global
LANI GLOBAL SYSTEMS Twitter feed
Lani Global Systems on Twitter http://twitter.com/LaniGlobal
Tweets mainly covering OpenSim, OSGrid, HyperGrid, and 3D Virtual Worlds.
Lani Global OSGrid Photo Gallery
Lani Global - OSGrid Photo Gallery http://gallery.osgrid.org/main.php?g2_itemId=6528
Photos, snapshots, imagery, and art in OSGrid, OpenSim.
OpenSim Communications Projects
SubSpace Communications RP Chat System
Extended long distance Text Chat scripted wearable and rezzable system for: region-chat, region-to-region chat, grid-to-grid, standalone-to-standalone, etc.
Compatible with the OWI Open World Interface by Snoopy Pfeffer running on Dreamland Metaverse OpenSim servers
OpenSim RolePlay Projects
Myriad Lite RolePlay Gaming and Combat System
The Myriad Lite RolePlay Gaming and Combat System was founded by User:Allen_Kerensky, who is also the lead developer and primary code writer for it.
It is an Open Source scripted RolePlay Gaming and Combat System specifically designed to be compatible with OpenSim.
"Myriad Lite is a project to adapt a pen-and-paper role-playing game rulebook into OpenSimulator Xengine and SecondLife Mono scripts, and the related 3D objects, needed to implement a pen-and-paper role-playing game in 3D virtual worlds." -- Allen Kerensky
Lani Global contributions to the Myriad project include: Animations, Textures, HUD Design, Trap Scripts, Alpha and Beta Testing, Collaboration, Promotion and Community Distribution.
OpenSim Community Projects
Sci Fi Hub of OSGrid
A community center for promotion of Science Fiction theme environments in OpenSim. Located in the Lani region in OSGrid. Includes the Sci Fi Teleport Poster Exchange project.
OpenSim Vehicle Projects
Physical Vehicle Designed for OpenSim
In August 2012, Lani Global Systems embarked on a Physical Vehicle project designed specifically for OpenSim. See Lani Physical Vehicle Flight Scripts. Prior to this project, multi-passenger physical vehicles were practically non-existent and unknown to the public in core-dev-OpenSim. To fulfill the cutting edge goals of this project, a new vehicle script was specially written to take advantage of the then-current (OpenSim v0.7.5 dev) working vehicle functions, while simultaneously minimizing previously encountered bugs and failures. The project succeeded. Free distribution to the OpenSim Community was implemented through the release of several boxed-product objects in September 2012:
1. "Ornithopter 3-seater(c)2012 LANI GLOBAL SYSTEMS" Multi-Passenger Physical Flight Vehicle, complete with root prim engine script, multiple special effects scripts, animations, interlock system, lighting, seating, and moving canopy/physical-enclosure. copy/mod/trans.
2. "Physical Flight Vehicle Script Engine (c)2012 LANI GLOBAL SYSTEMS" root prim, open source script, pilot animation. copy/mod/trans.
OpenSim Vehicle Bugs
Known Physical Vehicle Bugs Currently Existing in OpenSim
OpenSim Mantis Report # 0006333: Local Chat Fail for Driver of Vehicle: Sitting Passengers & Vehicle Text Commands http://opensimulator.org/mantis/view.php?id=6333
Pilot / Driver of physical vehicle can not communicate using local chat Say channels with sitting passenger(s) after the vehicle moves more than 20m from the point where the passenger(s) sits on the vehicle. This also affects chat say texting commands by Pilot / Driver to the vehicle. Say text commands from Pilot/Driver to vehicle fail more than 20m from the vehicle Pilot / Driver original point of sit.
The region doesn't seem to update the sitting avatar's location (or the vehicle's location) for chat texting purposes. Tests seem to indicate that the Passenger avatar's texting location remains at the location where the passenger sat on the vehicle.
Other Vehicle Bugs or Not-Yet-Implemented Parameters
Physical vehicle parameters for banking such as VEHICLE_BANKING_EFFICIENCY are not implemented (AFAIK) yet in OpenSim dev physics ODE.
OpenSim Change-Advocacy Projects
Proposed Change Regions_ini Default PhysicalPrimMax 10m to 64m
In the OpenSim simulator settings file: Regions.ini there is a line of the file: ; PhysicalPrimMax = 10
This default should be changed to ; PhysicalPrimMax = 64 to support the widespread use and distribution of physical vehicles content in the OpenSim Community. With more and more mesh being used, this has become an important issue.
The 10 meter prim size is an obsolete standard left over from the old days of SL. The current standard is 64 meter prim size.
Comparison of a mesh physical vehicle normal size using PhysicalPrimMax=64m with a Physical Vehicle forced to be reduced in size due to PhysicalPrimMax = 10m.
PhysicalPrimMax 64m Discussed at OpenSimulator Meeting
09 October 2012 Discussion of PhysicalPrimMax 64m Default Change Proposed at OpenSimulator Meeting in Wright Plaza on 09 October 2012. The PhysicalPrimMax discussion starts at chat log time 11:49. It starts to get interesting at about 11:52.
16 October 2012 Discussion of PhysicalPrimMax 32m Default Change was discussed at OpenSimulator Meeting in Wright Plaza on 16 October 2012. The PhysicalPrimMax discussion starts at chat log time 11:18. It starts to get interesting at about 11:32.
18 February 2014 Since BulletSim Physics is now standard in OpenSim distrubutions and the use of mesh is widespread for vehicles, another suggestion was made to increase the default to 64m. This was discussed at the OpenSim Dev meeting. Discussion of PhysicalPrimMax 64m Default Change Proposed at OpenSimulator Meeting in Wright Plaza on 18 February 2014, The PhysicalPrimMax 64m discussion is at chat log time 11:23 and 11:53 and 12:04.
PhysicalPrimMax Discussed at OSGrid Town Hall Meeting
At the OSGrid Town Hall Meeting on 07 October 2012 , Lani Global presented a proposal to the citizens of OSGrid. The complete transcript of this meeting is available at: http://wiki.osgrid.org/index.php/TownHallMeetingLog20121007
"As many of you know already, LANI GLOBAL SYSTEMS has introduced a new MULTI-PASSENGER PHYSICAL FLIGHT VEHICLE and an open source Physical Flight Script Engine developed for OpenSim / OSGrid. I'm not announcing this to advertise it or boast :) I am saying this because, honestly, most people previously thought that multi-passenger physical vehicles didn't exist in OSGrid. "
"Also, I would like to speak up about an important thing that is HOLDING BACK some talented OSGrid Content Creators in this field of Physical Vehicles (boats, aircraft, spacecraft, automobiles, and amphibious craft). The thing in OSGrid that is now holding back physical vehicle Content Creators is: currently there is a DEFAULT in the OpenSim OSGrid dev simulator (ini) setup file of "Maximum Physical Prim Size = 10metres". This Default prim size is a carryover from the old SL 10m prim size standard. It is now obsolete! Default "Maximum Physical Prim Size = 10metres" is WAY TOO SMALL for the design of multi-passenger Physical Vehicles... especially MESH and Sculpty vehicles, yachts, ships, airplanes, and spacecraft built to-scale."
"I realize that this is a new area of interest. During the past month of development of my open source Physical Flight Script Engine for OpenSim/OSGrid, I have been talking with other vehicle builders in OSGrid, working on converting some of the existing vehicles, and we all are stifled by this 10 metre physical prim default limitation. We now want to propose a NEW DEFAULT for "OSGrid's OpenSim dev version" be changed to "Maximum Physical Prim Size = 64 metres". This is equivalent to the current Maximum Prim Size 64 metres in current (SL) compatible viewers."
"We recognize that it is possible for each simulator owner/operator to set their own Maximum Physical Prim Size to 64 metres. We have changed this setting in some regions and are happy to report that everything works fine with larger physical prim vehicles. However, many people who rent regions in OSGrid or who run their own regions, do not have the skills to change this default. While lone builders and owners of regions can change their own regions' Maximum Physical Prim Size to 64m, it is a different story for Content Creators. Vehicle designers who create free products and put them in the stores for the larger market of the OSGrid Community (and OpenSim HyperGrid Community) must build to whatever is the Default limit! "
"Currently, the Content Creators can not deliver all their wonderful designs for vehicles, and users can't modify or convert their existing vehicles, if even one prim in the vehicle is larger than 10 metres. I argue that this is an obsolete prim size limit that has no place in our open spirit of freedom OSGrid is known for. I'm asking for the support of fellow OSGrid Citizens in respectfully proposing that the obsolete default of 10m physical prims be changed to 64m in future releases of OSGrid OpenSim dev versions. "
Open Letter to the OpenSim Developers
View original open letter proposal, posted on Opensim-dev email list
View this thread on Opensim-dev email list
Dear OpenSim Devs,
Date: 15 October 2012
PROPOSAL TO CHANGE PhysicalPrimMax=32m
This proposes a change to Regions.in file default parameter: PhysicalPrimMax=32m Old parameter was: PhysicalPrimMax=10m This parameter defines the maximum prim size limit (in any dimension x,y or z) at which the prim may be recognized by the region as a physical object. If any dimension of the prim is larger than this limit, the prim fails to become physical.
DISCUSSION AT OPENSIM MEETING
At the OpenSim Meeting last week in Wright Plaza OSGrid, I proposed changing the parameter default to PhysicalPrimMax=64m. However, after taking some data and doing some research testing various sizes and shapes of physical prims, I now propose PhysicalPrimMax=32m instead.
BACKGROUND:
The maximum prim build size using v1 viewers in SL was 10m, but this became obsolete recently with v2 and v3 viewers going to 64m. There has been *no limit* on the size of a physical prim in SL using their Havok physics engine. A mega-prim in SL can be physical (I have successfully tested 1024x1024x1024 physical prims in SL). However, in OpenSim there is good reason to limit physical prim size, mainly due to the simulator physics load causing simulator FPS to slow down.
WHY CHANGE?
Q: Why would we want to change this default value?
A: The primary motivation for changing this is the growing popularity of PHYSICAL VEHICLES in OpenSim. Content creators for the OpenSim community must design their products for the most common default value limits.
WHAT TYPES OF VEHICLES REQUIRE 32m PRIM SIZE?
Built to-scale vehicles require prim sizes larger than 10metres: boats, ships, trains, buses, airplanes, aircraft, spacecraft, automobiles, and amphibious craft. Especially multi-passenger vehicles and vehicles using tortured prims or mesh or sculpties. Tortured prims (path cut, dimpled, tapered) are often used to achieve the curve shapes of vehicles, and this leads to larger prim x,y, or z dimensions (even when the overall vehicle size is less than 10metres). Mesh vehicles tend to require larger prim size; an entire vehicle can be made with 1 mesh model.
BEST PARAMETER VALUE?
32 metres is the proposed best parameter value. It is a compromise based on performance vs the value of having creative content. Certainly 10m prims are safe performance, however, 10m severely limits the existence of vehicle content.
TEST RESULTS
In recent testing of free prims dropped to ground, it was found that there appears to be a "breaking point" in the physics FPS performance with physical prim size larger than 45 metres. When 64 metre torus shaped prims were tested, this brought the physics FPS down to a low level. But, when 32metre prim size torus prims were tested, acceptably good performance was achieved. Of course, physics performance varies considerably among simulators.
DATA:
Please see collected data on size vs. shape on Physics FPS: http://opensimulator.org/wiki/User:LaniGlobal#Proposed_Change_Regions_ini_Default_PhysicalPrimMax_10m_to_64m
CONCLUSION:
A proposal has been presented for a default change. The change would be from an obsolete, but "absolutely safe" default value, to a new value that is closer to the center of compromise in simulator performance, only when larger size physical prims are rezzed by users. The result of this change would yield a huge increase in physical vehicle content in the OpenSim Community.
Respectfully submitted,
Lani Global
Founder/Content Creator, LANI GLOBAL SYSTEMS (tm)
Owner of Lani region of OSGrid, an OpenSim/HG 3-D Virtual Sci Fi World
hg.osgrid.org:80:lani
Lani Global Regions in Opensim OSGrid and HyperGrid
Lani
Lani region of OSGrid is one of the most popular places in OpenSim. Creative Content for the OpenSim Community is developed and distributed. The Science Fiction environment features the Lani Global Systems Sci Fi Store, Lani Mall, the Sci Fi Hub of OSGrid, a RolePlay RP environment, RolePlay Gaming, Spacecraft Landing Docks, and the Alpha Station space station home pods for RP players. The Central Pyramid is a community center and gathering point for the Sci Fi Community of OpenSim. Lani region runs on a server by sim hosting company Dreamland Metaverse. It is HyperGrid enabled, in the Middle Realm at 8090,8090 grid coordinates. Some photo images and a real time graph of daily visitor count to Lani region can be found on the web at Most Popular Region of OSGrid
ixi
ixi region of OSGrid is a very popular Sci Fi sandbox area adjacent to Lani region. Creative Content for the OpenSim Community is designed, tested, and developed. ixi is well known for sandbox and RP Combat. ixi region is sponsored by Dreamland Metaverse , an OpenSim server sim hosting company. Changing rooms are provided for avatars. The Great Hall of Combat has seen hundreds of battles and duels fought. Research and development of vehicles. Myriad RP Gaming and Combat System is developed and tested. It is HyperGrid enabled, in the Middle Realm at 8089,8090 grid coordinates. Some photo images and a real time graph of daily visitor count to ixi region can be found on the web at ixi Region OSGrid visitor graph
Lani Global Systems LSL Scripts
Lani Physical Vehicle Flight Scripts for ODE
A physical flight hover vehicle engine and various accessory scripted parts for the vehicle child prims are presented here. The scripts are designed and intended for use in OpenSim. These scripts have been thoroughly tested and used in many vehicles in OpenSim, with the OpenDynamicsEngine (ODE) physics engine.
These scripts are suitable for: Spacecraft, Hovercraft, Hoverpod, HoverJet, Helicopter, Ornithopter, Submarine, Flying Wing, Airplane, Aeroplane, Whirly Bird, Magic Carpet, Starships, Death Stars, Galactic Ships, Space Ships, Spaceship, UFO, Unidentified Flying Objects, Flying Saucers, and other types of vehicles.
A kit with a demonstration vehicle (Ornithopter) and all the parts (Engine, accessories, animations, sounds, etc) is available in the Lani Global Systems store, in Lani Mall. The mall is located in Lani region of OSGrid. HyperGrid hg.osgrid.org:80:lani
Lani Physical Vehicle Flight Engine v3 for ODE
This is the engine script. This script goes in the contents of the root prim, the "seat cushion" that the pilot of the vehicle sits on. This script needs a sitting animation and 2 sounds to be functional. (Note: the engine in this script kit is designed for use with OpenDynamicsEngine (ODE) physics engine, not for BulletSim Physics Engine. For scripts designed for BulletSim Physics Engine, please see other sections of this page in the future.)
// Lani_Physical_Vehicle_Flight_Engine_v3_for_ODE.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // Basil Sosides: early phys proto functions demo. // Vegaslon Plutonian: development of OpenSim ODE phys vehicle banking/tilt. // // =================================================================================== // This engine is designed for use with OpenSim physics Open Dynamics Engine ODE only. // =================================================================================== // // GLOBAL VARIABLES // string sit_message = "Fly"; //Sit message string not_owner_message = "Sorry. You are not the owner."; //Not owner message string PILOTANIM ="LaniPilotSit8"; // Anim for pilot string TITLE=""; //floating text string SOUND1 = "HOVER"; //sound for engine string SOUND2 = "AirHiss";// sound for turning // // GLOBAL VARIABLES FOR PILOT SEATING AND CAMERA VIEWPOINT // vector SIT_POSITION = <-0.0,0.0,-0.21>; // position of pilot on sit prim vector SIT_ROTATION_B = <0,0,90>; // rotation of pilot on sit prim integer Private = 1; // 1 = Owner Only Pilot. 0= Anyone can be Pilot. float CAM_ZOOM = 17.0; // How far back the pilot's camera follows (default = 17.0 meters) float CAM_ANGLE = 20.0; // Vertical angle pilot's camera follows (defaul - 20.0 degrees) // // GLOBAL VARIABLES FOR SPECIAL EFFECTS LINK MESSAGES // // Link Comms Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX integer CHANNEL_NUMBER = 1; // initial link comms channel number to send on integer ON_STATUS1 = FALSE; // set up the status so it starts in the OFF condition string OFF_MESSAGE = "STATUS_OFF"; // status off message to send to other prims string ON_MESSAGE = "STATUS_ON"; // status on message to send to other prims string RIGHT_MESSAGE = "STATUS_RIGHT"; // status right message to send to other prims string LEFT_MESSAGE = "STATUS_LEFT"; // status left message to send to other prims string FORWARD_MESSAGE = "STATUS_FORWARD"; // status forward message to send to other prims string REVERSE_MESSAGE = "STATUS_REVERSE"; // status reverse message to send to other prims string ONSAY1 = " ON"; // text to announce the on status string OFFSAY1 = " OFF"; // text to announce the off status // // GLOBAL VARIABLES FOR VEHICLE MOTION float POWER_FORWARD = 12; //Power for forward (1 to 30) float POWER_REVERSE = 12; //Power for reverse (-1 to -30) integer hr = 2; // initial climb rate integer hrm = 8; // Maximum climb rate float angz = 1.0; // Sharpness of turns/curves (practical values 0.5 to 1.0) float ALTITUDE; float THRUST; integer RUN; rotation SIT_ROTATION; key AVATAR_B; key AVATAR; float SPEED; integer OFFSET; integer HELD; //---------------------------------------------------------------------------------------------- SETUP_CAMERA(float degrees) { rotation sitRot = llAxisAngle2Rot(<0, 0, 1>, degrees * PI); llSetCameraParams([ CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive CAMERA_BEHINDNESS_ANGLE, 0, // (0 to 180) degrees CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds CAMERA_DISTANCE, CAM_ZOOM, // ( 1 to 30) meters CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds CAMERA_FOCUS_LOCKED,FALSE, // (FALSE) CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters CAMERA_PITCH, CAM_ANGLE, // (-45 to 80) degrees CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE) CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters CAMERA_FOCUS_OFFSET, <0,0,3> // <-10,-10,-10> to <10,10,10> meters ]); } SETUP_VEHICLE() { //Type llSetVehicleType(VEHICLE_TYPE_BOAT); //Float llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, ALTITUDE); llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.1); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 2.0); //Vector llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <0.01, 0.01, angz>); llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <100.0, 2.0, 1000.0>); } INITIALIZE() { RUN = 0; vector posv = llGetPos(); ALTITUDE = posv.z - 19.75; llSetVehicleType(VEHICLE_TYPE_BOAT); llSetStatus(STATUS_PHANTOM, FALSE); llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PRIM_PHANTOM,FALSE]); llSetStatus(STATUS_PHYSICS, FALSE); vector rotv = llRot2Euler(llGetRot()); rotation rot = llEuler2Rot(<0,0,rotv.z>); llSetRot(rot); SIT_ROTATION = llEuler2Rot(DEG_TO_RAD * SIT_ROTATION_B); } default { state_entry() { INITIALIZE(); llSetSitText(sit_message); llSetText(TITLE, <0.5, 0.5, 0.5>, 0.3); llSitTarget(SIT_POSITION, SIT_ROTATION); SETUP_CAMERA(0.01); llSetTimerEvent(0.3); llMessageLinked(LINK_ALL_OTHERS, 1, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 2, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 3, ON_MESSAGE, NULL_KEY); //send off message to linked prims } on_rez(integer rn) { llResetScript(); llSetPos(llGetPos() + <0,0,0.5>); llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PRIM_PHANTOM,FALSE]); llMessageLinked(LINK_ALL_OTHERS, 1, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 2, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 3, ON_MESSAGE, NULL_KEY); //send off message to linked prims } changed(integer change) { if ((change & CHANGED_LINK) == CHANGED_LINK) { AVATAR = llAvatarOnSitTarget(); if (AVATAR != NULL_KEY) { if( (AVATAR != llGetOwner()) & (Private == 1)) { llSay(0, not_owner_message); llUnSit(AVATAR); llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 4, ON_MESSAGE, NULL_KEY); //send on message to allow canopy } else { llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PRIM_PHANTOM,FALSE]); llSetStatus(STATUS_PHYSICS, TRUE); llSetLinkPrimitiveParams(LINK_ALL_OTHERS, [PRIM_PHYSICS,TRUE]); AVATAR_B = AVATAR; SETUP_VEHICLE(); llSetTimerEvent(0.3); llRequestPermissions(AVATAR, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS | PERMISSION_CONTROL_CAMERA); RUN = 1; OFFSET=0; llSetTimerEvent(0.001); } } else { RUN = 0; llReleaseControls(); llStopAnimation(PILOTANIM); INITIALIZE(); llSetPos(llGetPos() + <0,0,0.0>); llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 1, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 2, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 3, ON_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 4, ON_MESSAGE, NULL_KEY); //send on message to allow canopy } } } run_time_permissions(integer perm) { if (perm) { llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_DOWN | CONTROL_UP | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE); THRUST = POWER_FORWARD; llPlaySound(SOUND1,1.0); llSetPos(llGetPos() + <0,0,0.1>); llStartAnimation(PILOTANIM); llOwnerSay("You are flying! use arrows Up/Down/Left/Right.\nAlt-Click on vehicle to adjust camera.\nStand up to stop."); SETUP_CAMERA(0.5); llSetTimerEvent(0.3); llMessageLinked(LINK_ALL_OTHERS, 1, ON_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 3, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 4, OFF_MESSAGE, NULL_KEY); //send off message to not allow canopy } else { llReleaseControls(); llSetTimerEvent(0.3); llMessageLinked(LINK_ALL_OTHERS, 1, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 2, OFF_MESSAGE, NULL_KEY); //send off message to linked prims llMessageLinked(LINK_ALL_OTHERS, 3, ON_MESSAGE, NULL_KEY); //send on message to linked prims llMessageLinked(LINK_ALL_OTHERS, 4, ON_MESSAGE, NULL_KEY); //send on message to allow canopy } } control(key id, integer level, integer edge) { if(RUN == 0) { return; } vector ANGLE_MOTOR; vector vel = llGetVel(); // Current velocity SPEED = llVecMag(vel); // Speed // MOVEMENT DIRECTION CONTROLS if ((level & edge & CONTROL_UP) || ((level & CONTROL_UP))) { ALTITUDE = ALTITUDE + hr; if(ALTITUDE > 8500) {ALTITUDE = 8500;} llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, ALTITUDE); llMessageLinked(LINK_ALL_OTHERS, 1, FORWARD_MESSAGE, NULL_KEY); //send forward message to linked prims } if ((level & edge & CONTROL_DOWN) || ((level & CONTROL_DOWN))) { ALTITUDE = ALTITUDE - hr; if(ALTITUDE < 2) {ALTITUDE = 2;} llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, ALTITUDE); llMessageLinked(LINK_ALL_OTHERS, 1, REVERSE_MESSAGE, NULL_KEY); //send reverse message to linked prims } if(level & CONTROL_FWD) { THRUST = POWER_FORWARD; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <0,THRUST,0>); llMessageLinked(LINK_ALL_OTHERS, 1, FORWARD_MESSAGE, NULL_KEY); //send forward message to linked prims } if(level & CONTROL_BACK) { THRUST = POWER_REVERSE; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <0,-THRUST,0>); llMessageLinked(LINK_ALL_OTHERS, 1, REVERSE_MESSAGE, NULL_KEY); //send reverse message to linked prims } // right/left if(level & CONTROL_ROT_RIGHT) { ANGLE_MOTOR.z -= 0.5 + SPEED / (8 * THRUST); OFFSET=10; HELD=1; llMessageLinked(LINK_ALL_OTHERS, 1, RIGHT_MESSAGE, NULL_KEY); //send on message to linked prims } if(level & CONTROL_ROT_LEFT) { ANGLE_MOTOR.z += 0.5 + SPEED / (8 * THRUST); OFFSET=-10; HELD=1; llMessageLinked(LINK_ALL_OTHERS, 1, LEFT_MESSAGE, NULL_KEY); //send on message to linked prims } // Params for angular llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, ANGLE_MOTOR); } timer() { if(HELD==0) OFFSET=0; HELD=0; rotation angl = llGetRot(); vector rotv1 = llRot2Euler(angl); rotation rot1 =llEuler2Rot(<0,DEG_TO_RAD*OFFSET,0>)* llEuler2Rot(<0,0,rotv1.z>) ; llRotLookAt(rot1,0.02, 0.8); } }
Lani Vehicle Head Lights v3
This is the vehicle lighting script. It goes in the contents of a child prim object that performs the vehicle headlights lighting.
// Lani_Vehicle_Lights_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // SPECIAL EFFECT: VEHICLE LIGHTS // GLOBAL VARIABLES FOR SPECIAL EFFECTS (SFX) float LIGHT_GLOW = 0.05; // level of glow (default = 0.15 ; practical range = 0.02 to 0.3) float LIGHT_INTENSITY = 1.0;// intensity of light when on (default = 1.0; practical range = 0.1 to 1.0) float LIGHT_DISTANCE = 20.0;// distance of light when on (default = 20.0; practical range = 4.0 to 20.0) vector LIGHT_COLOR = <0.7, 0.7, 1.0> ; // color of the light emitted <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) vector ON_COLOR_PRIM = <0.7, 0.7, 1.0> ; // color of the prim when on <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) vector OFF_COLOR_PRIM = <0.7, 0.7, 1.0> ; // color of the prim when off <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) float ON_ALPHA = 0.1; // transparency of prim when on (default = 0.2 ; practical range = 0.1 to 1.0) float OFF_ALPHA = 0.0; // transparency of prim when off (default = 0.0 ; practical range = 0.1 to 1.0) // // GLOBAL STANDARD Link Message Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX // 8 = Lights integer CHANNEL_NUMBER = 8; // link comms channel number string OFF_MESSAGE = "STATUS_OFF"; // status off message string ON_MESSAGE = "STATUS_ON"; // status on message default { state_entry() { } link_message(integer SENDER, integer CHANNEL, string MESSAGE, key ID) { if ( CHANNEL== CHANNEL_NUMBER ) // check the channel number { if ( MESSAGE == OFF_MESSAGE ) // check for message { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR, 0.0, LIGHT_DISTANCE, 0.75]); //<R,G,B>,INTENSITY,RADIUS,FALLOFF llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, 0.0 ] ); // sets no glow of the prim llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, OFF_COLOR_PRIM,OFF_ALPHA]); //sets the off color of the prim } // end of check for message if ( MESSAGE == ON_MESSAGE ) // check for message { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR, LIGHT_INTENSITY, LIGHT_DISTANCE, 0.75]); //<R,G,B>,INTENSITY,RADIUS,FALLOFF llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, LIGHT_GLOW ] ); // sets the on glow of the prim llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, ON_COLOR_PRIM,ON_ALPHA]); //sets the on color of the prim } // end of check for message } // end of check the channel number } // end of link_message }// end of default state // end of script
Lani Vehicle Running Lights v3
This is the vehicle running lights script. It goes in the contents of a child prim object that performs the vehicle red running lights.
// Lani_Vehicle_Running_Lights_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // // SPECIAL EFFECT: VEHICLE RUNNING LIGHTS - RED COLOR // GLOBAL VARIABLES FOR SPECIAL EFFECTS (SFX) float LIGHT_GLOW = 1.0; // level of glow (default = 0.15 ; practical range = 0.02 to 0.3) float LIGHT_INTENSITY = 1.0;// intensity of light when on (default = 1.0; practical range = 0.1 to 1.0) float LIGHT_DISTANCE = 5.0;// distance of light when on (default = 20.0; practical range = 4.0 to 20.0) vector LIGHT_COLOR = <1.0, 0.0, 0.0> ; // color of the light emitted <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) vector ON_COLOR_PRIM = <1.0, 0.0, 0.0>; // color of the prim when on <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) vector OFF_COLOR_PRIM = <1.0, 0.0, 0.0> ; // color of the prim when off <RED,GREEN,BLUE> (black = <0.0,0.0,0.0>; white =<1.0,1.0,1.0>) float ON_ALPHA = 1.0; // transparency of prim when on (default = 0.2 ; practical range = 0.1 to 1.0) float OFF_ALPHA = 0.0; // transparency of prim when off (default = 0.0 ; practical range = 0.1 to 1.0) // // GLOBAL STANDARD Link Message Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX // 8 = Lights integer CHANNEL_NUMBER = 8; // link comms channel number string OFF_MESSAGE = "STATUS_OFF"; // status off message string ON_MESSAGE = "STATUS_ON"; // status on message default { state_entry() { } link_message(integer SENDER, integer CHANNEL, string MESSAGE, key ID) { if ( CHANNEL== CHANNEL_NUMBER ) // check the channel number { if ( MESSAGE == OFF_MESSAGE ) // check for message { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR, 0.0, LIGHT_DISTANCE, 0.75]); //<R,G,B>,INTENSITY,RADIUS,FALLOFF llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, 0.0 ] ); // sets no glow of the prim llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, OFF_COLOR_PRIM,OFF_ALPHA]); //sets the off color of the prim } // end of check for message if ( MESSAGE == ON_MESSAGE ) // check for message { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR, LIGHT_INTENSITY, LIGHT_DISTANCE, 0.75]); //<R,G,B>,INTENSITY,RADIUS,FALLOFF llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, LIGHT_GLOW ] ); // sets the on glow of the prim llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, ON_COLOR_PRIM,ON_ALPHA]); //sets the on color of the prim } // end of check for message } // end of check the channel number } // end of link_message }// end of default state // end of script
Lani Vehicle Lighting Touch Switch v3
This is the vehicle lighting touch switch. It goes in the contents of a child prim object that can be touched to turn on/off the vehicle lighting. Normally this is a prim button on the dashboard or control console of the vehicle. This can also be edited to perform other linked message tasks. See script linked message channel notes.
// Lani_Vehicle_Lighting_Touch_Switch_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // GLOBAL VARIABLES integer CHAT_CHANNEL = 0; // command chat channel string CHAT_ON_COMMAND = "lights on"; // command for on string CHAT_OFF_COMMAND = "lights off"; // command for OFF integer CHANNEL_NUMBER = 8; // link comms channel number to send on integer ON_STATUS = FALSE; // set up the status so it starts in the OFF condition string OFF_MESSAGE = "STATUS_OFF"; // status off message to send to other prims string ON_MESSAGE = "STATUS_ON"; // status on message to send to other prims string ONSAY = " ON"; // text to announce the on status string OFFSAY = " OFF"; // text to announce the off status vector ON_COLOR = <0.5, 0.5, 1.0>; // color when on vector OFF_COLOR = <0.2, 0.0, 0.0>; // color when off // GLOBAL STANDARD LINK MESSAGE CHANNELS // 1 = CENTER Thruster SFX // 2 = Wing Thrusters SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX // 8 = Lights // 9 = Weapons // 10= Other Stuff // STATUS MODES STATUS_ON() { llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, ON_MESSAGE, NULL_KEY); //send on message to linked prims llOwnerSay(ONSAY + " by "+ llDetectedName(0)+ "." ); // announce the on status llSetPrimitiveParams([ PRIM_COLOR, ALL_SIDES, ON_COLOR,1.0, PRIM_GLOW, ALL_SIDES, 0.15 ]); //sets the prim glow on and the on color } STATUS_OFF() { llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, OFF_MESSAGE, NULL_KEY); //send on message to linked prims llOwnerSay(OFFSAY + " by "+ llDetectedName(0)+ "." ); // announce the on status llSetPrimitiveParams([ PRIM_COLOR, ALL_SIDES, OFF_COLOR,1.0, PRIM_GLOW, ALL_SIDES, 0.0 ]); //sets the prim glow off and the prim off color } default { on_rez(integer start_param) { STATUS_OFF(); } state_entry() { llListen( CHAT_CHANNEL, "", NULL_KEY, "" ); } touch_start(integer nullvar) { if ( ON_STATUS ) // if status is on { ON_STATUS = FALSE; // turn status off // llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, OFF_MESSAGE, NULL_KEY); //send off message to linked prims // llSay(0,OFFSAY1); // announce the off status STATUS_OFF(); } // end the on status false if else // else turn status off { ON_STATUS = TRUE; // turn status on // llMessageLinked(LINK_ALL_OTHERS, CHANNEL_NUMBER, ON_MESSAGE, NULL_KEY); //send on message to linked prims // llSay(0,ONSAY1); // announce the on status STATUS_ON(); } // end the on status true else } // end of touch_start listen( integer CHANNEL, string NAME, key ID, string MESSAGE ) { if (CHANNEL == CHAT_CHANNEL ) { //llSay(0," received a message on channel " + (string)CHAT_CHANNEL); if (MESSAGE == CHAT_ON_COMMAND) { ON_STATUS = TRUE; // turn status on STATUS_ON(); } if (MESSAGE == CHAT_OFF_COMMAND) { ON_STATUS = FALSE; // turn status off STATUS_OFF(); } } } // end listen state } // end default state
Lani Vehicle Landing Gear v3
This is the vehicle landing gear script. It goes in the contents of a child prim object that is the landing gear that is "extended" or appears whenever the pilot is not seated. Normally this script is is a prim button on the dashboard or control console of the vehicle.
// Lani_Vehicle_Landing_Gear_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // Special Effects Link Message Receiver Slave for Link Sets. // Used in LANI GLOBAL SYSTEMS vehicles and gear. // See attached license. // Developed by LANI GLOBAL SYSTEMS LABORATORIES in Lani and ixi regions OSGrid. // // SPECIAL EFFECT: VEHICLE LANDING GEAR // GLOBAL VARIABLES FOR SPECIAL EFFECTS (SFX) string ONSAY1 = " ON"; // text to announce the flip status string OFFSAY1 = " OFF"; // text to announce the flop status string SOUND_EFFECT1 = "HOVER"; // sound triggered for sound effect 1 string SOUND_EFFECT2 = "AirHiss"; // sound triggered for sound effect 2 float ANIM_SPEED = 0.10; // animated texture speed // // GLOBAL VARIABLES FOR LINK MESSAGES // // Link Comms Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX integer CHANNEL_NUMBER = 3; // initial link comms channel number integer ON_STATUS1 = FALSE; // status flag starts flop (flip=TRUE flop=FALSE) integer ON_STATUS2 = FALSE; // status2 flag starts flop (flip=TRUE flop=FALSE) string OFF_MESSAGE = "STATUS_OFF"; // status off message string ON_MESSAGE = "STATUS_ON"; // status on message string RIGHT_MESSAGE = "STATUS_RIGHT"; // status right message string LEFT_MESSAGE = "STATUS_LEFT"; // status left message string FORWARD_MESSAGE = "STATUS_FORWARD"; // status forward message string REVERSE_MESSAGE = "STATUS_REVERSE"; // status reverse message default { on_rez(integer start_param) { llResetScript(); // reset to initialize } state_entry() { llSetAlpha(1.0, ALL_SIDES); // perform action on the prim 100% visible } link_message(integer SENDER, integer CHANNEL, string MESSAGE, key ID) { if ( CHANNEL== CHANNEL_NUMBER ) // check the channel number { if ( MESSAGE == ON_MESSAGE ) // check for message { llSetAlpha(1.0, ALL_SIDES); // perform action on the prim 100% visible llTriggerSound(SOUND_EFFECT2,0.5); // trigger the sfx sound2 } // end of check for message if ( MESSAGE == OFF_MESSAGE ) // check for message { llSetAlpha(0.0, ALL_SIDES); // perform action on the prim 0% visible } // end of check for message } // end of check the channel number } // end of link_message }// end of default state // end of script
Lani Vehicle Propeller Thruster v3
This is the vehicle propeller thruster script. It goes in the contents of a child prim object that is the fan propeller gear that rotates when the vehicle is moved in certain directions. Normally this script is in a prim on the vehicle that has a circular texture that is animated by this script. It could be modified to provide rotation of the propeller via llTargetOmega or another method.
// Lani_Vehicle_Propeller_Thruster_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // Special Effects Link Message Receiver Slave for Link Sets. // Used in LANI GLOBAL SYSTEMS vehicles and gear. // // SPECIAL EFFECT: VEHICLE RIGHT THRUSTER // GLOBAL VARIABLES FOR SPECIAL EFFECTS (SFX) string ONSAY1 = " ON"; // text to announce the flip status string OFFSAY1 = " OFF"; // text to announce the flop status string SOUND_EFFECT1 = "HOVER"; // sound triggered for sound effect 1 string SOUND_EFFECT2 = "AirHiss"; // sound triggered for sound effect 2 float ANIM_SPEED = 0.1; // animated texture speed (default = 0.1 ; practical range = 0.01 to 2.0) // // GLOBAL VARIABLES FOR LINK MESSAGES // // Link Comms Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX integer CHANNEL_NUMBER = 1; // initial link comms channel number integer ON_STATUS1 = FALSE; // status flag starts flop (flip=TRUE flop=FALSE) integer ON_STATUS2 = FALSE; // status2 flag starts flop (flip=TRUE flop=FALSE) string OFF_MESSAGE = "STATUS_OFF"; // status off message string ON_MESSAGE = "STATUS_ON"; // status on message string RIGHT_MESSAGE = "STATUS_RIGHT"; // status right message string LEFT_MESSAGE = "STATUS_LEFT"; // status left message string FORWARD_MESSAGE = "STATUS_FORWARD"; // status forward message string REVERSE_MESSAGE = "STATUS_REVERSE"; // status reverse message default { on_rez(integer start_param) { llResetScript(); // reset to initialize } state_entry() { } link_message(integer SENDER, integer CHANNEL, string MESSAGE, key ID) { if ( CHANNEL== CHANNEL_NUMBER ) // check the channel number { if ( MESSAGE == FORWARD_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, ANIM_SPEED*TWO_PI); // perform action on the prim } // end of check for message if ( MESSAGE == REVERSE_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, -ANIM_SPEED*TWO_PI); // perform action on the prim } // end of check for message if ( MESSAGE == RIGHT_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, ANIM_SPEED*TWO_PI); // perform action on the prim // llTriggerSound(SOUND_EFFECT2,0.5); // trigger the sfx sound2 } // end of check for message if ( MESSAGE == LEFT_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, ANIM_SPEED*TWO_PI); // perform action on the prim // llTriggerSound(SOUND_EFFECT2,0.5); // trigger the sfx sound2 } // end of check for message if ( MESSAGE == OFF_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 0.0*TWO_PI); // perform off message action on the prim llStopSound(); // stop all sounds } // end of check for message if ( MESSAGE == ON_MESSAGE ) // check for message { llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 0.0*TWO_PI); // perform on message action on the prim llLoopSound(SOUND_EFFECT1,1.0); // loop the sfx sound1 } // end of check for message } // end of check the channel number } // end of link_message }// end of default state // end of script
Lani Vehicle Brake v3
This is the vehicle brake script. Put this in a small child prim to be used as a button on the dashboard or control console of the vehicle. Touch it after the flight to stop the vehicle just before the pilot un-sits. This will stabilize the vehicle so it does not move after the pilot gets up.
// Lani_Vehicle_Brake_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // Special Effects Link Message Receiver Slave for Link Sets. // Used in LANI GLOBAL SYSTEMS vehicles and gear. // Put this in a small child prim as a button on the dashboard or control console of the vehicle. // Touch it after the flight to stop the vehicle just before the pilot un-sits. // This will stabilize the vehicle. string SOUND1 = "hydraulic_air_door_LANI_GLOBAL"; // Action sound name float VOLUME1 = 0.5; // Volume level of action sound (0.0~1.0) default=0.5 integer is_open = FALSE; // assume brake state default { state_entry() { llSetPrimitiveParams ([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.001, 1.0, 0.0>, 9.5, <0.0, 0.0, 0.1>, <0.0, 1.0, 0.0>]); llSetStatus(STATUS_PHANTOM,FALSE ); llSetText("Brake\nTouch",<1,0,0>,0.2); } // end of state_entry state touch_start(integer nullvar) { if ( is_open ) { // it's open, so close it is_open = FALSE; llTriggerSound(SOUND1, VOLUME1); llSetPrimitiveParams ([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.001, 1.0, 0.0>, 9.5, <0.0, 0.0, 0.1>, <0.0, 1.0, 0.0>]); llSay(0,"Engaged"); //llSetStatus(STATUS_PHANTOM,FALSE ); // llSetStatus(STATUS_PHYSICS,TRUE ); } else { // it's closed so open it is_open = TRUE; llTriggerSound(SOUND1, VOLUME1); llSetPrimitiveParams ([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.003, 1.0, 0.0>, 9.5, <0.0, 0.0, 0.1>, <0.0, 1.0, 0.0>]); llSay(0,"Engaged"); //llSetStatus(STATUS_PHANTOM,FALSE ); // llSetStatus(STATUS_PHYSICS,TRUE ); } } // end of touch_start state }// END //
Lani Vehicle Spherical Touch Canopy v3
This is the vehicle canopy that can be touched to open and close to provide entry and exit of avatars for the vehicle. Put this in a child prim and add a transparent texture. It is interlocked via link message so that it does not operate while the pilot is seated.
// Lani_Vehicle_Spherical_Touch_Canopy_v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // Special Effects Link Message Receiver Slave for Link Sets. // Used in LANI GLOBAL SYSTEMS vehicles and gear. // See attached license. // Developed by LANI GLOBAL SYSTEMS LABORATORIES in Lani and ixi regions OSGrid. // // GLOBAL VARIABLES FOR SPECIAL EFFECTS (SFX) string OPENSAY1 = " OPEN"; // text to announce the flip status string CLOSEDSAY1 = " CLOSED"; // text to announce the flop status string SOUND_EFFECT1 = "hydraulic_air_door_LANI_GLOBAL"; // Action sound name float VOLUME1 = 0.5; // Volume level of action sound (0.0~1.0) default=0.5 integer IS_OPEN = FALSE; // assume sphere hatch starts out closed (default:FALSE) // // GLOBAL VARIABLES FOR LINK MESSAGES // // Link Comms Channels // 1 = Thrusters SFX // 2 = Lights SFX // 3 = Landing Gear SFX // 4 = Canopy SFX // 5 = Brake SFX // 6 = Instrument Panel SFX // 7 = Auxiliary SFX integer CHANNEL_NUMBER = 4; // initial link comms channel number integer CANOPY_ALLOW = TRUE; // allow canopy operation status flag starts flop (default=TRUE) string OFF_MESSAGE = "STATUS_OFF"; // status off message string ON_MESSAGE = "STATUS_ON"; // status on message default { on_rez(integer start_param) { llResetScript(); // reset to initialize } state_entry() { CANOPY_ALLOW = TRUE; // status flag starts flop (flip=TRUE llSay(0," initialized & unlocked."); } link_message(integer SENDER, integer CHANNEL, string MESSAGE, key ID) { if ( CHANNEL== CHANNEL_NUMBER ) // check the channel number { if ( MESSAGE == ON_MESSAGE ) // check for message { CANOPY_ALLOW = TRUE; // flip the canopy allow flag llSay(0," unlocked."); } // end of check for message if ( MESSAGE == OFF_MESSAGE ) // check for message { CANOPY_ALLOW = FALSE; // flop the canopy allow flag // llSay(0," is locked due to: Pilot is seated."); } // end of check for message } // end of check the channel number } // end of link_message touch_end(integer num_detected) { if ( CANOPY_ALLOW ) // if canopy touch action is allowed { if (IS_OPEN) { // already open so do this stuff llTriggerSound(SOUND_EFFECT1, VOLUME1); llSetPrimitiveParams ([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.001, 1.0, 0.0>, 9.5, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>]); // close the canopy prim llSay(0," CLOSED. by "+ llDetectedName(0) + "."); llSetStatus(STATUS_PHANTOM,FALSE ); // be sure prim stays non phantom IS_OPEN = FALSE; // flip is open flag } // end of if is open else // already closed so do this stuff { llTriggerSound(SOUND_EFFECT1, VOLUME1); llSetPrimitiveParams ([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.3, 0.92, 0.0>, 9.5, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>]); // open the canopy prim llSay(0," OPENED. by "+ llDetectedName(0)+ "."); llSetStatus(STATUS_PHANTOM,FALSE ); // be sure prim stays non phantom IS_OPEN = TRUE; // flop is open flag // llSleep(0.5); // llSetStatus(STATUS_PHYSICS,TRUE ); } // end of else already closed } // end of if canopy allowed if ( ! CANOPY_ALLOW ) { llSay(0," touched by "+ llDetectedName(0)+". Sorry, canopy locked while pilot seated."); } // end of touch canopy touch action not allowed } // end of touch_start state }// end of default state // end of script
Lani Vehicle Passenger Seat v3
This is the vehicle passenger seat script. Vehicles can have multiple passenger seats. Put this in all the child prim seats where the passengers are to be seated. It requires an animation in the contents of the prim.
// Lani_Vehicle_Passenger_Seat v3.lsl // (c)2014 LANI GLOBAL SYSTEMS. All rights reserved. // =============================================================== // Offered under license: // Atribution-NonCommercial CC BY-NC // =============================================================== // Developed by LANI GLOBAL SYSTEMS in Lani and ixi regions OSGrid. // HyperGrid hg.osgrid.org:80:lani // Images http://gallery.osgrid.org/ // Website http://opensimulator.org/wiki/User:LaniGlobal // Twitter https://twitter.com/LaniGlobal // Inspiration for this script is from various sources. // Script Credits: // Lani Global: implementation in OpenSim of physical vehicle, linked controls, and FX. // GLOBALS key avatar; vector pos = <1.35,0.0,-0.5>; //position offset. note: must not be <0,0,0> rotation rot = <1,1,1,1>; //rotation offset. note: 1=90 degrees string anim = "SitCommandChair2aZero"; //name of the anim. note: must be in Contents of the prim default { state_entry() { llSitTarget(pos, rot); // set the sit target position/rotation } changed(integer change) //trigger on change { avatar = llAvatarOnSitTarget(); //get the avatar's key if(change & CHANGED_LINK) // is avatar sitting on prim? { if(avatar == NULL_KEY) // avatar is not sitting on prim { llStopAnimation(anim); //stop the animation llReleaseControls(); //release anim control llSleep(0.05);//sleep to allow release of control llStopAnimation(anim); //stop the animation again in case of lag llReleaseControls(); //release anim control again in case of lag llResetScript(); //reset the script } else if(avatar == llAvatarOnSitTarget()) //avatar is sitting on prim { llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION ); //get permission and run the anim llInstantMessage(llAvatarOnSitTarget(),"Use SubSpace Communicator for local chat"); llOwnerSay(llKey2Name(llAvatarOnSitTarget()) + " is sitting.\n Use SubSpace Communicator to text chat with "+ llKey2Name(llAvatarOnSitTarget()) +"." ); // announce } } } run_time_permissions(integer perms) // permissions to animate { if(perms) //assume permissions to animate { llStopAnimation("sit"); //stop normal sit anim llStartAnimation(anim); //start running the anim llSleep(0.05);//sleep to allow anim to start llStartAnimation(anim); //start running the anim again in case of lag } else { llUnSit(avatar); //if permissions not granted to animate then unsit the avatar } } }