Open Source Platform
for interconnected virtual worlds

Content Scripting Python Primitive

From RexWiki

Changing scale

All the functions that are available in OpenSim LSL are also available in Python. So if you want to set the scale of the object, you can use the llSetScale, setting rotation happens with llSetRot, etc. In Python script you are naturally writing all script in python so changing the scale randomly when someone touches the prim looks like this:

import rxactor
import rxavatar
import sys
import clr

asm = clr.LoadAssemblyByName('OpenSim.Region.ScriptEngine.Common')
Vector3 = asm.OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3

import random
import math

class ScaleTest(rxactor.Actor):
    def GetScriptClassName():
        return "scaling.ScaleTest"

    def EventTouch(self,vAvatar):
        scalex = 0.5 + random.random()
        scaley = 0.5 + random.random()*2
        scalez = 0.5 + random.random()*3
        tempscale = Vector3(scalex,scaley,scalez)
        self.llSetScale(tempscale)