Jump to content

Texture change script - please can somebody point me in the right direction?


Mauricette Morane
 Share

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

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

Recommended Posts

This may have been asked before, if so please feel free to redirect me...

I've just build this skybox, and made two on the walls texture change; nothing fancy, just a simple "cycle through textures on touch" type script. It works very nicely. Now, I seem to have this vague idea that having a texture change script in more than one prim is actually not that efficient...but I don't know to what extent it's not efficient. Is this something that can be measured? If so, how would I do that? And - this may be a stupid question, sorry! - why is it inefficient?

I guess that the alternative is to have something I've seen in some builds, with a small prim on the wall that you touch and that brings up a menu of options, from which you can choose what you want to change (ie wall, floors...), and then choose a texture, but I don't have the faintest idea yet as to how to do that, or even what search terms to put into Google (this is usually my first step when I want to find out about something) to find one. Please could anybody point me in the right direction?

I ask because at some point I will want to put up the skybox for sale, and ...well, making the thing as efficient as possible just seem the right thing to do...

Thank you so much for anybody who might be able to help.

Link to comment
Share on other sites

This function causes the script to sleep for 0.2 seconds. 

You could try a listen command in each wall that will change texture from one llSay command i.e a button.

The better less laggy methid would be llLinkMessage, however this would only work well untill you start de-linking parts.

Both options have their pros and cons, if you use the llListen, use high negative numbers to reduce the amount of lag.

Link to comment
Share on other sites

What I hear you say is that it takes forever to change textures
When you do it in the straight forward manner the new texture starts downloading the minute you touch the button and that takes forever when you are waiting for it to happen
There are a handful of tricks to overcome this used primarily in slide shows(you may search for that)
One is to load the next texture on a hidden surface while you are showing one texture
Another is to use one texture divided into more sub textures

In a linkset you can use one script using llLinkSetPrimitiveParams to change the texturing of any face in the linkset
Whether you use the slow(0.2S delay) or the fast version is up to you

For unlinked prims you must have a script in each prim to do the texturing
Communication between prims will be painless if you use llRegionSay() or llRegionSayTo()

Link to comment
Share on other sites

having a script in each prim is inefficient because the region has to load all the scripts... yet you can do the same thing from a single script. you can test this most simply by taking the build to an empty region, and opening the region stats and watching the performance numbers.

you'll notice that a single house may not seem to have a huge impact, but multiply that by all the buildings on the region and add avatars and vehicle an other scripted goodies to the mix and you'll quickly begin to see that every little bit makes a difference.

 

I'm not going to lie, single script texture changers that handle multiple prims with multiple textures on multiple faces can get rather complex very quickly. I personally still haven't found a good general solution that does it and protects the texture uuid's from theft without direct editing of the script and a lot of complex information.

Link to comment
Share on other sites

@Turokhan - thanks for the tip. I would actually want all walls to be changeable separately, so presumably, I need as many menu options as I have texture change walls?

 @Dora - well, actually, I haven't looked into how fast the textures load yet (they loaded fast when I was testing, but that's probably because they're in memory from playing around with them so much), but thanks for the tips! 

@Void - many thanks! That makes sense. I'll be on a quest for something that works for me. I know they're out there (I've seen them), I know I could buy one even, but I'd like to have a shot at writing one myself first (famous last words...)

Thank you again!

Link to comment
Share on other sites

I made one many moons ago for a specific creator, and I still get requests from people looking to buy it. unfortunately my attempts at making it secure, yet closed source, and still easy to use didn't work out too well... so only that particular creator has license to use it (my agreement with them was for full right and I'd only resell after a set time, and then only if I manged to close the source.)

Link to comment
Share on other sites

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