StaticEntityProxy and Usekey

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
WebsterX37
Posts: 16
Joined: Sat Jul 07, 2007 4:44 pm
Location: Berlin, Germany

StaticEntityProxy and Usekey

Post by WebsterX37 »

Hello,

I am relatively new to this but finally managed to create a first actorfile for RF. A simple TV. I placed it into my level and it looks fine so far. Now I want the TV to be turned on (maybe change the texture of a face and animate it) by the Player.

The StaticEntityProxy has a Usekey Field but I have no Idea about how to use it. My Model has a simple cube as TVtrigger
with one animation (use). Any Ideas?

Thanx a lot
Webster
WebsterX37
Posts: 16
Joined: Sat Jul 07, 2007 4:44 pm
Location: Berlin, Germany

Post by WebsterX37 »

..did not find a way better then using an

Attribute with a switch.act as actor (setting the Attribute to be triggered by UseKey),
setting the Attribute to ReSpawn with 0.0 delay, setting the AtrributeAmount to 0,
triggering a logicgate as FlipFlop,
the logicgate then triggers a flipbook,

any better way?

:roll:
WebsterX37
Posts: 16
Joined: Sat Jul 07, 2007 4:44 pm
Location: Berlin, Germany

Post by WebsterX37 »

:D

Me answering my question :-))
Who whom it may concern, I have found a better way: making a pawn and scripting it. Took me quite
long to figure it out, I am not really a programmer and new to RF:

{
ACTIVATERANGE [70]

Spawn[()
{
Console(true);
AttributeOrder("health",100,"Die");
SetFOV(360);
HostilePlayer(false);
HostileSame(false);
HostileDifferent(false);
IsPushable(true);
SetGroup("TV");
SetFlag(1,true);
NewOrder("IdleState");
}]

Die[()
{
Remove(true);
}]

IdleState[()
{
self.ThinkTime=1;
debug(self.key_pressed);
if(self.player_range<ACTIVATERANGE)
{
if(self.key_pressed=16)
{
if(GetFlag(1)=true)
{
PlayAnimation("on", true, "" );
PlayAnimation("on_idle", true, "" );
}
else
{
PlayAnimation("off", true, "" );
PlayAnimation("off_idle", true, "" );
}
if(GetFlag(1)=true)
{
SetFlag(1,false);
}
else
{
SetFlag(1,true);
}
}
}
RestartOrder();
}]
}


But I think it could be shorter. Any better way? Changing the Material should be easy now.
Post Reply