Jump to content
You are about to reply to a thread that has been inactive for 104 days.

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

Recommended Posts

Posted

Heya!

Got another head scratcher that's confusing my basic scripter brain. I've got a script that is basically a touch screen for a car, complete with sections of the 'screen' that are laid out to be touch sensitive, IE a row of 4 buttons on the texture are set up to be touched like actual buttons, each with their own sub set of buttons. The script works flawlessly outside of mouselook, and used to work within ML weirdly enough just before the PBR viewer released but now does not.

I've got the script to say aloud the area touched, in this case the icon that says SCREEN SAVER on the image below:

Center UI: Touched at ST: <0.37138, 0.73832, 0.00000> UV: <0.18568, 0.86917, 0.00000> This is the correct area to be touched, out of ML.
Center UI: Touched at ST: <-1.00000, -1.00000, 0.00000> UV: <-1.00000, -1.00000, 0.00000> This is the same area clicked while in ML and the intended result does not trigger due to the random location it returned. The script I used can use either llDetectedTouchST or UV but neither works in ML.

image.png.42ad65a4055b142c04334dd608203995.png

I've been told SL is picky and has different ways of detecting touch and other users have found ways around the same issue I have.

Any suggestions to what could be done?

Thanks again

Posted

The <-1, -1, 0> is a return value for no valid touch coordinates, I'd chalk this up to mouselook being weird.

I tested it with a minimal script, the touch_start event almost always returns invalid coordinates and the touch event might return an invalid coordinate on the first time. Touch_end appears to return proper values about every time. Using touch_end might be reliable enough in that case.

Here's the script I put on a cube for testing:

default
{
    touch_start(integer total_number)
    {
        llOwnerSay("start: " + (string)llDetectedTouchST(0));
    }
    touch(integer total_number)
    {
        llOwnerSay("touch: " + (string)llDetectedTouchST(0));
    }
    touch_end(integer total_number)
    {
        llOwnerSay("end: " + (string)llDetectedTouchST(0));
    }
}

 

Posted

Okay, that's odd, I tested it on Firestorm 7.1.9, outside mouselook all events return sane coordinates, in mouselook the touch_start fails every time and the first touch might fail or it might not. That's all I've got, sorry.

Posted

Honestly I'm pretty sure its just me as I have other weird 'that should work but doesn't for whatever reason' scripts that have stumped so many people hahaha! Thanks for the help though!

You are about to reply to a thread that has been inactive for 104 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
×
×
  • Create New...