Jump to content

Start/Stop race course script need help


Nagla Cooperstone
 Share

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

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

Recommended Posts

Hello all,

Last time I posted I was asked to research and wiki the problem before coming back,  I use LSL Editor 2.56 to assist me. Thank you :)

This is for OpenSim

I have 3 prims linked together, 1st is the start, the 2nd is the stop, and the 3rd is  a board to post results to(or above not picky).

The following script is the root prim script, it starts on a single touch and stops on a double touch, it can start or stop from either 1 or 2. When it starts the timer/counter counts off the seconds in open channel until you reach the other and double touch it, at which time it is suppose to stop say the count and you finished the course. 

I also placed a llregionsay on channel 25 to send the information to the board, but I cannot get the information correctly after stopping or at the board. could someone please take a look and let me know how I can fix this.

 

 

Script: Start/Stop Course Script:

 

// Start/Stop race course 2 prim objects(separated)1 board
integer board = 0;
integer count = 0; 
float gHoldTime;
 
default
{
    state_entry()
    {
        llSetText("Single Touch Start/Double Touch Stop", <0.0,1.0,0.0>, 1);
    }
    touch_start(integer total_number)
    {
        float now = llGetTime();
        if (now - gHoldTime < 0.3)
        {
            llSay(0,"You Finshed The Course");
            llSetTimerEvent(0.0);
            llResetScript();
            // Trigger one sequence of actions
        }
        else
        {
           llSetTimerEvent(1.0);
          
        }
        gHoldTime = now;
    }
 
    timer()
    {
        if (llGetTime()-gHoldTime > 0.3)
        {
           // llSay(PUBLIC_CHANNEL,"You Started The Course ");
            llSetTimerEvent(1.0);
            count ++;
            board = count;
            llRegionSay(25,"This is an incredibly useless program." );


            llSay(0,(string) count + " Seconds ago you started the course.");
            // Trigger a different sequence of actions
        }
    }
}

Link to comment
Share on other sites

It looks fine to me.  Here's what the output looks like:


[21:01] Sending object: 1 Seconds ago you started the course.
[21:01] Receiving object: This is an incredibly useless program.
[21:01] Sending object: 2 Seconds ago you started the course.
[21:01] Receiving object: This is an incredibly useless program.
[21:01] Sending object: 3 Seconds ago you started the course.
[21:01] Receiving object: This is an incredibly useless program.
[21:01] Sending object: 4 Seconds ago you started the course.
[21:01] Receiving object: This is an incredibly useless program.
[21:01] Sending object: 5 Seconds ago you started the course.
[21:01] Receiving object: This is an incredibly useless program.
[21:01] Sending object: You Finshed The Course

So, what did you expect it to say?  Your Sending Object sends the "This is an incredibly useless program" message to the Receiving Object on channel 25.  I started the Sending object script with a single click and stopped it with a double click.

Link to comment
Share on other sites

Thanks for the quick response, in the LSL editor that is exactly what it says and does, but when placed in the objects them self it says:

 

[21:12] Archery Start/Finish: 1 Seconds ago you started the course.
[21:12] Archery Start/Finish: 2 Seconds ago you started the course.
[21:12] Archery Start/Finish: 3 Seconds ago you started the course.
[21:12] Archery Start/Finish: 4 Seconds ago you started the course.
[21:12] Archery Start/Finish: 5 Seconds ago you started the course.
[21:12] Archery Start/Finish: 6 Seconds ago you started the course.
[21:12] Archery Start/Finish: 7 Seconds ago you started the course.
[21:12] Archery Start/Finish: 8 Seconds ago you started the course.
[21:12] Archery Start/Finish: 9 Seconds ago you started the course.
[21:12] Archery Start/Finish: 10 Seconds ago you started the course.
[21:12] Archery Start/Finish: 11 Seconds ago you started the course.(one statement line)
[21:12] Archery Start/Finish: You Finished The Course(Another statement line)

Would Like to say" You have finished the couse in XX seconds"

 

 

The statement that I am trying to get the statement "You Finished the course in ((string)count )XX seconds" . in the same line as you can see it is 2 different statements also to transmit to the 3rd prim(board) on channel 25. 

Hoping to be able to place it on the board similar to a score board (3rd Prim), the other script I can not get it to receive the information at all to llSetText() or llSay().

 

hopefully that makes more sense of my problem :) 

Link to comment
Share on other sites

You mean, as in:

2 hours ago, Nagla Cooperstone said:

if (now - gHoldTime < 0.3)
        {
            llSay(0,"You finished the course in "  + (string) count + " seconds.");
            llSetTimerEvent(0.0);
            llResetScript();
            // Trigger one sequence of actions
        }

?

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1208 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...