I now have a full script that compiles within Unreal Ed, but I have a problem: I don't know how to make a static mesh actor with my scripted textures. How do I make a static mesh actor with a scripted texture on it? I have the texture, but how do I add it and make the static mesh actor, then apply the script I have written into said actor?
Code: Select all
//=============================================================================
// RPG_DoorPanel
//=============================================================================
class RPG_DoorPanel expands StaticMeshActor;
enum EPanelMode
{
PM_Locked,
PM_Unlocked,
};
var() EPanelMode PanelMode;
var int PanelDisplay;
event PostBeginPlay()
{
if ( ScriptedTexture(MultiSkins[1]) == none )
{
return;
}
else
{
GotoState('PanelDraw');
}
}
State() PanelDraw
{
function Trigger( actor Other, pawn EventInstigator )
{
ScriptedTexture(MultiSkins[1]).NotifyActor = self;
switch PanelMode
{
case PM_Locked:
PanelDisplay = 0;
Gotostate('Begin');
case PM_Unlocked:
PanelDisplay = 1;
Gotostate('Begin');
}
}
Begin:
Sleep(10);
}
/* RenderTexture will be edited later to diplay either "X" or "O". */
event RenderTexture( ScriptedTexture Tex)
{
local Color TheColor;
TheColor.G = 255;
TheColor.R = 255;
if ( PanelDisplay == 1 )
Tex.DrawColoredText( 76, 7, string(PanelDisplay), Font'CondemnedFont', TheColor);
else if ( PanelDisplay == 0 )
Tex.DrawColoredText( 78, 7, string(PanelDisplay), Font'CondemnedFont', TheColor);
}