Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I need a cross fade script:(

Random Padar
Registered User
Join date: 6 Oct 2005
Posts: 36
09-15-2008 12:13
I have been searching for a Cross Fade script. One that fades one texture to another. I need full permissions. If anyone knows of where I can get one I would love you to pieces! TY
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
09-15-2008 13:09
It's not really possible to fade a surface from one texture to another, I'm afraid, because SL doesn't let you do multi-texturing (i.e. displaying more than one texture at the same time on the same face).

The best you could do is fake it by having the first texture on a surface slightly in front of the other. You can then simulate the cross-fade by steadily reducing the first surface's alpha (opaqueness) to 0.
Random Padar
Registered User
Join date: 6 Oct 2005
Posts: 36
hummm
09-15-2008 20:40
I have seen prims with cross fade scripts in them. Im not sure I understand the one texture slightly in front of the other?
Faust Vollmar
llSetAgentSanity(FALSE);
Join date: 3 Feb 2007
Posts: 87
09-15-2008 21:18
It would have to be two seperate prims, the bottom/back one always being opaque the front one cycling alpha value. Pretty much like this:

Prim 1: 100% Picture 1
Prim 2: 100% Picture 2
Prim 1: Fades out (on a timer?) till 0%
Prim 2: 100% (never changes)
Prim 1: Reset to 100%, has Picture 2 applied to it.
Prim 2: Has picture 3 applied to it.

With the fade and handoff always repeating.
madddyyy Schnook
SLGuides Virtual Worlds
Join date: 2 Jan 2006
Posts: 207
09-16-2008 08:23
it is possible with one prim, darkening the prim and when it goes fully dark the next textureloads and it lightens back again. not really cross fading, but only one prim.
Random Padar
Registered User
Join date: 6 Oct 2005
Posts: 36
ty!
09-16-2008 08:39
ok Got ya:) What script would I use to make prim one fade out? Sorry if Im a pest:) I so appreciate the help.

And TY Renee Im working with what you gave me trying to figure it out:)
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
09-16-2008 10:30
Join Script Academy group, ask the owner Ilse for a crossfade script. She wrote one. Or check group notices.
_____________________
Jocko Domo japanese goods



[Blog]
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
09-16-2008 10:38
If you use the 2-prim method, you will probably want to put a frame around them, because as alphas fade and cross over, you will be able to see parts of surrounding scenery flickering between the two prims.
.
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
09-16-2008 11:32
From: madddyyy Schnook
it is possible with one prim, darkening the prim and when it goes fully dark the next textureloads and it lightens back again. not really cross fading, but only one prim.


Aha, that's a good solution. Now why didn't I think of that? :-)
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
09-17-2008 02:11
In 1 prim? How about using the inside and outside of a hollow box? Just put at least 2 images and this script in a prim. The script makes it a hollow box and sets the texture params correct.

CODE

integer Loop = 2;
integer side;
integer Textures;
float Time = 15.00;
string tex1;
string tex2;
float x;

default
{
state_entry()
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0, 1.0, 0.0>, 95.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>] );
llSetPrimitiveParams([PRIM_TEXGEN, ALL_SIDES, PRIM_TEXGEN_PLANAR]);
llScaleTexture(0.1,0.1,ALL_SIDES);
llSetPrimitiveParams([PRIM_SIZE, <0.01, 6, 4>]);
llSetTimerEvent(Time);
Textures = llGetInventoryNumber(INVENTORY_TEXTURE);
tex1=llGetInventoryName(INVENTORY_TEXTURE, 0);
tex2=llGetInventoryName(INVENTORY_TEXTURE, 1);
llSetAlpha(1,4);
llSetTexture(tex1, 4);
llSetTexture(tex2,5);
}

timer()
{
for (x=1;x>-0.001;x=x-0.001) llSetAlpha(x,4);
tex1=tex2;
tex2=llGetInventoryName(INVENTORY_TEXTURE, Loop);
llSetTexture(tex1,4);
llSleep(2);
llSetAlpha(1,4);
llSetTexture(tex2,5);
++Loop;
if (Loop == Textures) Loop = 0;
}

changed(integer change) { // something changed
if (change & CHANGED_INVENTORY) { // and it was a link change
Textures = llGetInventoryNumber(INVENTORY_TEXTURE);
tex1=llGetInventoryName(INVENTORY_TEXTURE, 0);
tex2=llGetInventoryName(INVENTORY_TEXTURE, 1);
llSetAlpha(1,4);
llSetTexture(tex1, 4);
llSetTexture(tex2,5);
Loop=2;
}
}
}
Random Padar
Registered User
Join date: 6 Oct 2005
Posts: 36
Thanks:)
09-18-2008 10:59
I tried the 1 prim with the script but I get a script error making it. I dont know enough about scripting to see the problem. :((
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-19-2008 06:32
From: Random Padar
I tried the 1 prim with the script but I get a script error making it. I dont know enough about scripting to see the problem. :((


is it syntax errors? where is it telling you the problem is?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
09-21-2008 09:20
I checked and this is what is happening:

1. Load 2 pictures and the script into an object
2. Object transforms properly
3. First image displays fine
4. Timer begins
5. Second image displays fine
6. Timer begins
7. Error Message: Object: Could not find texture ''.

Then the loop stops.
Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
09-21-2008 13:26
If I change the loop to 1 instead of 2, it works fine:

CODE

integer Loop = 1;
CODE


I think since the first texture is texture 0 and the second is texture 1, when it tried to grab texture 2, it could not find it because technically, texture 2 is really texture 1. Works fine now.