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

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

Recommended Posts

Posted

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.

Posted

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!

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
  • 1 year later...
Posted (edited)

the only way is to use something like llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AGENT,"here the key id of the avatar that is going to use the media",PARCEL_MEDIA_COMMAND_URL,"your media url here",PARCEL_MEDIA_COMMAND_PLAY, PARCEL_MEDIA_COMMAND_TYPE, "audio/basic"]);  

But in order to force a play you need to shot that address with post method in a php script and you need to use llOpenRemoteDataChannel

Edited by Manolo Unplugged
Posted
8 hours ago, Manolo Unplugged said:

the only way is to use something like llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AGENT,"here the key id of the avatar that is going to use the media",PARCEL_MEDIA_COMMAND_URL,"your media url here",PARCEL_MEDIA_COMMAND_PLAY, PARCEL_MEDIA_COMMAND_TYPE, "audio/basic"]);  

But in order to force a play you need to shot that address with post method in a php script and you need to use llOpenRemoteDataChannel

Thank you. I've never tried writing a script. Do I simply copy and paste your sample (along with my URL) into a note and save it as a script? Or is there something more? 

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