Jump to content
WhisperingPond

Script to start media without touch.

Recommended Posts

Is it possible to start a media, in this case it's just a URL of an image file on my server. The way it works now is that the prim has to be touched for the photo to appear. Is it possible for a script to make the image appear when an avatar reaches a certain distance from the prim. I don't know anything about writing scripts, but I found a couple of sites that let me push a few buttons and create a script automatically. When it involves getting media to show up the way I want, they alway say the prim has to be touched. Thank you.

Share this post


Link to post
Share on other sites

I'm going to vote for a sensor here, though there's several methods that might be considered, depending on the specific circumstances of your setup.

In the state_entry event in the script create a repeating sensor:

state_entry ()
{
    //... the rest of the code. Add:
    llSensorRepeat ("", "", AGENT, 20.0, PI, 5.0);
}

This will scan for any avatars within 20 metres, in all directions, every five seconds.

Replace the touch_start (or possibly touch_end) event with a sensor event:

//touch_start (integer count) //comment out the touch event header and replace it with a sensor event header
sensor (integer count) // replace the variable name "count" with the actual variable name used in the original header
{
    //... with any luck the same code as in the touch event will work in a sensor event
}

I haven't checked that code in-world, so there may be errors. And without seeing the original script, well, who knows...

Good luck!

Share this post


Link to post
Share on other sites
Posted (edited)

The answer is closer to "yes but no."

You cannot force MOAP (media on a prim) to show up on its own. Each viewer has a setting about whether or not media can auto-play. For those that have it off, you're out of luck until they touch the object (but even that can be disabled).

Edited by Wulfie Reanimator

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...