Texture Changer Hologram

Répondre
Partager Rechercher
Hi, dutchie, here again, I am trying to make a hologram fx on a mesh (this is a 2 texture changing script) on the first it is the normal mesh diffuse map texture
and on a second I have an alpha (blending) texture:


// CONFIG //
integer face = ALL_SIDES; // change this value if you want the textures to only cycle on a specific face!
float time = 5.0; // this value determines how many seconds between each texture change.
// CONFIG //
list textures;
integer text_index = 0;
GetTextures()
{
integer i;
integer count = llGetInventoryNumber(INVENTORY_ALL);
while(i < count)
{
string name = llGetInventoryName(INVENTORY_ALL,i);
integer type = llGetInventoryType(name);
if(type == INVENTORY_TEXTURE)
{
textures += name;
}
i++;
}
}
default
{
state_entry()
{
GetTextures();
if(llGetListLength(textures) > 1)
{
llSetTimerEvent(time);
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,llList2String(textures,0),<1,1,0>,<0,0,0>,0]);
}
else
{
llOwnerSay("2 or more textures required to begin cycling!");
}
}
timer()
{
text_index = (text_index + 1) % llGetListLength(textures);
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,llList2String(textures,text_index),<1,1,0>,<0,0,0>,0]);
}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}

I tried to follow lsl wiki but as you know my knowledge is very very very poor, the first problem was the prim alpha mode on the second alpha texture,
so added a line (and want on the alpha texture full bright and set color and glow):

integer face = ALL_SIDES; // change this value if you want the textures to only cycle on a specific face!
float time = 5.0; // this value determines how many seconds between each texture change.
integer Cutoff = 100; // Alpha Blending
// CONFIG //
list textures;
integer text_index = 0;
GetTextures()
{
integer i;
integer count = llGetInventoryNumber(INVENTORY_ALL);
while(i < count)
{
string name = llGetInventoryName(INVENTORY_ALL,i);
integer type = llGetInventoryType(name);
if(type == INVENTORY_TEXTURE)
{
textures += name;
}
i++;
}
}

default
{
state_entry()
{
GetTextures();
if(llGetListLength(textures) > 1)
{
llSetTimerEvent(time);
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,llList2String(textures,0),<1,1,0>,<0,0,0>,0]);
llSetLinkPrimitiveParams(LINK_THIS, [PRIM_ALPHA_MODE,ALL_SIDES, PRIM_ALPHA_MODE_MASK, Cutoff]);
llSetLinkPrimitiveParams(LINK_THIS,[PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
llSetPrimitiveParams([LINK_THIS, PRIM_COLOR, ALL_SIDES, <0, 0, 0>, 1.0, PRIM_COLOR, 0, <0, 1, 0>, 1.0]);
}
else
{
llOwnerSay("2 or more textures required to begin cycling!");
}
}
timer()
{
text_index = (text_index + 1) % llGetListLength(textures);
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,llList2String(textures,text_index),<1,1,0>,<0,0,0>,0]);
}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}

It's somehow working and needs to combine the bold lines, but hey I added an INTEGER first time in my life lol
Is it possible to use textures names in this script also? so I can set certain params on the alpha texture only
I hope this time it's clear what I really want and need for my Stargate SG1 vehicle Models! (hologram museum)
the three bold lines can be joined in one...llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ALPHA_MODE,ALL_SIDES, PRIM_ALPHA_MODE_MASK, Cutoff,PRIM_FULLBRIGHT, ALL_SIDES, TRUE,PRIM_COLOR, ALL_SIDES, <0, 0, 0>, 1.0, PRIM_COLOR, 0, <0, 1, 0>, 1.0]);

you can use texture names here ...

llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,llList2String(textures,0),<1,1,0>,<0,0,0>,0]); becoming
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXTURE,face,"my_texture_name",<1,1,0>,<0,0,0>,0]);
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés