animated texture + transparency

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

animated texture + transparency

Post by scott »

is it possible go get an animated texture onto an enemy and when a trigger is activated or the enemy dies the normal texture is replaced with the animated one? but most important is transparency within the animated texture.
*GD*
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

For the animated texture you should use a flipbook entity:

Before you do this, you should reassure that you have the 'frames' of your animated texture as bitmaps.

'EntityName' is the name of the pawn that should get this texture.
'TetureName' is the name of the pawn's material you wish to replace with the animated texture.
'BitmapCount' is the number of frames for your animation.
'BaseName' is the 'Base'-Name of the frame-bitmaps - i. e. if your base name is 'fire' then your bitmaps are named 'fire0.bmp', 'fire1.bmp', 'fire2.bmp' and so on.
'TriggerName' is the name of the state (i.e. a trigger or or a state you've set in a script) that activates the texture change. In this case it could be 'texchangetrigger1' or whatever.
'Style' should be 1 i think.

Strangely the transparency of flipbooks does not work when you use texture switching. But we will 'fake' the transparency in the script.

So in your script you should add this to the Die() function:
Die[ ()
{
//Set The trigger to true to activate the texture change - here comes the trigger you've set in 'TriggerName
SetEventState("texchangetrigger1", true);
//Set Transparency to a desired value...
SetAlpha(128.0);
} ]
It's good to remove the FadeOut(...) entry because this could get irritating for the eye otherwise.

Hope this helps
Everyone can see the difficult, but only the wise can see the simple.
-----
Post Reply