On Mar 7, 8:55 am, Jani Pirkola <[email protected]> wrote:
> I think the problem is that you are not addressing the right material slot:
> self.RexSetMaterialByName(1," picture1")
> The first parameter "1" may be the material index, so you could try to use
> "0" there instead to address the first material.
>

Hi, thanks, that is absolutely right.  The first material slot is
actually 0 rather than 1.  I also had to remove the
self.SetRexTemporaryPrim(True)  from the script in order for the
script to work consistently in an empty Realxtend world otherwise the
server didn't save the script between sessions.  I don't really
understand why it works in the Beneath the Waves world but the
programmers have done such a great job so I'm sure there is a good
reason for it.  I've modified the coi_tvscreen.py script so that it
works with 5 different images.

# realXtend - Chambers of Ikuturso

import rxactor
import rxavatar
import sys
import clr

import random
import math

class Screen(rxactor.Actor):
    def GetScriptClassName():
        return "tvscreentest.Screen"

    def EventCreated(self):
        super(self.__class__,self).EventCreated()
        self.PicIndex = 0

        self.MyScreenTimer = self.CreateRexTimer(5,0)
        self.MyScreenTimer.onTimer += self.HandleScreenTimer
        self.MyScreenTimer.Start()

    def EventDestroyed(self):
        del self.MyScreenTimer
        self.MyScreenTimer = None
        super(self.__class__,self).EventDestroyed()

    def HandleScreenTimer(self):
        self.PicIndex += 1
        if(self.PicIndex > 4):
            self.PicIndex = 0

        if(self.PicIndex == 0):
            self.RexSetMaterialByName(0,"picture1")
        elif(self.PicIndex == 1):
            self.RexSetMaterialByName(0,"picture2")
        elif(self.PicIndex == 2):
            self.RexSetMaterialByName(0,"picture3")
        elif(self.PicIndex == 3):
               self.RexSetMaterialByName(0,"picture4")
        elif(self.PicIndex == 4):
            self.RexSetMaterialByName(0,"picture5")

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/realxtend
http://www.realxtend.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to