Jump to content

Is there a way to ignore a specific parameter?


Onamiko
 Share

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

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

Recommended Posts

Hi, i am new to scripting, and wonder if there is a way to ignore a specific parameter, for example:

llSetPrimitiveParams([ PRIM_SPECULAR, ALL_SIDES, "e60ef3a0-06cb-71e6-7af7-a2b3cd6f710e", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, <0, 0, 0> , 1, 50]);

The parameter colored in red is responsible for coloring, is there a way to ignore it so the script does not change the color?

Thanks!

Link to comment
Share on other sites

15 minutes ago, Onamiko said:

The parameter colored in red is responsible for coloring, is there a way to ignore it so the script does not change the color?

No, it's not optional. All parameters must be there and are used. You need to obtain/store the specular environment colour and re-apply it.

  • Like 1
Link to comment
Share on other sites

You use black as color, which could be on purpose(?) - but else white <1.0, 1.0, 1.0> ensures the texture can been seen and does not effect coloring of the given texture. Creative use of colors though can enhance the shine effects.

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, Onamiko said:

llSetPrimitiveParams([ PRIM_SPECULAR, ALL_SIDES, "e60ef3a0-06cb-71e6-7af7-a2b3cd6f710e", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, <0, 0, 0> , 1, 50]);

You have set the specular colour to black in that statement, since the specular map is multiplied by the specular colour to determine the colour of the specular highlights, you have basically turned off the highlights while still using bandwidth and texture memory for the specular map loading.

Either grab the specular colour as Callum suggested, and store it in a variable, then reuse it, or set a specular colour, either white or some suitable "white with a hint of [whatever]" shade.
 

  • Like 1
Link to comment
Share on other sites

Thanks everyone for the reply. 

Alright, here is why i don't want it to change the color:

I have a kayboard i am working on. It has 2 prims, the main one and the LED prim underneath the buttons. In my script, the owner can set the color of the LED prim and the specular map of the main prim to whatever color he desires, for example, Yellow, Blue Or Green. So that both the LED prim and Specular Map colors are the same. Examples:
Snapshot_005.thumb.png.297ca9b31a88548545b273ce4e767b8d.png

Snapshot_008.thumb.png.590dffe3e44f876886723ffd585d277f.png

There is a an option in the script that "Turns Off" the keyboard, which basically makes the LED prim transparent and the Specular map of the main prim to have no glossiness, which makes it sorta uncolored.

Snapshot_006.thumb.png.18b7c82f4fbddd04303d258061d38bba.png

 

What i want is when the owner "Turns On" the keyboard once again, it will have the same colors he selected before. In this case, same red color for both the LED prim and Specular Map. But the issues that i originally stated prevents this from happening, since i need to use the specific color parameter. And thus it results into this:

Snapshot_009.thumb.png.34becc5e06662a9260c5588dfe20cd24.png

 

Question: If there is no way to ignore the color parameter in llSetPrimitiveParams, then is there a way to restore the previously selected parameter based on the one the user chose before turning off the keyboard?

Thanks!

 

Edited by Onamiko
Link to comment
Share on other sites

Just keep a global variable called user_selected_color or whatever, store the user's choice to it, and add that to all llSetPrimitiveParams.

As a side note, I would highly recommend always using llSetLinkPrimitiveParamsFast instead. The other "set prim params" functions have a forced delay of 0.2 seconds. It probably isn't noticeable in a small object like this, but there's no reason to not use the Fast version. 

  • Like 2
Link to comment
Share on other sites

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