Security cameras
Security cameras
Hi, I am going to try to include the ability in my game to take control of cameras with a special gun so that you can see round corners to check for bad guys. Is this possible using just entitys if not how else could I do it. Thanks in advance
Re: Security cameras
Well, with a bit of scripting it's definitely possible:
Just add a pawn with this script:
Give the pawn a name (szEntityName). This name will then be the trigger for a FixedCamera entity you're going to use to change the view. So add a FixedCamera entity and in the field ForceTrigger enter the name of the pawn.
Just add a pawn with this script:
Code: Select all
{
ATTRIBUTE [enemy_health] //attribute that needs to be damaged for the camera to kick in
TIMEON [3] //how many seconds the camera is active
ABORTKEY [46] //the key that deactivates the camera instantly
//46 is space
timer [0]
initialview [0]
Spawn[ ()
{
Gravity(false);
NewOrder("Init");
} ]
Init[ ()
{
SetEventState(EntityName,false);
AttributeOrder(ATTRIBUTE,1,"RunCamera");
NewOrder("Wait");
} ]
Wait[ ()
{
} ]
RunCamera[ ()
{
SetEventState(EntityName,true);
timer = time + TIMEON;
initialview = player_viewpoint;
LowLevel("activate");
} ]
activate[ ()
{
ThinkTime = 0;
SwitchView(3);
SetKeyPause(true);
if((timer < time) or IsKeyDown(ABORTKEY))
{
SetKeyPause(false);
SwitchView(initialview);
HighLevel("Init");
return;
}
} ]
}
Pain is only psychological.
Re: Security cameras
Cool i'll try it out tommrow. Thanks a lot juutis