Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).

Painkiller: Black Edition - FPS Configuration Addition

Releases and other info for the Painkiller game series.
Post Reply
User avatar
atom0s
Site Admin
Posts: 401
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Painkiller: Black Edition - FPS Configuration Addition

Post by atom0s » Sun Jun 14, 2015 11:50 am

Here is a quick guide on how to add single player fps settings to the game.

File: <Painkiller Root>\Data\LScripts\Main\Cfg.lua
File: <Painkiller Root>\Data\LScripts\Main\Game.lua
File: <Painkiller Root>\Data\LScripts\HUD\Console.lua
  • Find function Console:Cmd_SETMAXFPS, replace it with this:
    1. function Console:Cmd_SETMAXFPS(val)
    2.     if val == nil then
    3.         CONSOLE.AddMessage( "Give a new value after this command to change maxfps." )
    4.         CONSOLE.AddMessage( "Give a 0 to remove the limit." )
    5.         return
    6.     end
    7.     val = tonumber(val)
    8.     if val then
    9.         WORLD.SetMaxFPS(val)
    10.         if Game.GMode == GModes.MultiplayerClient then
    11.             Cfg.MaxFpsMP = val
    12.         else
    13.             Cfg.MaxFpsSP = val
    14.         end
    15.     end
    16. end
Now when the game loads it will default to 60 fps. You can now use the \setmaxfps command to edit the single player FPS amount and it will save/load when the game is restarted automatically.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
User avatar
Peppins
Posts: 3
Joined: Sun Jun 14, 2015 11:52 am

Re: Painkiller: Black Edition - FPS Configuration Addition

Post by Peppins » Mon Jun 15, 2015 12:41 am

Great one, many thanks!!!!!!

But this line isn't useful:
  1. if Cfg.MaxFpsSP == 0 then
  2.         Cfg.MaxFpsSP = 60
  3.     end
You can remove it so when you write /setmaxfps 0 the value will go to 0 so unlimited fps as default (useful for benchmark):
  1. CONSOLE.AddMessage( "Give a 0 to remove the limit." )
I also prefer to set the default MaxFpsSP as default MaxFpsMP:
  1. MaxFpsMP =120,
  2. MaxFpsSP = 120,
I've also done a fix so that now the limiter work also if you start a new multiplayer game (instead of just on client..)

Added that in the Game.lua:
  1. WORLD.SetMaxFPS(Cfg.MaxFpsMP)
below:
  1. self:OnMultiplayerClientTick(delta)
Also modified a little the Console.lua, see the attachment and the readme for more info.

Here is a quick download link for who want a easy way to use the fix. Click here or see the attachment.
Attachments
Painkiller SinglePlayer FPS Limiter_v2.rar
(24.41 KiB) Downloaded 103 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest