[Opensim-dev] Script not working correctly in Opensim
Fritigern Gothly
fritigerngothly at gmail.com
Thu Oct 20 07:35:46 UTC 2011
Hmmm... Why not use osTeleportAgent?
http://opensimulator.org/wiki/OsTeleportAgent
On Thu, Oct 20, 2011 at 9:25 AM, Chris Collins <chris at tipodean.com> wrote:
> I have the following script that is working within SL but does not always
> work in OpenSim. Sometimes it works other times it does not. Can anyone see
> anything that would be causing issues on Opensim
> vector DEST = <130, 182, 36>;
> vector SITPOS = <0,0,0.5>;
> key gAv;
>
> moveTo(vector origin, vector destination ) { // removed jumpdist
> float dist = llVecDist(origin, destination);
> integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );
> integer i;
> list params = [PRIM_POSITION, destination];
> for (i=0; i<passes; i++) {
> params = (params=[]) + params + params;
> }
> llSetPrimitiveParams(params);
> }
>
> teleport(key av) {
> if (av == NULL_KEY)
> {
> return;
> }
>
> vector origin = llGetPos();
> llSetAlpha (0.0, ALL_SIDES);
> moveTo(origin, DEST);
> // no need to sleep -- llSetPrimParams has 0.2s delay
> llUnSit(av);
> moveTo(DEST, origin);
> llSetAlpha (1.0, ALL_SIDES);
> }
>
> default
> {
> state_entry()
> {
> llSetClickAction (CLICK_ACTION_SIT);
> llSitTarget(SITPOS,llEuler2Rot(<0,0,-90> * DEG_TO_RAD));
> }
>
> changed(integer changebits)
> {
> if (changebits & CHANGED_LINK)
> {
> gAv = llAvatarOnSitTarget();
> if (gAv != NULL_KEY)
> {
> teleport(gAv);
> }
> }
> }
> }
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
--
-- Friti
More information about the Opensim-dev
mailing list