Jump to content
  • 0

Zoom/Touch script?


CarneyInc Mint
 Share

You are about to reply to a thread that has been inactive for 5071 days.

Please take a moment to consider if this thread is worth bumping.

Question

So I'm trying to make a script that will help ease the usage of a powerpoint-like presentation. Basically, I want it so that the speaker can click the prim and change the "slide", or texture, but so that everyone else will click and zoom in on it. The speaker is a predetermined person, or group of people, whose name I am putting into the script to give them permissions to run the change texture method.

The problem I have been running into is the fact that if I wanted to use llSetClickAction(CLICK_ACTION_ZOOM), I would have to insert that within the touch_start portion of the program, rendering it ineffective. Is there a function or anything that would allow the avatar who touched the prim to zoom in on it, without setting the click action to zoom? My current (not working) script is below: (NOTE: right now I have click to touch set under prim general settings)

Thanks for any help you can give me guys!!

//From the script library
//Writen by Strife Onizuka
//http://secondlife.com/badgeo/wakka.php?wakka=LibraryTextureSwitcher

float time = 0;

integer total;
integer counter;

next()
{
    string name = llGetInventoryName(INVENTORY_TEXTURE,counter);
    if(name == "")
    {
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
        counter = 0;
        if(total < 1)
            return;
        else
            name = llGetInventoryName(INVENTORY_TEXTURE,counter);
    }
    else if(counter + 1 >= total)
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
    llSetTexture(name ,ALL_SIDES);
    if(total)
        counter = (counter + 1) % total;
}

default
{
    state_entry()
    {
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
        next();
        llSetTimerEvent(time);
    }
    touch_start(integer total_number)
    {
        string user=llDetectedName(0);
        if(user=="XXX")                              //I'm having a compile problem here..."Name not defined
        {                                            //Within scope"
            llSetClickAction(CLICK_ACTION_ZOOM);     //Here inlies the problem: click action being changed
            return;                                  //AFTER it is clicked
        }
        llSetTimerEvent(0);
        next();
        llSetTimerEvent(time);
    }
    timer()
    {
        next();
    }
}

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

hmm, is there an other problem too?

You have this

touch_start(integer a)

which will be triggered if someone clicks the object and as resulting action the objects sets its click-behavior. Seems so as the first click get the old click-behavior. Had You that in mind?

Ciao

Dil

Link to comment
Share on other sites

  • 0

Dil, the (integer a) has (or should have) no bearing on the problem. As for the click action zoom, I am using viewer 2.

 

The problem is not with the coding itself (which compiles and works), but the concept of what I am trying to do is what I need help with.

Link to comment
Share on other sites

  • 0

CarneyInc Mint wrote:

The problem I have been running into is the fact that if I wanted to use llSetClickAction(CLICK_ACTION_ZOOM), I would have to insert that within the touch_start portion of the program, rendering it ineffective. Is there a function or anything that would allow the avatar who touched the prim to zoom in on it, without setting the click action to zoom?

(you will generally get better responses to scripting questions in the forums, where us geeks hang out: http://blogs.secondlife.com/community/forums/scripting)

You can ask permission to take control of and reposition the avatar's camera but that's going to be a lot of work, and very awkward for a audience of several people.  llSetClickAction() should go in the state_entry() event handler, by the way, so it is in effect as early as possible.  As you have noted though, there can only be one click-action, so if it's zoom that applies to everyone.

That leaves the simpler problem of how your presenters can control the board if they can't click it to change the slide (texture).  Unlike zoom, however, there are lots of other control options.  Most obviously there is chat - have them type 'next', 'back', etc.  If that seems too awkward you could create a set of gestures triggered by, for example, F2, F3, etc. that would then command the board.  For a more immersive in-world experience you could create a control-object that the presenters could touch, rather than the board itself.

Link to comment
Share on other sites

  • 0

You should probably set llSetClickAction  in state_entry and put the llSetTimerEvents and Next() where return is currently, the user would then be able to right click->touch to advance the slides. at the The return is preventing the user from doing anything but set the click action. (although anyone but the defined  user could)

 

edit: it would probably work if you changed (user=="XXX") to (user!="XXX")

  • Like 1
Link to comment
Share on other sites

  • 0

Thanks for the help Peter and JAB! I figured that there wasn't a true way to do it the way I wanted to, but thanks for helping!!

 

Peter, I had definitely considered the idea of using another object in order to advance the slides, and will also look into using key commands. I'll make sure to bring any other questions I have to the scripting forums!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 5071 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...