The script is activated with an inventory item that runs it when given, then removes itself from the player's inventory once it's done. I'm not sure if owner.player.desiredFOV and owner.player.FOV are the same thing, but they seem to give the same results as eachother and are just the updated in-game fov value from what I can tell.
Code: Select all
int counter;
int dfov;
int pfov;
override void DoEffect()
{
dfov = owner.player.desiredFOV;
pfov = owner.player.FOV;
if (counter < 4)
{
pfov += 2;
owner.player.setFOV(clamp(pfov, 0, dfov + 8));
counter++;
}
if (counter >= 4 && counter < 7)
{
pfov -= 2;
owner.player.setFOV(clamp(pfov, 0, dfov + 8));
counter++;
}
if (counter == 8)
{
owner.RemoveInventory(self);
}
}
