I have managed to get a properly working flashlight or rather WE have managed to get a properly functioning flashlight into RF.
Unlike any older buggy flashlights that pitch or yaw funny this one doesn't. It points straight where the camera is looking all the time. Whether up or down, all directions etc.
You will need AndyCR's flashlight pawn demo which has everything you need for the flashlight to work.
Then you need to edit the flashpawn.s script to the following...
I hope many of you find this use. Of course if you want it to turn on and off you will need to script the pawn, and a trigger to switch on and off for whatever key you want to use for the flashlight.{
Spawn[()
{
LowLevel("setup");
}]
setup[()
{
SetNoCollision();
PawnRender(false);
self.yaw_speed = 100000;
self.pitch_speed = 100000;
self.think = "update";
}]
update[()
{
self.ThinkTime = 0.0;
self.ideal_yaw = self.player_yaw;
ChangeYaw();
PositionToPlayer(0, 30, 10, true);
self.ideal_pitch = -(self.camera_pitch);
ChangePitch();
}]
}
Have fun with it as it's really nice. Although I have to give 90% of the credit to AndyCR who brought it halfway, and QOD who finished the job. All I really did was bring it up and start trying to fix it. My scripting ability sucks so QOD fixed my code errors, and added in the proper commands.