Train
This commit is contained in:
@@ -7,57 +7,56 @@
|
||||
// :AUTHOR:Unknown
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2019-08-30 11:39:48
|
||||
// :EDITED:2020-04-10 08:29:30
|
||||
// :ID:1125
|
||||
// :NUM:2012
|
||||
// :REV:1
|
||||
// :REV:2
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Move From point to pint tour guide
|
||||
// :CODE:
|
||||
|
||||
|
||||
float delay = 0.1;
|
||||
|
||||
integer m_STEPS = 64;
|
||||
|
||||
motionTo(vector dest,rotation rot) {
|
||||
integer i;
|
||||
vector currentpos = llGetPos();
|
||||
vector step = (dest - currentpos) / m_STEPS;
|
||||
integer i;
|
||||
vector currentpos = llGetPos();
|
||||
vector step = (dest - currentpos) / m_STEPS;
|
||||
|
||||
for (i = 1;i <= m_STEPS; i++)
|
||||
{
|
||||
if (i == (m_STEPS / 2))
|
||||
{
|
||||
llSetRot(rot);
|
||||
}
|
||||
llSetPos(currentpos + (step * i));
|
||||
for (i = 1;i <= m_STEPS; i++)
|
||||
{
|
||||
if (i == (m_STEPS / 2))
|
||||
{
|
||||
llSetRot(rot);
|
||||
}
|
||||
llSetPos(currentpos + (step * i));
|
||||
|
||||
}
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
}
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
}
|
||||
|
||||
default {
|
||||
state_entry() {
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
}
|
||||
changed(integer what) {
|
||||
if (what & CHANGED_REGION_START){
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
sensor(integer n) {
|
||||
motionTo(llDetectedPos(0) +(llRot2Fwd(m_NEXTROT) / 10),llDetectedRot(0));
|
||||
}
|
||||
no_sensor()
|
||||
{
|
||||
llSetTimerEvent(10);
|
||||
}
|
||||
timer() {
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
|
||||
|
||||
state_entry() {
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
}
|
||||
changed(integer what) {
|
||||
if (what & CHANGED_REGION_START){
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
sensor(integer n) {
|
||||
motionTo(llDetectedPos(0),llDetectedRot(0));
|
||||
}
|
||||
no_sensor()
|
||||
{
|
||||
llSetTimerEvent(10);
|
||||
}
|
||||
timer() {
|
||||
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/4);
|
||||
llSetTimerEvent(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
BIN
Opensim Train/Train/Opensim Train/Object/2021-03-14_101046.jpg
Normal file
BIN
Opensim Train/Train/Opensim Train/Object/2021-03-14_101046.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
10
OpensimTrain/Opensim Train/Opensim Train.prj
Normal file
10
OpensimTrain/Opensim Train/Opensim Train.prj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project name="Opensim Train" guid="08efd93f-0a34-40aa-a109-7ccea2572736">
|
||||
<Object name="Train" guid="af6bb54b-85e8-48b4-abbd-ed925aeea955" active="true">
|
||||
<Script name="LocomotiveScript.lsl" guid="1d100a02-07b9-44c0-8503-aa94fe7c87ee">
|
||||
</Script>
|
||||
<Texture name="2021-03-14_101046.jpg" guid="a923b843-72a5-4691-af4a-c0e07fe8ffe1">
|
||||
</Texture>
|
||||
<Notecard name="Readme.txt" guid="a273d400-f38c-4979-80d7-e3bbeb1e1e08">
|
||||
</Notecard>
|
||||
</Object>
|
||||
</Project>
|
||||
1515
OpensimTrain/Opensim Train/Train/LocomotiveScript.lsl
Normal file
1515
OpensimTrain/Opensim Train/Train/LocomotiveScript.lsl
Normal file
File diff suppressed because it is too large
Load Diff
5
OpensimTrain/Opensim Train/Train/Readme.txt
Normal file
5
OpensimTrain/Opensim Train/Train/Readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
This script works under DREAMGRID! It lives in the root prim of the engine, which in my test case was a box prim of size <9.00000, 1.20000, 0.75029>. The image below shows this moves out from its usual position
|
||||
|
||||
The track I used was some mesh track I found elsewhere, all named "Guide". The reason I've been using it is that as mesh it was easy to just change the size and direction of it when building track. I'm glad this works BETWEEN regions, but you have to be driving it to make anything happen. Ultimately I want to have a "guided tour" vehicle running under the same principles but with a much expanded route across several regions. The old guided tour scripts were OK but couldn't go outside a single region.
|
||||
|
||||
~ Laura
|
||||
3
OpensimTrain/OpensimTrain.sol
Normal file
3
OpensimTrain/OpensimTrain.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="OpensimTrain">
|
||||
<Project name="Opensim Train" path="Opensim Train\Opensim Train.prj" active="true"/>
|
||||
</Solution>
|
||||
Reference in New Issue
Block a user